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/TipperYM/src/options.cpp | |
parent | 2f880bda3aa2d8817ce43481df9d99b12ed82a58 (diff) |
Accounts() : iterator for accounts
Diffstat (limited to 'plugins/TipperYM/src/options.cpp')
-rw-r--r-- | plugins/TipperYM/src/options.cpp | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/plugins/TipperYM/src/options.cpp b/plugins/TipperYM/src/options.cpp index 02786dbd07..13cf5ad354 100644 --- a/plugins/TipperYM/src/options.cpp +++ b/plugins/TipperYM/src/options.cpp @@ -1916,17 +1916,13 @@ INT_PTR CALLBACK DlgProcOptsTraytip(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA tvi.hInsertAfter = TVI_LAST;
tvi.item.mask = TVIF_TEXT | TVIF_STATE;
- int count = 0;
- PROTOACCOUNT **accs;
- Proto_EnumAccounts(&count, &accs);
-
- for (int i = 0; i < count; i++) {
- if (CallProtoService(accs[i]->szModuleName, PS_GETCAPS, PFLAGNUM_2, 0) != 0) {
- tvi.item.pszText = accs[i]->tszAccountName;
+ for (auto &pa : Accounts()) {
+ if (CallProtoService(pa->szModuleName, PS_GETCAPS, PFLAGNUM_2, 0) != 0) {
+ tvi.item.pszText = pa->tszAccountName;
tvi.item.stateMask = TVIS_STATEIMAGEMASK;
- tvi.item.state = INDEXTOSTATEIMAGEMASK(IsTrayProto(accs[i]->tszAccountName, false) ? 2 : 1);
+ tvi.item.state = INDEXTOSTATEIMAGEMASK(IsTrayProto(pa->tszAccountName, false) ? 2 : 1);
TreeView_InsertItem(GetDlgItem(hwndDlg, IDC_TREE_FIRST_PROTOS), &tvi);
- tvi.item.state = INDEXTOSTATEIMAGEMASK(IsTrayProto(accs[i]->tszAccountName, true) ? 2 : 1);
+ tvi.item.state = INDEXTOSTATEIMAGEMASK(IsTrayProto(pa->tszAccountName, true) ? 2 : 1);
TreeView_InsertItem(GetDlgItem(hwndDlg, IDC_TREE_SECOND_PROTOS), &tvi);
}
}
|