diff options
author | Kevin Smith <git@kismith.co.uk> | 2010-05-26 16:29:44 (GMT) |
---|---|---|
committer | Kevin Smith <git@kismith.co.uk> | 2010-05-26 17:24:07 (GMT) |
commit | e497af7cd28d2cf58d81ed8fd351b5d5ccfa56a4 (patch) | |
tree | e2fbb5b2c5f4b5fe3aa884bf551379ac2c6478c8 /Swiften/Roster/GroupRosterItem.cpp | |
parent | c77cbf3d4cdcfce47639006f023715483f6f0dc1 (diff) | |
download | swift-contrib-e497af7cd28d2cf58d81ed8fd351b5d5ccfa56a4.zip swift-contrib-e497af7cd28d2cf58d81ed8fd351b5d5ccfa56a4.tar.bz2 |
Don't let roster groups open and close on their own.
Resolves: #368
Diffstat (limited to 'Swiften/Roster/GroupRosterItem.cpp')
-rw-r--r-- | Swiften/Roster/GroupRosterItem.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/Swiften/Roster/GroupRosterItem.cpp b/Swiften/Roster/GroupRosterItem.cpp index 7ce57d2..e5490e2 100644 --- a/Swiften/Roster/GroupRosterItem.cpp +++ b/Swiften/Roster/GroupRosterItem.cpp @@ -24,6 +24,12 @@ bool GroupRosterItem::isExpanded() const { return expanded_; } +/** + This has no effect, and is only used by the UI. + If reTransmit is specified, dataChanged will be emitted on a change - + This may be undesireable if called from the UI, so you can use reTransmit=false + to avoid a loop in this case. + */ void GroupRosterItem::setExpanded(bool expanded) { expanded_ = expanded; } @@ -33,7 +39,6 @@ const std::vector<RosterItem*>& GroupRosterItem::getChildren() const { } const std::vector<RosterItem*>& GroupRosterItem::getDisplayedChildren() const { -// std::cout << "Fetching displayed children for " << getDisplayName() << " and found " << displayedChildren_.size() << std::endl; return displayedChildren_; } @@ -110,7 +115,6 @@ bool GroupRosterItem::itemLessThan(const RosterItem* left, const RosterItem* rig if (rightContact) { return true; } -// std::cout << "Comparing groups " << left->getSortableDisplayName() << " and " << right->getSortableDisplayName() << std::endl; return left->getSortableDisplayName() < right->getSortableDisplayName(); } } @@ -131,8 +135,8 @@ void GroupRosterItem::setDisplayed(RosterItem* item, bool displayed) { } else { displayedChildren_.erase(std::remove(displayedChildren_.begin(), displayedChildren_.end(), item), displayedChildren_.end()); } - onDataChanged(); onChildrenChanged(); + onDataChanged(); } void GroupRosterItem::handleDataChanged(RosterItem* /*item*/) { @@ -158,8 +162,8 @@ void GroupRosterItem::handleChildrenChanged(GroupRosterItem* group) { displayedChildren_.erase(std::remove(displayedChildren_.begin(), displayedChildren_.end(), group), displayedChildren_.end()); } if (oldSize != getDisplayedChildren().size()) { - onDataChanged(); onChildrenChanged(); + onDataChanged(); } } |