summaryrefslogtreecommitdiff
path: root/plugins/Clist_modern/src/modern_statusbar.cpp
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/Clist_modern/src/modern_statusbar.cpp
parent2f880bda3aa2d8817ce43481df9d99b12ed82a58 (diff)
Accounts() : iterator for accounts
Diffstat (limited to 'plugins/Clist_modern/src/modern_statusbar.cpp')
-rw-r--r--plugins/Clist_modern/src/modern_statusbar.cpp16
1 files changed, 6 insertions, 10 deletions
diff --git a/plugins/Clist_modern/src/modern_statusbar.cpp b/plugins/Clist_modern/src/modern_statusbar.cpp
index ccb7808d7b..1b396c6652 100644
--- a/plugins/Clist_modern/src/modern_statusbar.cpp
+++ b/plugins/Clist_modern/src/modern_statusbar.cpp
@@ -167,14 +167,12 @@ int ModernDrawStatusBarWorker(HWND hWnd, HDC hDC)
ProtosData.destroy();
- int protoCount;
- PROTOACCOUNT **accs;
- Proto_EnumAccounts(&protoCount, &accs);
- if (protoCount == 0)
+ auto &accs = Accounts();
+ if (accs.getCount() == 0)
return 0;
int iProtoInStatusMenu = 0;
- for (int j = 0; j < protoCount; j++) {
+ for (int j = 0; j < accs.getCount(); j++) {
int i = pcli->pfnGetAccountIndexByPos(j);
if (i == -1)
continue;
@@ -266,7 +264,6 @@ int ModernDrawStatusBarWorker(HWND hWnd, HDC hDC)
return 0;
// START MULTILINE HERE
- int orig_protoCount = protoCount;
int orig_visProtoCount = ProtosData.getCount();
int protosperline = 0;
@@ -274,9 +271,9 @@ int ModernDrawStatusBarWorker(HWND hWnd, HDC hDC)
protosperline = g_StatusBarData.nProtosPerLine;
else if (orig_visProtoCount)
protosperline = orig_visProtoCount;
- else if (protoCount) {
- protosperline = protoCount;
- orig_visProtoCount = protoCount;
+ else if (accs.getCount()) {
+ protosperline = accs.getCount();
+ orig_visProtoCount = accs.getCount();
}
else {
protosperline = 1;
@@ -287,7 +284,6 @@ int ModernDrawStatusBarWorker(HWND hWnd, HDC hDC)
int linecount = protosperline ? (orig_visProtoCount + (protosperline - 1)) / protosperline : 1; // divide with rounding to up
for (int line = 0; line < linecount; line++) {
int rowheight = 2 + max(textSize.cy, iconHeight);
- protoCount = min(protosperline, (orig_protoCount - line*protosperline));
int visProtoCount = min(protosperline, (orig_visProtoCount - line*protosperline));
GetClientRect(hWnd, &rc);