diff options
author | George Hazan <ghazan@miranda.im> | 2018-04-03 16:30:25 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-04-03 16:30:25 +0300 |
commit | 9613f96e6a6f96ad02a0fc926054132811ae2bb1 (patch) | |
tree | f8fe94a3efe7598a2af926f264d354f7a08fb943 /plugins/StopSpamPlus | |
parent | 2f880bda3aa2d8817ce43481df9d99b12ed82a58 (diff) |
Accounts() : iterator for accounts
Diffstat (limited to 'plugins/StopSpamPlus')
-rw-r--r-- | plugins/StopSpamPlus/src/options.cpp | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/plugins/StopSpamPlus/src/options.cpp b/plugins/StopSpamPlus/src/options.cpp index 158f0f5acd..db5d0f6588 100644 --- a/plugins/StopSpamPlus/src/options.cpp +++ b/plugins/StopSpamPlus/src/options.cpp @@ -115,19 +115,14 @@ public: item.mask = LVIF_TEXT | LVIF_PARAM;
item.iItem = 1000;
- int n;
- PROTOACCOUNT **pa;
- Proto_EnumAccounts(&n, &pa);
-
- for (int i = 0; i < n; i++) {
- PROTOACCOUNT *p = pa[i];
- if (!p->IsEnabled() || p->bIsVirtual)
+ for (auto &pa : Accounts()) {
+ if (!pa->IsEnabled() || pa->bIsVirtual)
continue;
- item.lParam = (LPARAM)p->szModuleName;
- item.pszText = p->tszAccountName;
+ item.lParam = (LPARAM)pa->szModuleName;
+ item.pszText = pa->tszAccountName;
int idx = m_accounts.InsertItem(&item);
- m_accounts.SetCheckState(idx, g_sets.ProtoDisabled(p->szModuleName));
+ m_accounts.SetCheckState(idx, g_sets.ProtoDisabled(pa->szModuleName));
}
}
|