MCPcopy Create free account
hub / github.com/Bitmessage/PyBitmessage / setData

Method setData

src/bitmessageqt/foldertree.py:446–464  ·  view source on GitHub ↗
(self, role, value)

Source from the content-addressed store, hash-verified

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)):

Callers

nothing calls this directly

Calls 6

BMConfigParserClass · 0.90
sqlExecuteFunction · 0.85
setMethod · 0.80
getMethod · 0.45
saveMethod · 0.45
setDataMethod · 0.45

Tested by

no test coverage detected