# HG changeset patch # User John W. Eaton # Date 1669995373 18000 # Node ID 1f57ea5dfd4a1e7c13899b44f1aff77e820f5cf7 # Parent 726d2628752cecae4e1fc3b77401f75260114473 don't allow settings file name to be changed * resource-manager.h, resource-manager.cc (resource_manger::check_settings): Rename from set_settings and declare as private funtion. Eliminate file name argument. Change all uses. (resource_manger::resource_manger): Also check settings here. diff -r 726d2628752c -r 1f57ea5dfd4a libgui/src/resource-manager.cc --- a/libgui/src/resource-manager.cc Fri Dec 02 10:10:19 2022 -0500 +++ b/libgui/src/resource-manager.cc Fri Dec 02 10:36:13 2022 -0500 @@ -72,6 +72,8 @@ m_settings = new gui_settings (); + check_settings (); + m_settings_file = m_settings->fileName (); QFileInfo sfile (m_settings_file); @@ -313,7 +315,7 @@ custom_editor = QString::fromStdString (env_default_editor); } - set_settings (m_settings_file); + check_settings (); // Write some settings that were dynamically determined at first startup if (m_settings) @@ -434,11 +436,8 @@ } #endif - void resource_manager::set_settings (const QString& file) + void resource_manager::check_settings (void) { - delete m_settings; - m_settings = new gui_settings (file, QSettings::IniFormat); - if (m_settings->status () == QSettings::NoError) { // Test usability (force file to be really created) diff -r 726d2628752c -r 1f57ea5dfd4a libgui/src/resource-manager.h --- a/libgui/src/resource-manager.h Fri Dec 02 10:10:19 2022 -0500 +++ b/libgui/src/resource-manager.h Fri Dec 02 10:36:13 2022 -0500 @@ -87,8 +87,6 @@ int mode = 0, int def = 0); #endif - void set_settings (const QString& file); - bool update_settings_key (const QString& new_key, const QString& old_key); bool is_first_run (void) const; @@ -104,6 +102,8 @@ private: + void check_settings (void); + /*! * Copys the attributes bold, italic and underline from QFont * @p attr to the font @p base and returns the result without