comparison contact_list.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
29 mainWidget->setLayout(layout); 29 mainWidget->setLayout(layout);
30 setWidget(mainWidget); 30 setWidget(mainWidget);
31 31
32 } 32 }
33 33
34 void ContactList::addContact(const ContactT& contact) 34 void ContactList::addContact(const Contact& contact)
35 { 35 {
36 const QString &txt = contact.getName().isEmpty() ? contact.jid.getString() : contact.getName(); 36 const QString & _jid = contact.getJid().getBareString();
37 m_contactMap.insert(_jid, contact);
38 const QString &txt = contact.getName().isEmpty() ? contact.getJid().getString() : contact.getName();
37 new QListWidgetItem(txt, listWidget); 39 new QListWidgetItem(txt, listWidget);
38 } 40 }
39 41
40 void ContactList::clear() 42 void ContactList::clear()
41 { 43 {
42 listWidget->clear(); 44 listWidget->clear();
45 m_contactMap.clear();
43 } 46 }