From 62979a006285fc5142c97f30c6d1883a6c06b128 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Sat, 17 Sep 2011 09:20:03 +0100 Subject: [PATCH 1/3] Sort for added items in Images, Media and Presentations Fixes: https://launchpad.net/bugs/827027 --- openlp/core/lib/mediamanageritem.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/openlp/core/lib/mediamanageritem.py b/openlp/core/lib/mediamanageritem.py index 1c464f911..a824b178b 100644 --- a/openlp/core/lib/mediamanageritem.py +++ b/openlp/core/lib/mediamanageritem.py @@ -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, From 11424c8a7a42e4a18116d1b953de7cc630e1c7cd Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Sat, 17 Sep 2011 09:28:33 +0100 Subject: [PATCH 2/3] Only load list if changed --- openlp/core/lib/mediamanageritem.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/openlp/core/lib/mediamanageritem.py b/openlp/core/lib/mediamanageritem.py index a824b178b..5366f3f68 100644 --- a/openlp/core/lib/mediamanageritem.py +++ b/openlp/core/lib/mediamanageritem.py @@ -382,13 +382,15 @@ class MediaManagerItem(QtGui.QWidget): 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: + filesAdded = True fullList.append(file) - if fullList: + if fullList and filesAdded: self.listView.clear() self.loadList(fullList) lastDir = os.path.split(unicode(files[0]))[0] From d47189e9048e38d3f5b61861d2acff3e85a21a1b Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Sat, 17 Sep 2011 14:05:28 +0100 Subject: [PATCH 3/3] Remove unneeded timer logger . Was from old renderer --- openlp/core/__init__.py | 1 - 1 file changed, 1 deletion(-) diff --git a/openlp/core/__init__.py b/openlp/core/__init__.py index a5347edeb..3c8bdfe71 100644 --- a/openlp/core/__init__.py +++ b/openlp/core/__init__.py @@ -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()