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.
* 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:

View File

@ -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.