forked from openlp/openlp
Fix lists to sort if new items are added for Images, Media and Presentations
bzr-revno: 1748 Fixes: https://launchpad.net/bugs/827027
This commit is contained in:
commit
f19db2e5dc
@ -236,7 +236,6 @@ def main(args=None):
|
||||
logfile.setFormatter(logging.Formatter(
|
||||
u'%(asctime)s %(name)-55s %(levelname)-8s %(message)s'))
|
||||
log.addHandler(logfile)
|
||||
logging.addLevelName(15, u'Timer')
|
||||
# Parse command line options and deal with them.
|
||||
# Use args supplied programatically if possible.
|
||||
(options, args) = parser.parse_args(args) if args else parser.parse_args()
|
||||
|
@ -376,18 +376,23 @@ class MediaManagerItem(QtGui.QWidget):
|
||||
The files to be loaded
|
||||
"""
|
||||
names = []
|
||||
fullList = []
|
||||
for count in range(0, self.listView.count()):
|
||||
names.append(unicode(self.listView.item(count).text()))
|
||||
newFiles = []
|
||||
fullList.append(unicode(self.listView.item(count).
|
||||
data(QtCore.Qt.UserRole).toString()))
|
||||
duplicatesFound = False
|
||||
filesAdded = False
|
||||
for file in files:
|
||||
filename = os.path.split(unicode(file))[1]
|
||||
if filename in names:
|
||||
duplicatesFound = True
|
||||
else:
|
||||
newFiles.append(file)
|
||||
if newFiles:
|
||||
self.loadList(newFiles)
|
||||
filesAdded = True
|
||||
fullList.append(file)
|
||||
if fullList and filesAdded:
|
||||
self.listView.clear()
|
||||
self.loadList(fullList)
|
||||
lastDir = os.path.split(unicode(files[0]))[0]
|
||||
SettingsManager.set_last_dir(self.settingsSection, lastDir)
|
||||
SettingsManager.set_list(self.settingsSection,
|
||||
|
Loading…
Reference in New Issue
Block a user