summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/Roster')
-rw-r--r--Swiften/Roster/GroupRosterItem.cpp10
-rw-r--r--Swiften/Roster/GroupRosterItem.h3
2 files changed, 12 insertions, 1 deletions
diff --git a/Swiften/Roster/GroupRosterItem.cpp b/Swiften/Roster/GroupRosterItem.cpp
index 2632444..7ce57d2 100644
--- a/Swiften/Roster/GroupRosterItem.cpp
+++ b/Swiften/Roster/GroupRosterItem.cpp
@@ -13,13 +13,21 @@
namespace Swift {
GroupRosterItem::GroupRosterItem(const String& name, GroupRosterItem* parent) : RosterItem(name, parent) {
-
+ expanded_ = true;
}
GroupRosterItem::~GroupRosterItem() {
}
+bool GroupRosterItem::isExpanded() const {
+ return expanded_;
+}
+
+void GroupRosterItem::setExpanded(bool expanded) {
+ expanded_ = expanded;
+}
+
const std::vector<RosterItem*>& GroupRosterItem::getChildren() const {
return children_;
}
diff --git a/Swiften/Roster/GroupRosterItem.h b/Swiften/Roster/GroupRosterItem.h
index 0d230e2..aca2b05 100644
--- a/Swiften/Roster/GroupRosterItem.h
+++ b/Swiften/Roster/GroupRosterItem.h
@@ -25,11 +25,14 @@ class GroupRosterItem : public RosterItem {
void setDisplayed(RosterItem* item, bool displayed);
boost::signal<void ()> onChildrenChanged;
static bool itemLessThan(const RosterItem* left, const RosterItem* right);
+ void setExpanded(bool expanded);
+ bool isExpanded() const;
private:
void handleChildrenChanged(GroupRosterItem* group);
void handleDataChanged(RosterItem* item);
bool sortDisplayed();
String name_;
+ bool expanded_;
std::vector<RosterItem*> children_;
std::vector<RosterItem*> displayedChildren_;
};