openlp-core team mailing list archive
-
openlp-core team
-
Mailing list archive
-
Message #13090
[Merge] lp:~meths/openlp/trivialfixes into lp:openlp
Jon Tibble has proposed merging lp:~meths/openlp/trivialfixes into lp:openlp.
Requested reviews:
OpenLP Core (openlp-core)
For more details, see:
https://code.launchpad.net/~meths/openlp/trivialfixes/+merge/84397
Reduce the risk of duplicates in the recent files list by always using the absolute path to the file (Bug #892668). Not sure if this eliminates the risk or if someone will find a more creative way to make duplicates but it seems to work okay for me.
Could non-Windows users check it doesn't break anything please.
--
https://code.launchpad.net/~meths/openlp/trivialfixes/+merge/84397
Your team OpenLP Core is requested to review the proposed merge of lp:~meths/openlp/trivialfixes into lp:openlp.
=== modified file 'openlp/core/ui/mainwindow.py'
--- openlp/core/ui/mainwindow.py 2011-12-02 20:17:57 +0000
+++ openlp/core/ui/mainwindow.py 2011-12-04 14:48:28 +0000
@@ -1312,7 +1312,6 @@
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 @@
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)
Follow ups