From 9613f96e6a6f96ad02a0fc926054132811ae2bb1 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 3 Apr 2018 16:30:25 +0300 Subject: Accounts() : iterator for accounts --- plugins/Msg_Export/src/options.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'plugins/Msg_Export/src/options.cpp') diff --git a/plugins/Msg_Export/src/options.cpp b/plugins/Msg_Export/src/options.cpp index 7dff1cf799..70da9b568c 100755 --- a/plugins/Msg_Export/src/options.cpp +++ b/plugins/Msg_Export/src/options.cpp @@ -1134,17 +1134,13 @@ static INT_PTR CALLBACK DlgProcMsgExportOpts2(HWND hwndDlg, UINT msg, WPARAM wPa ImageList_AddIcon(hIml, Skin_LoadIcon(SKINICON_OTHER_TICK)); ListView_SetImageList(hMapUser, hIml, LVSIL_SMALL); - PROTOACCOUNT **proto; - int nCount; - Proto_EnumAccounts(&nCount, &proto); - LVITEMA sItem = { 0 }; sItem.mask = LVIF_TEXT | LVIF_IMAGE; char szTemp[500]; - for (int i = 0; i < nCount; i++) { - mir_snprintf(szTemp, "DisableProt_%s", proto[i]->szModuleName); - sItem.pszText = proto[i]->szModuleName; + for (auto &pa : Accounts()) { + mir_snprintf(szTemp, "DisableProt_%s", pa->szModuleName); + sItem.pszText = pa->szModuleName; sItem.iImage = db_get_b(NULL, MODULE, szTemp, 1); ::SendMessage(hMapUser, LVM_INSERTITEMA, 0, (LPARAM)&sItem); sItem.iItem++; -- cgit v1.2.3