diff options
Diffstat (limited to 'Swift/Controllers/Roster/RosterGroupExpandinessPersister.cpp')
-rw-r--r-- | Swift/Controllers/Roster/RosterGroupExpandinessPersister.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/Swift/Controllers/Roster/RosterGroupExpandinessPersister.cpp b/Swift/Controllers/Roster/RosterGroupExpandinessPersister.cpp index 0a242ae..81f0c12 100644 --- a/Swift/Controllers/Roster/RosterGroupExpandinessPersister.cpp +++ b/Swift/Controllers/Roster/RosterGroupExpandinessPersister.cpp @@ -1,23 +1,24 @@ /* - * Copyright (c) 2010 Kevin Smith + * Copyright (c) 2010-2012 Kevin Smith * Licensed under the GNU General Public License v3. * See Documentation/Licenses/GPLv3.txt for more information. */ -#include "RosterGroupExpandinessPersister.h" +#include <Swift/Controllers/Roster/RosterGroupExpandinessPersister.h> #include <boost/bind.hpp> #include <vector> #include <Swiften/Base/foreach.h> -#include "Swiften/Base/String.h" -#include "Swift/Controllers/Roster/GroupRosterItem.h" +#include <Swiften/Base/String.h> +#include <Swift/Controllers/Roster/GroupRosterItem.h> +#include <Swift/Controllers/SettingConstants.h> namespace Swift { RosterGroupExpandinessPersister::RosterGroupExpandinessPersister(Roster* roster, SettingsProvider* settings) : roster_(roster), settings_(settings) { load(); roster_->onGroupAdded.connect(boost::bind(&RosterGroupExpandinessPersister::handleGroupAdded, this, _1)); } void RosterGroupExpandinessPersister::handleGroupAdded(GroupRosterItem* group) { @@ -42,21 +43,21 @@ void RosterGroupExpandinessPersister::handleExpandedChanged(GroupRosterItem* gro void RosterGroupExpandinessPersister::save() { std::string setting; foreach (const std::string& group, collapsed_) { if (!setting.empty()) { setting += "\n"; } setting += group; } - settings_->storeString(SettingPath, setting); + settings_->storeSetting(SettingConstants::EXPANDED_ROSTER_GROUPS, setting); } void RosterGroupExpandinessPersister::load() { - std::string saved = settings_->getStringSetting(SettingPath); + std::string saved = settings_->getSetting(SettingConstants::EXPANDED_ROSTER_GROUPS); std::vector<std::string> collapsed = String::split(saved, '\n'); collapsed_.insert(collapsed.begin(), collapsed.end()); } -const std::string RosterGroupExpandinessPersister::SettingPath = "GroupExpandiness"; + } |