From 5804dade748154574e775035ca6a5483983f84e5 Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Sun, 4 Dec 2011 14:42:39 +0000 Subject: [PATCH] Reduce recent file list duplication (Bug #892668) --- openlp/core/ui/mainwindow.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index 9d546629b..b0640513a 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -1312,7 +1312,6 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow): settings.value(u'preview splitter geometry').toByteArray()) self.controlSplitter.restoreState( settings.value(u'mainwindow splitter geometry').toByteArray()) - settings.endGroup() def saveSettings(self): @@ -1388,6 +1387,12 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow): maxRecentFiles = QtCore.QSettings().value(u'advanced/max recent files', QtCore.QVariant(20)).toInt()[0] if filename: + # Add some cleanup to reduce duplication in the recent file list + filename = os.path.abspath(filename) + # abspath() only capitalises the drive letter if it wasn't provided + # in the given filename which then causes duplication. + if filename[1:3] == ':\\': + filename = filename[0].upper() + filename[1:] position = self.recentFiles.indexOf(filename) if position != -1: self.recentFiles.removeAt(position)