From bf24620e5f3cf630c9e3cdb8070886f256ce248d Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 21 Jun 2014 09:23:10 +0530 Subject: [PATCH] ... --- src/calibre/gui2/actions/embed.py | 2 +- src/calibre/gui2/tweak_book/preferences.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/calibre/gui2/actions/embed.py b/src/calibre/gui2/actions/embed.py index b7c00b18ac..f564875afa 100644 --- a/src/calibre/gui2/actions/embed.py +++ b/src/calibre/gui2/actions/embed.py @@ -8,7 +8,7 @@ __copyright__ = '2014, Kovid Goyal ' from functools import partial -from PyQt4.Qt import QTimer, QProgressDialog, Qt +from PyQt5.Qt import QTimer, QProgressDialog, Qt from calibre import force_unicode from calibre.gui2 import warning_dialog diff --git a/src/calibre/gui2/tweak_book/preferences.py b/src/calibre/gui2/tweak_book/preferences.py index 9b0637c564..d43575b3c8 100644 --- a/src/calibre/gui2/tweak_book/preferences.py +++ b/src/calibre/gui2/tweak_book/preferences.py @@ -396,13 +396,13 @@ class ToolbarSettings(QWidget): prefs = prefs or tprefs val = self.original_settings = {} for i in xrange(1, self.bars.count()): - name = unicode(self.bars.itemData(i).toString()) + name = unicode(self.bars.itemData(i) or '') val[name] = copy(prefs[name]) self.current_settings = deepcopy(val) @property def current_name(self): - return unicode(self.bars.itemData(self.bars.currentIndex()).toString()) + return unicode(self.bars.itemData(self.bars.currentIndex()) or '') def build_lists(self): from calibre.gui2.tweak_book.plugin import plugin_toolbar_actions @@ -482,7 +482,7 @@ class ToolbarSettings(QWidget): s = self.current_settings[self.current_name] except KeyError: return - names = [unicode(i.data(Qt.UserRole).toString()) for i in self.available.selectedItems()] + names = [unicode(i.data(Qt.UserRole) or '') for i in self.available.selectedItems()] if not names: return for n in names: