Commit c45575a3 authored by Dan Pascu's avatar Dan Pascu

Added pickling capabilities to Contact and ContactGroup

parent b582cfc8
......@@ -26,6 +26,9 @@ class ContactGroup(object):
cls.instances[name] = obj
return obj
def __reduce__(self):
return (self.__class__, (self.name,), None)
def __repr__(self):
return "%s(%r)" % (self.__class__.__name__, self.name)
......@@ -87,6 +90,9 @@ class Contact(object):
def __str__(self):
return '%s <%s>' % (self.name, self.uri) if self.name else self.uri
def __reduce__(self):
return (self.__class__, (self.group, self.name, self.uri, self.image), None)
class ContactDelegate(QStyledItemDelegate):
item_size_hints = {Contact: QSize(200, 36), ContactGroup: QSize(200, 18)}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment