summaryrefslogtreecommitdiff
path: root/plugins/AddContactPlus/src/main.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-04-03 16:30:25 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-04-03 16:30:25 +0300
commit9613f96e6a6f96ad02a0fc926054132811ae2bb1 (patch)
treef8fe94a3efe7598a2af926f264d354f7a08fb943 /plugins/AddContactPlus/src/main.cpp
parent2f880bda3aa2d8817ce43481df9d99b12ed82a58 (diff)
Accounts() : iterator for accounts
Diffstat (limited to 'plugins/AddContactPlus/src/main.cpp')
-rw-r--r--plugins/AddContactPlus/src/main.cpp11
1 files changed, 4 insertions, 7 deletions
diff --git a/plugins/AddContactPlus/src/main.cpp b/plugins/AddContactPlus/src/main.cpp
index 9c80075431..30611ab8aa 100644
--- a/plugins/AddContactPlus/src/main.cpp
+++ b/plugins/AddContactPlus/src/main.cpp
@@ -74,15 +74,12 @@ static INT_PTR AddContactPlusDialog(WPARAM, LPARAM)
static int OnAccListChanged(WPARAM, LPARAM)
{
- PROTOACCOUNT** pAccounts;
- int iRealAccCount, iAccCount = 0;
-
- Proto_EnumAccounts(&iRealAccCount, &pAccounts);
- for (int i = 0; i < iRealAccCount; i++) {
- if (!pAccounts[i]->IsEnabled())
+ int iAccCount = 0;
+ for (auto &pa : Accounts()) {
+ if (!pa->IsEnabled())
continue;
- DWORD dwCaps = (DWORD)CallProtoService(pAccounts[i]->szModuleName, PS_GETCAPS, PFLAGNUM_1, 0);
+ DWORD dwCaps = (DWORD)CallProtoService(pa->szModuleName, PS_GETCAPS, PFLAGNUM_1, 0);
if (dwCaps & PF1_BASICSEARCH || dwCaps & PF1_EXTSEARCH || dwCaps & PF1_SEARCHBYEMAIL || dwCaps & PF1_SEARCHBYNAME)
iAccCount++;
}