summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Smith <git@kismith.co.uk>2010-10-07 19:40:16 (GMT)
committerKevin Smith <git@kismith.co.uk>2010-10-07 19:40:27 (GMT)
commit88eab3d1d9b722590da3837e3c79839189ea58d2 (patch)
tree05709f368187657c5788ebf2d5206cb47414933d /Swift/Controllers/RosterGroupExpandinessPersister.cpp
parente433e70d3dd015db5124ee72085e758635260168 (diff)
downloadswift-88eab3d1d9b722590da3837e3c79839189ea58d2.zip
swift-88eab3d1d9b722590da3837e3c79839189ea58d2.tar.bz2
Code cleanup from recent commits
Diffstat (limited to 'Swift/Controllers/RosterGroupExpandinessPersister.cpp')
-rw-r--r--Swift/Controllers/RosterGroupExpandinessPersister.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/Swift/Controllers/RosterGroupExpandinessPersister.cpp b/Swift/Controllers/RosterGroupExpandinessPersister.cpp
index a2953a5..d532fcb 100644
--- a/Swift/Controllers/RosterGroupExpandinessPersister.cpp
+++ b/Swift/Controllers/RosterGroupExpandinessPersister.cpp
@@ -29,7 +29,9 @@ void RosterGroupExpandinessPersister::handleGroupAdded(GroupRosterItem* group) {
void RosterGroupExpandinessPersister::handleExpandedChanged(GroupRosterItem* group, bool expanded) {
if (expanded) {
- collapsed_.erase(collapsed_.find(group->getDisplayName()));
+ String displayName = group->getDisplayName();
+ //collapsed_.erase(std::remove(collapsed_.begin(), collapsed_.end(), displayName), collapsed_.end());
+ collapsed_.erase(displayName);
} else {
collapsed_.insert(group->getDisplayName());
}
@@ -50,9 +52,7 @@ void RosterGroupExpandinessPersister::save() {
void RosterGroupExpandinessPersister::load() {
String saved = settings_->getStringSetting(SettingPath);
std::vector<String> collapsed = saved.split('\n');
- foreach (const String& group, collapsed) {
- collapsed_.insert(group);
- }
+ collapsed_.insert(collapsed.begin(), collapsed.end());
}
const String RosterGroupExpandinessPersister::SettingPath = "GroupExpandiness";