summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2016-11-23 07:09:39 (GMT)
committerTobias Markmann <tm@ayena.de>2016-11-23 11:30:02 (GMT)
commite405ff3561be3d3c0bd79d7d5173923a8828cf02 (patch)
tree9118ef838ebfaec1df90ec24761944b5d833774c /Swift/Controllers/Settings
parent8a71b91be885652f37c5aab5e1ecf25af4599fbc (diff)
downloadswift-e405ff3561be3d3c0bd79d7d5173923a8828cf02.zip
swift-e405ff3561be3d3c0bd79d7d5173923a8828cf02.tar.bz2
Migrate remaining Swiften/Base/foreach.h use to range-based for loop
Test-Information: Build on macOS 10.12.1 and all tests pass. Change-Id: Iedaa3fa7e7672c77909fd0568bf30e9393cb87e0
Diffstat (limited to 'Swift/Controllers/Settings')
-rw-r--r--Swift/Controllers/Settings/SettingsProviderHierachy.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/Swift/Controllers/Settings/SettingsProviderHierachy.cpp b/Swift/Controllers/Settings/SettingsProviderHierachy.cpp
index 5156d14..a05fabc 100644
--- a/Swift/Controllers/Settings/SettingsProviderHierachy.cpp
+++ b/Swift/Controllers/Settings/SettingsProviderHierachy.cpp
@@ -1,20 +1,20 @@
/*
- * Copyright (c) 2012 Isode Limited.
+ * Copyright (c) 2012-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#include <Swift/Controllers/Settings/SettingsProviderHierachy.h>
-#include <Swiften/Base/foreach.h>
#include <Swiften/Base/Log.h>
+
namespace Swift {
SettingsProviderHierachy::~SettingsProviderHierachy() {
}
bool SettingsProviderHierachy::hasSetting(const std::string& key) {
- foreach (SettingsProvider* provider, providers_) {
+ for (auto provider : providers_) {
if (provider->hasSetting(key)) {
return true;
}
@@ -24,7 +24,7 @@ bool SettingsProviderHierachy::hasSetting(const std::string& key) {
std::string SettingsProviderHierachy::getSetting(const Setting<std::string>& setting) {
std::string value = setting.getDefaultValue();
- foreach (SettingsProvider* provider, providers_) {
+ for (auto provider : providers_) {
std::string providerSetting = provider->getSetting(setting);
if (provider->hasSetting(setting.getKey())) {
value = providerSetting;
@@ -44,7 +44,7 @@ void SettingsProviderHierachy::storeSetting(const Setting<std::string>& setting,
bool SettingsProviderHierachy::getSetting(const Setting<bool>& setting) {
bool value = setting.getDefaultValue();
- foreach (SettingsProvider* provider, providers_) {
+ for (auto provider : providers_) {
bool providerSetting = provider->getSetting(setting);
if (provider->hasSetting(setting.getKey())) {
value = providerSetting;
@@ -64,7 +64,7 @@ void SettingsProviderHierachy::storeSetting(const Setting<bool>& setting, const
int SettingsProviderHierachy::getSetting(const Setting<int>& setting) {
int value = setting.getDefaultValue();
- foreach (SettingsProvider* provider, providers_) {
+ for (auto provider : providers_) {
int providerSetting = provider->getSetting(setting);
if (provider->hasSetting(setting.getKey())) {
value = providerSetting;
@@ -97,7 +97,7 @@ void SettingsProviderHierachy::removeProfile(const std::string& profile) {
bool SettingsProviderHierachy::getIsSettingFinal(const std::string& settingPath) {
bool isFinal = false;
- foreach (SettingsProvider* provider, providers_) {
+ for (auto provider : providers_) {
isFinal |= provider->getIsSettingFinal(settingPath);
}
return isFinal;