summaryrefslogtreecommitdiff
path: root/plugins/StatusManager/src/StartupStatus/ss_profiles.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-02-21 18:35:04 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-02-21 18:40:14 +0300
commit5b6db3290cb9c9817cba126bd7aea798a610c31d (patch)
treef5b51474c51988ac60c20d33d3d6837070e055ce /plugins/StatusManager/src/StartupStatus/ss_profiles.cpp
parente4e088d37070bab69b1457621706d65472874243 (diff)
SM: C++'11 iterators
Diffstat (limited to 'plugins/StatusManager/src/StartupStatus/ss_profiles.cpp')
-rw-r--r--plugins/StatusManager/src/StartupStatus/ss_profiles.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/plugins/StatusManager/src/StartupStatus/ss_profiles.cpp b/plugins/StatusManager/src/StartupStatus/ss_profiles.cpp
index 872139fc83..608cface96 100644
--- a/plugins/StatusManager/src/StartupStatus/ss_profiles.cpp
+++ b/plugins/StatusManager/src/StartupStatus/ss_profiles.cpp
@@ -133,11 +133,10 @@ wchar_t* GetStatusMessage(int profile, const char *szProto)
char dbSetting[80];
mir_snprintf(dbSetting, "%d_%s_%s", profile, szProto, SETTING_PROFILE_STSMSG);
- for (int i = 0; i < arProfiles.getCount(); i++) {
- auto &p = arProfiles[i];
- if (p.profile == profile && !mir_strcmp(p.szProto, szProto)) {
- p.msg = db_get_wsa(0, SSMODULENAME, dbSetting);
- return p.msg;
+ for (auto &p : arProfiles) {
+ if (p->profile == profile && !mir_strcmp(p->szProto, szProto)) {
+ p->msg = db_get_wsa(0, SSMODULENAME, dbSetting);
+ return p->msg;
}
}
@@ -181,8 +180,8 @@ int GetProfile(int profile, TProtoSettings &arSettings)
if (profile >= count && count > 0)
return -1;
- for (int i = 0; i < arSettings.getCount(); i++)
- FillStatus(arSettings[i], profile);
+ for (auto &it : arSettings)
+ FillStatus(*it, profile);
return (arSettings.getCount() == 0) ? -1 : 0;
}