Completer unicode fixes
This commit is contained in:
parent
46edb72b4f
commit
58481afda2
|
@ -1895,13 +1895,13 @@ class MyForm(settingsmixin.SMainWindow):
|
|||
completerList = []
|
||||
for address in sorted(oldRows, key = lambda x: oldRows[x][2], reverse = True):
|
||||
if address in newRows:
|
||||
completerList.append(newRows[address][0] + " <" + address + ">")
|
||||
completerList.append(unicode(newRows[address][0], encoding="UTF-8") + " <" + address + ">")
|
||||
newRows.pop(address)
|
||||
else:
|
||||
self.ui.tableWidgetAddressBook.removeRow(oldRows[address][2])
|
||||
for address in newRows:
|
||||
addRow(address, newRows[address][0], newRows[address][1])
|
||||
completerList.append(newRows[address][0] + " <" + address + ">")
|
||||
completerList.append(unicode(newRows[address][0], encoding="UTF-8") + " <" + address + ">")
|
||||
|
||||
# sort
|
||||
self.ui.tableWidgetAddressBook.sortByColumn(0, Qt.AscendingOrder)
|
||||
|
@ -3187,8 +3187,8 @@ class MyForm(settingsmixin.SMainWindow):
|
|||
if self.ui.lineEditTo.text() == '':
|
||||
self.ui.lineEditTo.setText(stringToAdd)
|
||||
else:
|
||||
self.ui.lineEditTo.setText(str(
|
||||
self.ui.lineEditTo.text()) + '; ' + stringToAdd)
|
||||
self.ui.lineEditTo.setText(unicode(
|
||||
self.ui.lineEditTo.text().toUtf8(), encoding="UTF-8") + '; ' + stringToAdd)
|
||||
if listOfSelectedRows == {}:
|
||||
self.statusBar().showMessage(_translate(
|
||||
"MainWindow", "No addresses selected."))
|
||||
|
|
|
@ -491,7 +491,7 @@ class AddressBookCompleter(QtGui.QCompleter):
|
|||
|
||||
def splitPath(self, path):
|
||||
stringList = []
|
||||
text = unicode(path.toUtf8())
|
||||
text = unicode(path.toUtf8(), encoding="UTF-8")
|
||||
splitIndex = rfind(text[0:self.widget().cursorPosition()], ";") + 1
|
||||
str = text[splitIndex:self.widget().cursorPosition()]
|
||||
str = rstrip(lstrip(str))
|
||||
|
@ -499,8 +499,8 @@ class AddressBookCompleter(QtGui.QCompleter):
|
|||
return stringList
|
||||
|
||||
def pathFromIndex(self, index):
|
||||
autoString = unicode(index.data(QtCore.Qt.EditRole).toString())
|
||||
text = unicode(self.widget().text().toUtf8())
|
||||
autoString = unicode(index.data(QtCore.Qt.EditRole).toString().toUtf8(), encoding="UTF-8")
|
||||
text = unicode(self.widget().text().toUtf8(), encoding="UTF-8")
|
||||
|
||||
# If cursor position was saved, restore it, else save it
|
||||
if self.cursorPos != -1:
|
||||
|
|
Loading…
Reference in New Issue
Block a user