comparison contact_list.cpp @ 4:220e5619bf87

Profiles selection now fill contact list + new Jid class
author Goffi <goffi@goffi.org>
date Thu, 11 Aug 2011 00:02:25 +0200
parents 22b44846b04b
children 48045176d1c6
comparison
equal deleted inserted replaced
3:2195295a2058 4:220e5619bf87
1 /* 1 /*
2 Mignonne: a Salut à Toi frontend 2 Bellaciao: a Salut à Toi frontend
3 Copyright (C) 2011 Jérôme Poisson (goffi@goffi.org) 3 Copyright (C) 2011 Jérôme Poisson (goffi@goffi.org)
4 4
5 This program is free software: you can redistribute it and/or modify 5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU Affero General Public License as published by 6 it under the terms of the GNU Affero General Public License as published by
7 the Free Software Foundation, either version 3 of the License, or 7 the Free Software Foundation, either version 3 of the License, or
16 along with this program. If not, see <http://www.gnu.org/licenses/>. 16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */ 17 */
18 18
19 #include "contact_list.h" 19 #include "contact_list.h"
20 20
21
22 ContactList::ContactList(QWidget * parent): 21 ContactList::ContactList(QWidget * parent):
23 QDockWidget(tr("Contacts"), parent) 22 QDockWidget(tr("Contacts"), parent)
24 23
25 { 24 {
26 mainWidget = new QWidget(); 25 mainWidget = new QWidget();
30 mainWidget->setLayout(layout); 29 mainWidget->setLayout(layout);
31 setWidget(mainWidget); 30 setWidget(mainWidget);
32 31
33 } 32 }
34 33
35 void ContactList::addContact(const QString& jid) 34 void ContactList::addContact(const Jid& jid)
36 { 35 {
37 new QListWidgetItem(jid, listWidget); 36 new QListWidgetItem(jid.getString(), listWidget);
38 } 37 }
38
39 void ContactList::clear()
40 {
41 listWidget->clear();
42 }