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_clisttray.cpp | |
parent | 2f880bda3aa2d8817ce43481df9d99b12ed82a58 (diff) |
Accounts() : iterator for accounts
Diffstat (limited to 'plugins/Clist_modern/src/modern_clisttray.cpp')
-rw-r--r-- | plugins/Clist_modern/src/modern_clisttray.cpp | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/plugins/Clist_modern/src/modern_clisttray.cpp b/plugins/Clist_modern/src/modern_clisttray.cpp index 49d924a24b..20ae2065a3 100644 --- a/plugins/Clist_modern/src/modern_clisttray.cpp +++ b/plugins/Clist_modern/src/modern_clisttray.cpp @@ -274,17 +274,12 @@ void SettingsMigrate(void) static int GetGoodAccNum(bool *bDiffers, bool *bConn = nullptr)
{
- PROTOACCOUNT **acc;
- int AccNum;
- Proto_EnumAccounts(&AccNum, &acc);
-
*bDiffers = false;
if (bConn)
*bConn = false;
int iPrevStatus = 0, res = 0;
- while (AccNum--) {
- PROTOACCOUNT *pa = acc[AccNum];
+ for (auto &pa : Accounts()) {
if (!pa->IsVisible())
continue;
@@ -373,15 +368,9 @@ int cliTrayIconInit(HWND hwnd) break;
case TRAY_ICON_MODE_ALL:
- PROTOACCOUNT **acc;
- int AccNum;
- Proto_EnumAccounts(&AccNum, &acc);
-
- for (int i = AccNum; i--;) {
- PROTOACCOUNT *pa = acc[i];
+ for (auto &pa : Accounts().rev_iter())
if (pa->IsVisible() && pa->ppro != nullptr)
pcli->pfnTrayIconAdd(hwnd, pa->szModuleName, nullptr, pa->ppro->m_iStatus);
- }
break;
}
|