Sort for added items in Images, Media and Presentations

Fixes: https://launchpad.net/bugs/827027
This commit is contained in:
Tim Bentley 2011-09-17 09:20:03 +01:00
parent 52c63d9665
commit 62979a0062
1 changed files with 7 additions and 4 deletions

View File

@ -376,18 +376,21 @@ 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
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)
fullList.append(file)
if fullList:
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,