summaryrefslogtreecommitdiff
path: root/plugins/SeenPlugin
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/SeenPlugin
parent2f880bda3aa2d8817ce43481df9d99b12ed82a58 (diff)
Accounts() : iterator for accounts
Diffstat (limited to 'plugins/SeenPlugin')
-rw-r--r--plugins/SeenPlugin/src/options.cpp14
1 files changed, 5 insertions, 9 deletions
diff --git a/plugins/SeenPlugin/src/options.cpp b/plugins/SeenPlugin/src/options.cpp
index 00f5eaf808..4b4882d5d6 100644
--- a/plugins/SeenPlugin/src/options.cpp
+++ b/plugins/SeenPlugin/src/options.cpp
@@ -287,17 +287,13 @@ INT_PTR CALLBACK OptsSettingsDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM
tvis.item.mask = TVIF_TEXT | TVIF_HANDLE | TVIF_STATE | TVIF_PARAM;
tvis.item.stateMask = TVIS_STATEIMAGEMASK;
- PROTOACCOUNT **protos;
- int numberOfProtocols;
- Proto_EnumAccounts(&numberOfProtocols, &protos);
-
- for (int i = 0; i < numberOfProtocols; i++) {
- if (CallProtoService(protos[i]->szModuleName, PS_GETCAPS, PFLAGNUM_2, 0) == 0)
+ for (auto &pa : Accounts()) {
+ if (CallProtoService(pa->szModuleName, PS_GETCAPS, PFLAGNUM_2, 0) == 0)
continue;
- tvis.item.pszText = protos[i]->tszAccountName;
- tvis.item.lParam = (LPARAM)mir_strdup(protos[i]->szModuleName);
- tvis.item.state = INDEXTOSTATEIMAGEMASK(IsWatchedProtocol(protos[i]->szModuleName) + 1);
+ tvis.item.pszText = pa->tszAccountName;
+ tvis.item.lParam = (LPARAM)mir_strdup(pa->szModuleName);
+ tvis.item.state = INDEXTOSTATEIMAGEMASK(IsWatchedProtocol(pa->szModuleName) + 1);
TreeView_InsertItem(GetDlgItem(hdlg, IDC_PROTOCOLLIST), &tvis);
}
}