← Back to team overview

openlp-core team mailing list archive

[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)


Really fix service loading!
-- 
https://code.launchpad.net/~meths/openlp/trivialfixes/+merge/28872
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	2010-06-27 12:49:01 +0000
+++ openlp/core/ui/mainwindow.py	2010-06-30 12:01:30 +0000
@@ -845,7 +845,10 @@
         recentFileCount = QtCore.QSettings().value(
             self.generalSettingsSection + u'/max recent files',
             QtCore.QVariant(4)).toInt()[0]
-        if filename and filename not in self.recentFiles:
+        if filename:
+            position = self.recentFiles.indexOf(filename)
+            if position != -1:
+                self.recentFiles.removeAt(position)
             self.recentFiles.insert(0, QtCore.QString(filename))
             while self.recentFiles.count() > recentFileCount:
                 self.recentFiles.removeLast()

=== modified file 'openlp/core/ui/servicemanager.py'
--- openlp/core/ui/servicemanager.py	2010-06-29 16:07:45 +0000
+++ openlp/core/ui/servicemanager.py	2010-06-30 12:01:30 +0000
@@ -625,13 +625,13 @@
 
     def onLoadService(self, lastService=False):
         if lastService:
-            filename = SettingsManager.get_last_dir(
-                self.parent.serviceSettingsSection)
+            filename = self.parent.recentFiles[0]
         else:
             filename = QtGui.QFileDialog.getOpenFileName(
                 self, translate('ServiceManager', 'Open Service'),
                 SettingsManager.get_last_dir(
                 self.parent.serviceSettingsSection), u'Services (*.osz)')
+        filename = QtCore.QDir.toNativeSeparators(filename)
         self.loadService(filename)
 
     def loadService(self, filename=None):
@@ -662,7 +662,7 @@
         name = filename.split(os.path.sep)
         if filename:
             SettingsManager.set_last_dir(self.parent.serviceSettingsSection,
-                name[0])
+                os.path.split(filename)[0])
             zip = None
             file_to = None
             try:


Follow ups