summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Smith <git@kismith.co.uk>2010-04-05 12:48:27 (GMT)
committerKevin Smith <git@kismith.co.uk>2010-04-05 12:48:27 (GMT)
commitc88b7c5da8dde6c4f7bdd85743378ec46f3a30fc (patch)
tree56b4923b1bd0e1a2264531d207cfca1f09318a57 /Swift/QtUI/Roster/QtTreeWidgetItem.cpp
parent559ab08f0a214f57cc84887eb65128519d1dc7f5 (diff)
downloadswift-c88b7c5da8dde6c4f7bdd85743378ec46f3a30fc.zip
swift-c88b7c5da8dde6c4f7bdd85743378ec46f3a30fc.tar.bz2
Merged roster status types for sorting in the same way as the status icons.
Resolves: #270
Diffstat (limited to 'Swift/QtUI/Roster/QtTreeWidgetItem.cpp')
-rw-r--r--Swift/QtUI/Roster/QtTreeWidgetItem.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/Swift/QtUI/Roster/QtTreeWidgetItem.cpp b/Swift/QtUI/Roster/QtTreeWidgetItem.cpp
index 5bd7d1e..c7d2ee6 100644
--- a/Swift/QtUI/Roster/QtTreeWidgetItem.cpp
+++ b/Swift/QtUI/Roster/QtTreeWidgetItem.cpp
@@ -34,12 +34,12 @@ void QtTreeWidgetItem::setStatusShow(StatusShow::Type show) {
statusShowType_ = show;
int color = 0;
switch (show) {
- case StatusShow::Online: color = 0x000000;break;
- case StatusShow::Away: color = 0x336699;break;
- case StatusShow::XA: color = 0x336699;break;
- case StatusShow::FFC: color = 0x000000;break;
- case StatusShow::DND: color = 0x990000;break;
- case StatusShow::None: color = 0x7F7F7F;break;
+ case StatusShow::Online: color = 0x000000; mergedShowType_ = StatusShow::Online; break;
+ case StatusShow::Away: color = 0x336699; mergedShowType_ = StatusShow::Away; break;
+ case StatusShow::XA: color = 0x336699; mergedShowType_ = StatusShow::Away; break;
+ case StatusShow::FFC: color = 0x000000; mergedShowType_ = StatusShow::Online; break;
+ case StatusShow::DND: color = 0x990000; mergedShowType_ = show; break;
+ case StatusShow::None: color = 0x7F7F7F; mergedShowType_ = show; break;
}
setTextColor(color);
emit changed(this);
@@ -220,7 +220,7 @@ bool QtTreeWidgetItem::operator<(const QtTreeWidgetItem& item) const {
if (!item.isContact()) {
return false;
}
- return getStatusShow() == item.getStatusShow() ? getLowerName() < item.getLowerName() : getStatusShow() < item.getStatusShow();
+ return getStatusShowMerged() == item.getStatusShowMerged() ? getLowerName() < item.getLowerName() : getStatusShowMerged() < item.getStatusShowMerged();
} else {
if (item.isContact()) {
return true;