summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Smith <git@kismith.co.uk>2010-05-14 22:11:54 (GMT)
committerKevin Smith <git@kismith.co.uk>2010-05-14 22:11:54 (GMT)
commit1f48a865bc052b12c3a156426bd1ebdd5955c74e (patch)
tree3cf40b78dab6364a4d00f925f66e9a6cbe7b596f /Swiften/Roster
parente10a0c0902b503bbffdc802aa238c8b6ac4fe210 (diff)
downloadswift-1f48a865bc052b12c3a156426bd1ebdd5955c74e.zip
swift-1f48a865bc052b12c3a156426bd1ebdd5955c74e.tar.bz2
Start roster groups expanded.
Resolves: #343
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_;
};