summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swift/QtUI/Roster/QtTreeWidgetItem.cpp')
-rw-r--r--Swift/QtUI/Roster/QtTreeWidgetItem.cpp18
1 files changed, 14 insertions, 4 deletions
diff --git a/Swift/QtUI/Roster/QtTreeWidgetItem.cpp b/Swift/QtUI/Roster/QtTreeWidgetItem.cpp
index 2c05053..e70983f 100644
--- a/Swift/QtUI/Roster/QtTreeWidgetItem.cpp
+++ b/Swift/QtUI/Roster/QtTreeWidgetItem.cpp
@@ -11,6 +11,11 @@ QtTreeWidgetItem::QtTreeWidgetItem(QtTreeWidgetItem* parentItem) : QObject() {
void QtTreeWidgetItem::setText(const String& text) {
displayName_ = P2QSTRING(text);
+ statusText_ = displayName_ + " went away";
+}
+
+void QtTreeWidgetItem::setStatusText(const String& text) {
+ statusText_ = P2QSTRING(text);
}
void QtTreeWidgetItem::setTextColor(unsigned long color) {
@@ -86,10 +91,15 @@ QtTreeWidgetItem* QtTreeWidgetItem::getItem(int row) {
}
QVariant QtTreeWidgetItem::data(int role) {
- if (role != Qt::DisplayRole) {
- return QVariant();
+ switch (role) {
+ case Qt::DisplayRole: return displayName_;
+ case StatusTextRole: return statusText_;
+ default: return QVariant();
}
- qDebug() << "Returning name " << displayName_ << " for role " << role;
- return displayName_;
}
+
+bool QtTreeWidgetItem::isContact() {
+ return children_.size() == 0;
+}
+
} \ No newline at end of file