diff --git a/openlp/core/ui/exceptionform.py b/openlp/core/ui/exceptionform.py index d2469c092..0dde063c4 100644 --- a/openlp/core/ui/exceptionform.py +++ b/openlp/core/ui/exceptionform.py @@ -150,7 +150,7 @@ class ExceptionForm(QtGui.QDialog, Ui_ExceptionDialog): translate('OpenLP.ExceptionForm', 'Text files (*.txt *.log *.text)')) if filename: - filename = unicode(QtCore.QDir.toNativeSeparators(filename)) + filename = unicode(filename).replace(u'/', os.path.sep) SettingsManager.set_last_dir(self.settingsSection, os.path.dirname( filename)) report_text = report_text % self._createReport() diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index 947c1318d..6b3cf81fb 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -1378,14 +1378,14 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow): recentFileCount = QtCore.QSettings().value( u'advanced/recent file count', QtCore.QVariant(4)).toInt()[0] existingRecentFiles = [recentFile for recentFile in self.recentFiles - if QtCore.QFile.exists(recentFile)] + if os.path.isfile(unicode(recentFile))] recentFilesToDisplay = existingRecentFiles[0:recentFileCount] self.recentFilesMenu.clear() for fileId, filename in enumerate(recentFilesToDisplay): log.debug('Recent file name: %s', filename) action = base_action(self, u'') - action.setText(u'&%d %s' % - (fileId + 1, QtCore.QFileInfo(filename).fileName())) + action.setText(u'&%d %s' % (fileId + 1, + os.path.splitext(os.path.basename(unicode(filename)))[0])) action.setData(QtCore.QVariant(filename)) self.connect(action, QtCore.SIGNAL(u'triggered()'), self.serviceManagerContents.onRecentServiceClicked) diff --git a/openlp/core/ui/servicemanager.py b/openlp/core/ui/servicemanager.py index 2217dc168..84083af13 100644 --- a/openlp/core/ui/servicemanager.py +++ b/openlp/core/ui/servicemanager.py @@ -683,7 +683,7 @@ class ServiceManager(QtGui.QWidget): 'File is not a valid service.\n' 'The content encoding is not UTF-8.')) continue - osfile = unicode(QtCore.QDir.toNativeSeparators(ucsfile)) + osfile = ucsfile.replace(u'/', os.path.sep) if not osfile.startswith(u'audio'): osfile = os.path.split(osfile)[1] log.debug(u'Extract file: %s', osfile) diff --git a/openlp/core/ui/thememanager.py b/openlp/core/ui/thememanager.py index 3585e5c97..8b2524845 100644 --- a/openlp/core/ui/thememanager.py +++ b/openlp/core/ui/thememanager.py @@ -544,7 +544,7 @@ class ThemeManager(QtGui.QWidget): log.exception(u'Theme file contains non utf-8 filename' u' "%s"' % name.decode(u'utf-8', u'replace')) raise Exception(u'validation') - uname = unicode(QtCore.QDir.toNativeSeparators(uname)) + uname = uname.replace(u'/', os.path.sep) splitname = uname.split(os.path.sep) if splitname[-1] == u'' or len(splitname) == 1: # is directory or preview file