~ubuntu-branches/ubuntu/utopic/psi/utopic

« back to all changes in this revision

Viewing changes to src/tools/contactlist/example/mycontactlist.h

  • Committer: Bazaar Package Importer
  • Author(s): Jan Niehusmann
  • Date: 2010-02-19 09:37:12 UTC
  • mfrom: (6.1.5 sid)
  • Revision ID: james.westby@ubuntu.com-20100219093712-e225xvm1wjcf1cgi
Tags: 0.14-2
* comment out only function which uses va_list to work around build
  problems on armel
* Set Standards-Version to 3.8.4

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#ifndef MYCONTACTLIST_H
2
 
#define MYCONTACTLIST_H
3
 
 
4
 
#include "contactlist.h"
5
 
#include "contactlistgroupitem.h"
6
 
#include "contactlistrootitem.h"
7
 
#include "status.h"
8
 
#include "mycontact.h"
9
 
#include "mygroup.h"
10
 
 
11
 
class ContactViewItem;
12
 
 
13
 
class MyContactList : public ContactList
14
 
{
15
 
public:
16
 
        MyContactList() : ContactList() { };
17
 
 
18
 
        void addContact(const QString& name, const QString& jid, const QString& pic, const Status& status, const QString& group = QString()) {
19
 
                ContactListGroupItem* groupItem = rootItem();
20
 
                if (!group.isEmpty()) {
21
 
                        MyGroup g(group);
22
 
                        groupItem = static_cast<MyGroup*>(rootItem()->findFirstItem(&g));;
23
 
                        if (!groupItem) {
24
 
                                groupItem = static_cast<MyGroup*>(invisibleGroup()->findFirstItem(&g));
25
 
                        }
26
 
 
27
 
                        if (!groupItem) {
28
 
                                groupItem = new MyGroup(group, rootItem());
29
 
                        }
30
 
                }
31
 
                new MyContact(name, jid, pic, status, groupItem);
32
 
        }
33
 
};
34
 
 
35
 
#endif