(self, role, value)
| 444 | return super(Ui_AddressBookWidgetItem, self).data(role) |
| 445 | |
| 446 | def setData(self, role, value): |
| 447 | if role == QtCore.Qt.EditRole: |
| 448 | if isinstance(value, QtCore.QVariant): |
| 449 | self.label = str(value.toString().toUtf8()) |
| 450 | else: |
| 451 | self.label = str(value) |
| 452 | if self.type in (AccountMixin.NORMAL, AccountMixin.MAILINGLIST, AccountMixin.CHAN): |
| 453 | try: |
| 454 | a = BMConfigParser().get(self.address, 'label') |
| 455 | BMConfigParser().set(self.address, 'label', self.label) |
| 456 | BMConfigParser().save() |
| 457 | except: |
| 458 | sqlExecute('''UPDATE addressbook set label=? WHERE address=?''', self.label, self.address) |
| 459 | elif self.type == AccountMixin.SUBSCRIPTION: |
| 460 | from debug import logger |
| 461 | sqlExecute('''UPDATE subscriptions set label=? WHERE address=?''', self.label, self.address) |
| 462 | else: |
| 463 | pass |
| 464 | return super(Ui_AddressBookWidgetItem, self).setData(role, value) |
| 465 | |
| 466 | def __lt__ (self, other): |
| 467 | if (isinstance(other, Ui_AddressBookWidgetItem)): |
nothing calls this directly
no test coverage detected