forked from openlp/openlp
fixed bug caused by merge
This commit is contained in:
parent
f1bdcec79d
commit
cbd22b7141
@ -136,6 +136,9 @@ class Settings(QtCore.QSettings):
|
||||
**Note**, this method only converts a few types and might need to be
|
||||
extended if a certain type is missing!
|
||||
"""
|
||||
# Check for none as u'' is passed as default and is valid!
|
||||
if defaultValue is None and not super(Settings, self).contains(key):
|
||||
return None
|
||||
setting = super(Settings, self).value(key, defaultValue)
|
||||
# An empty list saved to the settings results in a None type being
|
||||
# returned.
|
||||
|
@ -1075,8 +1075,9 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
|
||||
export_settings.endGroup()
|
||||
# Write all the sections and keys.
|
||||
for section_key in keys:
|
||||
key_value = settings.value(section_key)
|
||||
export_settings.setValue(section_key, key_value)
|
||||
key_value = settings.value(section_key, None)
|
||||
if key_value is not None:
|
||||
export_settings.setValue(section_key, key_value)
|
||||
export_settings.sync()
|
||||
# Temp CONF file has been written. Blanks in keys are now '%20'.
|
||||
# Read the temp file and output the user's CONF file with blanks to
|
||||
|
@ -594,6 +594,7 @@ def strip_rtf(text, default_encoding=None):
|
||||
text = u''.join(out)
|
||||
return text, default_encoding
|
||||
|
||||
|
||||
def natcmp(a, b):
|
||||
"""
|
||||
Natural string comparison which mimics the behaviour of Python's internal
|
||||
@ -604,9 +605,9 @@ def natcmp(a, b):
|
||||
if isinstance(key, int) and isinstance(b[i], int):
|
||||
result = cmp(key, b[i])
|
||||
elif isinstance(key, int) and not isinstance(b[i], int):
|
||||
result = locale_direct_compare(QtCore.QString(str(key)), b[i])
|
||||
result = locale_direct_compare(str(key), b[i])
|
||||
elif not isinstance(key, int) and isinstance(b[i], int):
|
||||
result = locale_direct_compare(key, QtCore.QString(str(b[i])))
|
||||
result = locale_direct_compare(key, str(b[i]))
|
||||
else:
|
||||
result = locale_direct_compare(key, b[i])
|
||||
if result != 0:
|
||||
@ -620,9 +621,9 @@ def natcmp(a, b):
|
||||
if isinstance(a[i], int) and isinstance(key, int):
|
||||
result = cmp(a[i], key)
|
||||
elif isinstance(a[i], int) and not isinstance(key, int):
|
||||
result = locale_direct_compare(QtCore.QString(str(a[i])), key)
|
||||
result = locale_direct_compare(str(a[i]), key)
|
||||
elif not isinstance(a[i], int) and isinstance(key, int):
|
||||
result = locale_direct_compare(a[i], QtCore.QString(str(key)))
|
||||
result = locale_direct_compare(a[i], str(key))
|
||||
else:
|
||||
result = locale_direct_compare(a[i], key)
|
||||
if result != 0:
|
||||
|
Loading…
Reference in New Issue
Block a user