comparison bellaciao.cpp @ 7:017925589d4c

Contact (formerly ContactT) now use shared data
author Goffi <goffi@goffi.org>
date Sun, 14 Aug 2011 18:03:54 +0200
parents 48045176d1c6
children
comparison
equal deleted inserted replaced
6:48045176d1c6 7:017925589d4c
72 } 72 }
73 } 73 }
74 74
75 void Bellaciao::fillContactList(const QString& profile) 75 void Bellaciao::fillContactList(const QString& profile)
76 { 76 {
77 const QList<ContactT>& contacts = m_bridge->getContacts(profile); 77 //We first get the whole contact list
78 const QList<Contact>& contacts = m_bridge->getContacts(profile);
78 79
79 for (int i=0; i<contacts.size(); i++) { 80 for (int i=0; i<contacts.size(); i++) {
80 ContactT contact = contacts[i]; 81 Contact contact(contacts[i]);
81 contact.setProfile(profile); 82 contact.setProfile(profile);
82 m_contactList->addContact(contact); 83 m_contactList->addContact(contact);
83 } 84 }
85
86 //Then add connected contacts
84 87
85 } 88 }
86 89
87 //slots 90 //slots
88 91
93 fillContactList(profile); 96 fillContactList(profile);
94 } 97 }
95 98
96 void Bellaciao::addContact(const QString &s_jid, StringDict attributes, const QStringList &groups, const QString &profile) 99 void Bellaciao::addContact(const QString &s_jid, StringDict attributes, const QStringList &groups, const QString &profile)
97 { 100 {
98 ContactT contact; 101 Contact contact;
99 contact.jid.fromString(s_jid); 102 contact.getJid().fromString(s_jid);
100 contact.setAttributes(attributes); 103 contact.setAttributes(attributes);
101 contact.groups = groups; 104 contact.getGroups() = groups;
102 contact.setProfile(profile); 105 contact.setProfile(profile);
103 m_contactList->addContact(contact); 106 m_contactList->addContact(contact);
104 } 107 }
105 108
106 void Bellaciao::quit() 109 void Bellaciao::quit()