mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Harmonize QString vs unicode
This commit is contained in:
parent
1d8e98122c
commit
5d14ffaec5
@ -1,8 +1,8 @@
|
|||||||
__license__ = 'GPL v3'
|
__license__ = 'GPL v3'
|
||||||
__copyright__ = '2008, Kovid Goyal <kovid at kovidgoyal.net>'
|
__copyright__ = '2008, Kovid Goyal <kovid at kovidgoyal.net>'
|
||||||
|
|
||||||
from PyQt4.QtCore import SIGNAL, Qt
|
from PyQt4.QtCore import Qt, QString
|
||||||
from PyQt4.QtGui import QDialog, QListWidgetItem, QListWidget
|
from PyQt4.QtGui import QDialog, QListWidgetItem
|
||||||
|
|
||||||
from calibre.gui2.dialogs.tag_list_editor_ui import Ui_TagListEditor
|
from calibre.gui2.dialogs.tag_list_editor_ui import Ui_TagListEditor
|
||||||
from calibre.gui2 import question_dialog, error_dialog
|
from calibre.gui2 import question_dialog, error_dialog
|
||||||
@ -11,9 +11,9 @@ class ListWidgetItem(QListWidgetItem):
|
|||||||
|
|
||||||
def __init__(self, txt):
|
def __init__(self, txt):
|
||||||
QListWidgetItem.__init__(self, txt)
|
QListWidgetItem.__init__(self, txt)
|
||||||
self.initial_value = txt
|
self.initial_value = QString(txt)
|
||||||
self.current_value = txt
|
self.current_value = QString(txt)
|
||||||
self.previous_value = txt
|
self.previous_value = QString(txt)
|
||||||
|
|
||||||
def data(self, role):
|
def data(self, role):
|
||||||
if role == Qt.DisplayRole:
|
if role == Qt.DisplayRole:
|
||||||
@ -86,7 +86,7 @@ class TagListEditor(QDialog, Ui_TagListEditor):
|
|||||||
return
|
return
|
||||||
if item.text() != item.initial_text():
|
if item.text() != item.initial_text():
|
||||||
id_ = item.data(Qt.UserRole).toInt()[0]
|
id_ = item.data(Qt.UserRole).toInt()[0]
|
||||||
self.to_rename[id_] = item.text()
|
self.to_rename[id_] = unicode(item.text())
|
||||||
|
|
||||||
def rename_tag(self):
|
def rename_tag(self):
|
||||||
item = self.available_tags.currentItem()
|
item = self.available_tags.currentItem()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user