changeset 31615:40b151abbb9b

don't attempt to restore settings from old qt-settings config file We changed the default settings file name in 2019. It's time to let the old name go. * resource-manager.cc (resource_manager::resource_manager): Don't attempt to copy settings from old qt-settings file used by Octave prior to March 2019.
author John W. Eaton <jwe@octave.org>
date Fri, 02 Dec 2022 10:07:32 -0500
parents 59c9da7c43d6
children 726d2628752c
files libgui/src/resource-manager.cc
diffstat 1 files changed, 0 insertions(+), 39 deletions(-) [+]
line wrap: on
line diff
--- a/libgui/src/resource-manager.cc	Fri Dec 02 08:58:41 2022 -0500
+++ b/libgui/src/resource-manager.cc	Fri Dec 02 10:07:32 2022 -0500
@@ -76,45 +76,6 @@
 
     QFileInfo sfile (m_settings_file);
     m_settings_directory = sfile.absolutePath ();
-
-    QString xdg_config_home
-      = QString::fromLocal8Bit (qgetenv ("XDG_CONFIG_HOME"));
-
-    if ((! sfile.exists ()) && xdg_config_home.isEmpty ())
-      {
-        // File does not exist yet: Look for a settings file at the old
-        // location ($HOME/.config/octave/qt-settings) for impoting all
-        // available keys into the new settings file.
-        // Do not look for an old settings file if XDG_CONFIG_HOME is set,
-        // since then a nonexistent new settings file does not necessarily
-        // indicate a first run of octave with new config file locations.
-#if defined (HAVE_QSTANDARDPATHS)
-        QString home_path
-          = QStandardPaths::writableLocation (QStandardPaths::HomeLocation);
-#else
-        QString home_path
-          = QDesktopServices::storageLocation (QDesktopServices::HomeLocation);
-#endif
-
-        QString old_settings_directory = home_path + "/.config/octave";
-        QString old_settings_file = old_settings_directory + "/qt-settings";
-
-        QFile ofile (old_settings_file);
-
-        if (ofile.exists ())
-          {
-            // Old settings file exists; create a gui_settings object related
-            // to it and copy all available keys to the new settings
-            gui_settings old_settings (old_settings_file, QSettings::IniFormat);
-
-            QStringList keys = old_settings.allKeys ();
-            for (int i = 0; i < keys.count(); i++)
-              m_default_settings->setValue (keys.at(i),
-                                            old_settings.value(keys.at(i)));
-
-            m_default_settings->sync ();  // Done, make sure keys are written
-          }
-      }
   }
 
   resource_manager::~resource_manager (void)