diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index 4dc75ea92..75519da8a 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -33,7 +33,8 @@ from openlp.core.ui import AboutForm, SettingsForm, ServiceManager, \ ThemeManager, SlideController, PluginForm, MediaDockManager, DisplayManager from openlp.core.lib import RenderManager, build_icon, OpenLPDockWidget, \ SettingsManager, PluginManager, Receiver, translate -from openlp.core.utils import check_latest_version, AppLocation, add_actions, LanguageManager +from openlp.core.utils import check_latest_version, AppLocation, add_actions, \ + LanguageManager log = logging.getLogger(__name__) @@ -61,7 +62,8 @@ class VersionThread(QtCore.QThread): QtCore.QThread.__init__(self, parent) self.parent = parent self.app_version = app_version - self.version_splitter = re.compile(r'([0-9]+).([0-9]+).([0-9]+)(?:-bzr([0-9]+))') + self.version_splitter = re.compile( + r'([0-9]+).([0-9]+).([0-9]+)(?:-bzr([0-9]+))') def run(self): """ @@ -842,7 +844,8 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow): recentFileCount = QtCore.QSettings().value( self.generalSettingsSection + u'/max recent files', QtCore.QVariant(4)).toInt()[0] - if filename and not self.recentFiles.contains(filename): - self.recentFiles.prepend(QtCore.QString(filename)) + if filename and filename not in self.recentFiles: + self.recentFiles.insert(0, QtCore.QString(filename)) while self.recentFiles.count() > recentFileCount: - self.recentFiles.takeLast() + self.recentFiles.pop() +