summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Smith <git@kismith.co.uk>2010-04-18 17:09:52 (GMT)
committerKevin Smith <git@kismith.co.uk>2010-04-18 17:09:52 (GMT)
commitb63315fa2b1a6f571dc0fa09a9d5ec0c6392372f (patch)
tree3186df91cb084324eafd46bbc69c9eacfe7961f4 /Swift/QtUI/Roster
parent42cda67cb8a90c6245df6d2594ae408f5238be34 (diff)
downloadswift-contrib-b63315fa2b1a6f571dc0fa09a9d5ec0c6392372f.zip
swift-contrib-b63315fa2b1a6f571dc0fa09a9d5ec0c6392372f.tar.bz2
Make the roster demo compile again
Diffstat (limited to 'Swift/QtUI/Roster')
-rw-r--r--Swift/QtUI/Roster/Roster.pri8
-rw-r--r--Swift/QtUI/Roster/main.cpp18
2 files changed, 23 insertions, 3 deletions
diff --git a/Swift/QtUI/Roster/Roster.pri b/Swift/QtUI/Roster/Roster.pri
index bc14889..c9e7b2d 100644
--- a/Swift/QtUI/Roster/Roster.pri
+++ b/Swift/QtUI/Roster/Roster.pri
@@ -2,11 +2,15 @@ SOURCES += $$PWD/RosterDelegate.cpp \
# $$PWD/RosterItem.cpp \
$$PWD/RosterModel.cpp \
$$PWD/QtTreeWidget.cpp \
- $$PWD/QtTreeWidgetItem.cpp
+ $$PWD/QtTreeWidgetItem.cpp \
+ $$PWD/DelegateCommons.cpp \
+ $$PWD/GroupItemDelegate.cpp
HEADERS += $$PWD/RosterDelegate.h \
# $$PWD/RosterItem.h \
$$PWD/RosterModel.h \
$$PWD/QtTreeWidget.h \
$$PWD/QtTreeWidgetFactory.h \
- $$PWD/QtTreeWidgetItem.h
+ $$PWD/QtTreeWidgetItem.h \
+ $$PWD/DelegateCommons.h \
+ $$PWD/GroupItemDelegate.h
diff --git a/Swift/QtUI/Roster/main.cpp b/Swift/QtUI/Roster/main.cpp
index 5d899d5..7f5e3d1 100644
--- a/Swift/QtUI/Roster/main.cpp
+++ b/Swift/QtUI/Roster/main.cpp
@@ -8,6 +8,8 @@
#include "QtTreeWidget.h"
#include "QtTreeWidgetFactory.h"
+#include "Swiften/Elements/StatusShow.h"
+
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
@@ -22,6 +24,7 @@ int main(int argc, char *argv[])
Swift::QtTreeWidgetFactory treeWidgetFactory;
Swift::QtTreeWidget* tree = dynamic_cast<Swift::QtTreeWidget*>(treeWidgetFactory.createTreeWidget());
tree->show();
+ QList<Swift::QtTreeWidgetItem*> item3s;
for (int i = 0; i < 500; i++) {
Swift::QtTreeWidgetItem* group = dynamic_cast<Swift::QtTreeWidgetItem*>(treeWidgetFactory.createTreeWidgetItem(tree));
group->setText("People");
@@ -35,16 +38,29 @@ int main(int argc, char *argv[])
item3->setText("Cath");
item4->setText("KimTypo");
item4->setText("Kim");
+ item3s.push_back(item3);
}
Swift::QtTreeWidgetItem* group = dynamic_cast<Swift::QtTreeWidgetItem*>(treeWidgetFactory.createTreeWidgetItem(tree));
group->setText("Many People");
+ Swift::QtTreeWidgetItem* person350;
+ Swift::QtTreeWidgetItem* person1200;
+
for (int i = 0; i < 1500; i++) {
Swift::QtTreeWidgetItem* item = dynamic_cast<Swift::QtTreeWidgetItem*>(treeWidgetFactory.createTreeWidgetItem(group));
item->setText(Q2PSTRING(QString("Some person %1").arg(i)));
-
+ item->setStatusShow(Swift::StatusShow::Away);
+ if (i == 350) person350 = item;
+ if (i == 1200) person1200 = item;
}
+ for (int i = 0; i < item3s.size(); i++) {
+ item3s[i]->setStatusShow(Swift::StatusShow::XA);
+ }
+
+ person350->setStatusShow(Swift::StatusShow::DND);
+ person1200->setStatusShow(Swift::StatusShow::Online);
+
return app.exec();
}