diff --git a/openlp/core/lib/settings.py b/openlp/core/lib/settings.py index cf98896a9..0bd498df9 100644 --- a/openlp/core/lib/settings.py +++ b/openlp/core/lib/settings.py @@ -42,8 +42,8 @@ class Settings(QtCore.QSettings): * Exposes all the methods of QSettings. * Adds functionality for OpenLP Portable. If the ``defaultFormat`` is set to ``IniFormat``, and the path to the Ini file is set using ``setFilename``, - then the Settings constructor will create a Settings object for accessing - settings stored in that Ini file. + then the Settings constructor (without any arguments) will create a Settings + object for accessing settings stored in that Ini file. """ FilePath = u'' @@ -56,11 +56,10 @@ class Settings(QtCore.QSettings): Does not affect existing Settings objects. """ Settings.FilePath = filepath - log.info(u'Set Settings file: %s' % filepath) def __init__(self, *args): - if Settings.FilePath and (Settings.defaultFormat() == - Settings.IniFormat): + if not args and Settings.FilePath and (Settings.defaultFormat() == + Settings.IniFormat): QtCore.QSettings.__init__(self, Settings.FilePath, Settings.IniFormat) else: diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index 8e55bfec8..a2551d7f1 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -956,7 +956,7 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow): for plugin in self.pluginManager.plugins: setting_sections.extend([plugin.name]) settings = Settings() - import_settings = QtCore.QSettings(import_file_name, + import_settings = Settings(import_file_name, Settings.IniFormat) import_keys = import_settings.allKeys() for section_key in import_keys: @@ -1046,7 +1046,7 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow): settings.remove(self.headerSection) # Get the settings. keys = settings.allKeys() - export_settings = QtCore.QSettings(temp_file, + export_settings = Settings(temp_file, Settings.IniFormat) # Add a header section. # This is to insure it's our conf file for import.