forked from openlp/openlp
More clean ups and fixes
This commit is contained in:
parent
5378399302
commit
56c36f355d
@ -82,6 +82,7 @@ class Settings(QtCore.QSettings):
|
||||
return setting.toStringList()
|
||||
if isinstance(defaultValue, QtCore.QPoint):
|
||||
return setting.toPoint()
|
||||
# TODO: add <datetime.date>
|
||||
print u'No!', type(defaultValue)
|
||||
return setting
|
||||
|
||||
|
@ -185,7 +185,7 @@ class SearchEdit(QtGui.QLineEdit):
|
||||
A :class:`~PyQt4.QtCore.QString` instance which represents the text
|
||||
in the line edit.
|
||||
"""
|
||||
self.clearButton.setVisible(not text.isEmpty())
|
||||
self.clearButton.setVisible(bool(text))
|
||||
|
||||
def _onClearButtonClicked(self):
|
||||
"""
|
||||
|
@ -98,7 +98,6 @@ class SettingsManager(object):
|
||||
"""
|
||||
settings = Settings()
|
||||
settings.beginGroup(section)
|
||||
#TODO: check if [0] is needed.
|
||||
old_count = settings.value(u'%s count' % name, 0)
|
||||
new_count = len(list)
|
||||
settings.setValue(u'%s count' % name, new_count)
|
||||
@ -127,8 +126,7 @@ class SettingsManager(object):
|
||||
list = []
|
||||
if list_count:
|
||||
for counter in range(list_count):
|
||||
# TODO: Check
|
||||
item = settings.value(u'%s %d' % (name, counter))
|
||||
item = settings.value(u'%s %d' % (name, counter), u'')
|
||||
if item:
|
||||
list.append(item)
|
||||
settings.endGroup()
|
||||
|
Loading…
Reference in New Issue
Block a user