summaryrefslogtreecommitdiff
path: root/plugins/AVS/src/options.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/AVS/src/options.cpp
parent2f880bda3aa2d8817ce43481df9d99b12ed82a58 (diff)
Accounts() : iterator for accounts
Diffstat (limited to 'plugins/AVS/src/options.cpp')
-rw-r--r--plugins/AVS/src/options.cpp17
1 files changed, 7 insertions, 10 deletions
diff --git a/plugins/AVS/src/options.cpp b/plugins/AVS/src/options.cpp
index da93793d14..d540b4ef83 100644
--- a/plugins/AVS/src/options.cpp
+++ b/plugins/AVS/src/options.cpp
@@ -1008,21 +1008,18 @@ static INT_PTR CALLBACK DlgProcAvatarProtoInfo(HWND hwndDlg, UINT msg, WPARAM wP
item.iItem = 1000;
// List protocols
- PROTOACCOUNT **accs;
- int count, num = 0;
-
- Proto_EnumAccounts(&count, &accs);
- for (int i = 0; i < count; i++) {
- if (!ProtoServiceExists(accs[i]->szModuleName, PS_GETMYAVATAR))
+ int num = 0;
+ for (auto &it : Accounts()) {
+ if (!ProtoServiceExists(it->szModuleName, PS_GETMYAVATAR))
continue;
- if (!Proto_IsAvatarsEnabled(accs[i]->szModuleName))
+ if (!Proto_IsAvatarsEnabled(it->szModuleName))
continue;
- ImageList_AddIcon(hIml, Skin_LoadProtoIcon(accs[i]->szModuleName, ID_STATUS_ONLINE));
- item.pszText = accs[i]->tszAccountName;
+ ImageList_AddIcon(hIml, Skin_LoadProtoIcon(it->szModuleName, ID_STATUS_ONLINE));
+ item.pszText = it->tszAccountName;
item.iImage = num;
- item.lParam = (LPARAM)accs[i]->szModuleName;
+ item.lParam = (LPARAM)it->szModuleName;
ListView_InsertItem(hwndList, &item);
num++;