Removed last Qtcore.Qsetting usage

This commit is contained in:
Stevan Pettit 2012-05-24 07:02:01 -04:00
parent 7bc4c5f318
commit ec27884d39
2 changed files with 6 additions and 7 deletions

View File

@ -42,8 +42,8 @@ class Settings(QtCore.QSettings):
* Exposes all the methods of QSettings. * Exposes all the methods of QSettings.
* Adds functionality for OpenLP Portable. If the ``defaultFormat`` is set to * Adds functionality for OpenLP Portable. If the ``defaultFormat`` is set to
``IniFormat``, and the path to the Ini file is set using ``setFilename``, ``IniFormat``, and the path to the Ini file is set using ``setFilename``,
then the Settings constructor will create a Settings object for accessing then the Settings constructor (without any arguments) will create a Settings
settings stored in that Ini file. object for accessing settings stored in that Ini file.
""" """
FilePath = u'' FilePath = u''
@ -56,11 +56,10 @@ class Settings(QtCore.QSettings):
Does not affect existing Settings objects. Does not affect existing Settings objects.
""" """
Settings.FilePath = filepath Settings.FilePath = filepath
log.info(u'Set Settings file: %s' % filepath)
def __init__(self, *args): def __init__(self, *args):
if Settings.FilePath and (Settings.defaultFormat() == if not args and Settings.FilePath and (Settings.defaultFormat() ==
Settings.IniFormat): Settings.IniFormat):
QtCore.QSettings.__init__(self, Settings.FilePath, QtCore.QSettings.__init__(self, Settings.FilePath,
Settings.IniFormat) Settings.IniFormat)
else: else:

View File

@ -956,7 +956,7 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
for plugin in self.pluginManager.plugins: for plugin in self.pluginManager.plugins:
setting_sections.extend([plugin.name]) setting_sections.extend([plugin.name])
settings = Settings() settings = Settings()
import_settings = QtCore.QSettings(import_file_name, import_settings = Settings(import_file_name,
Settings.IniFormat) Settings.IniFormat)
import_keys = import_settings.allKeys() import_keys = import_settings.allKeys()
for section_key in import_keys: for section_key in import_keys:
@ -1046,7 +1046,7 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
settings.remove(self.headerSection) settings.remove(self.headerSection)
# Get the settings. # Get the settings.
keys = settings.allKeys() keys = settings.allKeys()
export_settings = QtCore.QSettings(temp_file, export_settings = Settings(temp_file,
Settings.IniFormat) Settings.IniFormat)
# Add a header section. # Add a header section.
# This is to insure it's our conf file for import. # This is to insure it's our conf file for import.