Samuel Mehrbrodt has proposed merging lp:~sam92/openlp/fix-import-non-ascii-path into lp:openlp/2.0.
Requested reviews: Andreas Preikschat (googol) For more details, see: https://code.launchpad.net/~sam92/openlp/fix-import-non-ascii-path/+merge/140779 Now using map() I also removed some unnecessary unicode() calls. -- https://code.launchpad.net/~sam92/openlp/fix-import-non-ascii-path/+merge/140779 Your team OpenLP Core is subscribed to branch lp:openlp/2.0.
=== modified file 'openlp/core/lib/mediamanageritem.py' --- openlp/core/lib/mediamanageritem.py 2012-11-11 21:16:14 +0000 +++ openlp/core/lib/mediamanageritem.py 2012-12-19 22:10:26 +0000 @@ -341,7 +341,9 @@ self, self.onNewPrompt, SettingsManager.get_last_dir(self.settingsSection), self.onNewFileMasks) - log.info(u'New files(s) %s', unicode(files)) + # Convert QStringList containing QStrings to a Python list containing unicode strings + files = map(unicode, files) + log.info(u'New files(s) %s', files) if files: Receiver.send_message(u'cursor_busy') self.validateAndLoad(files) === modified file 'openlp/plugins/images/lib/mediaitem.py' --- openlp/plugins/images/lib/mediaitem.py 2012-11-11 21:16:14 +0000 +++ openlp/plugins/images/lib/mediaitem.py 2012-12-19 22:10:26 +0000 @@ -130,17 +130,17 @@ # Sort the images by its filename considering language specific # characters. images.sort(cmp=locale_compare, - key=lambda filename: os.path.split(unicode(filename))[1]) + key=lambda filename: os.path.split(filename)[1]) for imageFile in images: - filename = os.path.split(unicode(imageFile))[1] + filename = os.path.split(imageFile)[1] thumb = os.path.join(self.servicePath, filename) - if not os.path.exists(unicode(imageFile)): + if not os.path.exists(imageFile): icon = build_icon(u':/general/general_delete.png') else: - if validate_thumb(unicode(imageFile), thumb): + if validate_thumb(imageFile, thumb): icon = build_icon(thumb) else: - icon = create_thumb(unicode(imageFile), thumb) + icon = create_thumb(imageFile, thumb) item_name = QtGui.QListWidgetItem(filename) item_name.setIcon(icon) item_name.setToolTip(imageFile) === modified file 'openlp/plugins/media/lib/mediaitem.py' --- openlp/plugins/media/lib/mediaitem.py 2012-11-11 21:16:14 +0000 +++ openlp/plugins/media/lib/mediaitem.py 2012-12-19 22:10:26 +0000 @@ -299,21 +299,21 @@ # Sort the media by its filename considering language specific # characters. media.sort(cmp=locale_compare, - key=lambda filename: os.path.split(unicode(filename))[1]) + key=lambda filename: os.path.split(filename)[1]) for track in media: track_info = QtCore.QFileInfo(track) if not os.path.exists(track): - filename = os.path.split(unicode(track))[1] + filename = os.path.split(track)[1] item_name = QtGui.QListWidgetItem(filename) item_name.setIcon(build_icon(ERROR)) item_name.setData(QtCore.Qt.UserRole, QtCore.QVariant(track)) elif track_info.isFile(): - filename = os.path.split(unicode(track))[1] + filename = os.path.split(track)[1] item_name = QtGui.QListWidgetItem(filename) item_name.setIcon(build_icon(VIDEO)) item_name.setData(QtCore.Qt.UserRole, QtCore.QVariant(track)) else: - filename = os.path.split(unicode(track))[1] + filename = os.path.split(track)[1] item_name = QtGui.QListWidgetItem(filename) #TODO: add the appropriate Icon #item_name.setIcon(build_icon(DVD_ICON)) === modified file 'openlp/plugins/presentations/lib/mediaitem.py' --- openlp/plugins/presentations/lib/mediaitem.py 2012-11-11 21:16:14 +0000 +++ openlp/plugins/presentations/lib/mediaitem.py 2012-12-19 22:10:26 +0000 @@ -175,13 +175,13 @@ # Sort the presentations by its filename considering language specific # characters. files.sort(cmp=locale_compare, - key=lambda filename: os.path.split(unicode(filename))[1]) + key=lambda filename: os.path.split(filename)[1]) for file in files: if not initialLoad: self.plugin.formParent.incrementProgressBar() if currlist.count(file) > 0: continue - filename = os.path.split(unicode(file))[1] + filename = os.path.split(file)[1] if not os.path.exists(file): item_name = QtGui.QListWidgetItem(filename) item_name.setIcon(build_icon(ERROR)) @@ -201,7 +201,7 @@ controller_name = self.findControllerByType(filename) if controller_name: controller = self.controllers[controller_name] - doc = controller.add_document(unicode(file)) + doc = controller.add_document(file) thumb = os.path.join(doc.get_thumbnail_folder(), u'icon.png') preview = doc.get_thumbnail_path(1, True)
_______________________________________________ Mailing list: https://launchpad.net/~openlp-core Post to : openlp-core@lists.launchpad.net Unsubscribe : https://launchpad.net/~openlp-core More help : https://help.launchpad.net/ListHelp