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
|
**Note**, this method only converts a few types and might need to be
|
||||||
extended if a certain type is missing!
|
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)
|
setting = super(Settings, self).value(key, defaultValue)
|
||||||
# An empty list saved to the settings results in a None type being
|
# An empty list saved to the settings results in a None type being
|
||||||
# returned.
|
# returned.
|
||||||
|
@ -1075,7 +1075,8 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
|
|||||||
export_settings.endGroup()
|
export_settings.endGroup()
|
||||||
# Write all the sections and keys.
|
# Write all the sections and keys.
|
||||||
for section_key in keys:
|
for section_key in keys:
|
||||||
key_value = settings.value(section_key)
|
key_value = settings.value(section_key, None)
|
||||||
|
if key_value is not None:
|
||||||
export_settings.setValue(section_key, key_value)
|
export_settings.setValue(section_key, key_value)
|
||||||
export_settings.sync()
|
export_settings.sync()
|
||||||
# Temp CONF file has been written. Blanks in keys are now '%20'.
|
# Temp CONF file has been written. Blanks in keys are now '%20'.
|
||||||
|
@ -594,6 +594,7 @@ def strip_rtf(text, default_encoding=None):
|
|||||||
text = u''.join(out)
|
text = u''.join(out)
|
||||||
return text, default_encoding
|
return text, default_encoding
|
||||||
|
|
||||||
|
|
||||||
def natcmp(a, b):
|
def natcmp(a, b):
|
||||||
"""
|
"""
|
||||||
Natural string comparison which mimics the behaviour of Python's internal
|
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):
|
if isinstance(key, int) and isinstance(b[i], int):
|
||||||
result = cmp(key, b[i])
|
result = cmp(key, b[i])
|
||||||
elif isinstance(key, int) and not isinstance(b[i], int):
|
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):
|
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:
|
else:
|
||||||
result = locale_direct_compare(key, b[i])
|
result = locale_direct_compare(key, b[i])
|
||||||
if result != 0:
|
if result != 0:
|
||||||
@ -620,9 +621,9 @@ def natcmp(a, b):
|
|||||||
if isinstance(a[i], int) and isinstance(key, int):
|
if isinstance(a[i], int) and isinstance(key, int):
|
||||||
result = cmp(a[i], key)
|
result = cmp(a[i], key)
|
||||||
elif isinstance(a[i], int) and not isinstance(key, int):
|
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):
|
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:
|
else:
|
||||||
result = locale_direct_compare(a[i], key)
|
result = locale_direct_compare(a[i], key)
|
||||||
if result != 0:
|
if result != 0:
|
||||||
|
Loading…
Reference in New Issue
Block a user