diff options
author | Kevin Smith <git@kismith.co.uk> | 2011-04-23 16:59:17 (GMT) |
---|---|---|
committer | Kevin Smith <git@kismith.co.uk> | 2011-04-23 16:59:17 (GMT) |
commit | e3041b220e4846fb2f0273c720d8bcbd78cafaaf (patch) | |
tree | c6cfbd8d61417143689f7999d69e189026f3ab54 /Swift/Controllers/Roster/GroupRosterItem.cpp | |
parent | b6246efcf15f03bb5b44bc79190bc9f4c7be9506 (diff) | |
download | swift-contrib-e3041b220e4846fb2f0273c720d8bcbd78cafaaf.zip swift-contrib-e3041b220e4846fb2f0273c720d8bcbd78cafaaf.tar.bz2 |
Sort MUC roles by role, rather than by name.
Resolves: #794
Release-Notes: Non-English translations will no longer have MUC role groups in the incorrect order.
Diffstat (limited to 'Swift/Controllers/Roster/GroupRosterItem.cpp')
-rw-r--r-- | Swift/Controllers/Roster/GroupRosterItem.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/Swift/Controllers/Roster/GroupRosterItem.cpp b/Swift/Controllers/Roster/GroupRosterItem.cpp index f0a377a..b8fad07 100644 --- a/Swift/Controllers/Roster/GroupRosterItem.cpp +++ b/Swift/Controllers/Roster/GroupRosterItem.cpp @@ -12,7 +12,7 @@ namespace Swift { -GroupRosterItem::GroupRosterItem(const std::string& name, GroupRosterItem* parent, bool sortByStatus) : RosterItem(name, parent), sortByStatus_(sortByStatus) { +GroupRosterItem::GroupRosterItem(const std::string& name, GroupRosterItem* parent, bool sortByStatus) : RosterItem(name, parent), sortByStatus_(sortByStatus), manualSort_(false) { expanded_ = true; } @@ -20,6 +20,19 @@ GroupRosterItem::~GroupRosterItem() { } +void GroupRosterItem::setManualSort(const std::string& manualSortValue) { + manualSort_ = true; + bool changed = manualSortValue_ != manualSortValue; + manualSortValue_ = manualSortValue; + if (changed) { + onDataChanged(); + } +} + +const std::string& GroupRosterItem::getSortableDisplayName() const { + return manualSort_ ? manualSortValue_ : RosterItem::getSortableDisplayName(); +} + bool GroupRosterItem::isExpanded() const { return expanded_; } |