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/Clist_modern/src/modern_viewmodebar.cpp | |
parent | 2f880bda3aa2d8817ce43481df9d99b12ed82a58 (diff) |
Accounts() : iterator for accounts
Diffstat (limited to 'plugins/Clist_modern/src/modern_viewmodebar.cpp')
-rw-r--r-- | plugins/Clist_modern/src/modern_viewmodebar.cpp | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/plugins/Clist_modern/src/modern_viewmodebar.cpp b/plugins/Clist_modern/src/modern_viewmodebar.cpp index 565d2edaeb..f51c72b5ed 100644 --- a/plugins/Clist_modern/src/modern_viewmodebar.cpp +++ b/plugins/Clist_modern/src/modern_viewmodebar.cpp @@ -208,17 +208,12 @@ static int FillDialog(HWND hwnd) ListView_InsertColumn(GetDlgItem(hwnd, IDC_PROTOCOLS), 0, &lvc);
// fill protocols...
- int protoCount;
- PROTOACCOUNT **accs;
- Proto_EnumAccounts(&protoCount, &accs);
- {
- LVITEMA item = { 0 };
- item.mask = LVIF_TEXT;
- item.iItem = 1000;
- for (int i = 0; i < protoCount; i++) {
- item.pszText = accs[i]->szModuleName;
- SendMessageA(hwndList, LVM_INSERTITEMA, 0, (LPARAM)&item);
- }
+ LVITEMA item = { 0 };
+ item.mask = LVIF_TEXT;
+ item.iItem = 1000;
+ for (auto &pa : Accounts()) {
+ item.pszText = pa->szModuleName;
+ SendMessageA(hwndList, LVM_INSERTITEMA, 0, (LPARAM)&item);
}
ListView_SetColumnWidth(hwndList, 0, LVSCW_AUTOSIZE);
|