diff options
author | George Hazan <ghazan@miranda.im> | 2018-04-04 22:57:14 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-04-04 22:57:14 +0300 |
commit | 25fed4bccbac68ea89325025f9d08fcb5eb6b258 (patch) | |
tree | 3e13e72b4ef15c30b6a8fe40568817b920afefb5 /plugins/UserInfoEx | |
parent | 8e6a28579846d35bc36966dfb50e2eb7f662471a (diff) |
unused CLIST_INTERFACE data moved inside mir_app
Diffstat (limited to 'plugins/UserInfoEx')
-rw-r--r-- | plugins/UserInfoEx/src/mir_menuitems.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/plugins/UserInfoEx/src/mir_menuitems.cpp b/plugins/UserInfoEx/src/mir_menuitems.cpp index 205261f0f0..d5966d1574 100644 --- a/plugins/UserInfoEx/src/mir_menuitems.cpp +++ b/plugins/UserInfoEx/src/mir_menuitems.cpp @@ -484,18 +484,16 @@ INT_PTR RebuildAccount(WPARAM, LPARAM lParam) const BYTE mItems = 3; // menuitems to create
BYTE item = 0;
- int mProtoCount = pcli->menuProtoCount;
-
// on call by hook or first start
if (!lParam || !hMenuItemAccount) {
- size_t sizeNew = mItems * mProtoCount * sizeof(HGENMENU);
+ size_t sizeNew = mItems * pcli->menuProtos->getCount() * sizeof(HGENMENU);
hMenuItemAccount = (HGENMENU*)mir_realloc(hMenuItemAccount, sizeNew);
// set all bytes 0 to avoid problems
memset(hMenuItemAccount, 0, sizeNew);
}
// on options change
else // delete all MenuItems backward (first item second group)
- RemoveMenuItems(hMenuItemAccount, mItems * mProtoCount);
+ RemoveMenuItems(hMenuItemAccount, mItems * pcli->menuProtos->getCount());
// load options
int flag = db_get_b(NULL, MODNAME, SET_MI_ACCOUNT, MCAS_NOTINITIATED);
@@ -505,19 +503,19 @@ INT_PTR RebuildAccount(WPARAM, LPARAM lParam) }
// loop for all account names
- for (int i = 0; i < mProtoCount; i++) {
+ for (auto &it : *pcli->menuProtos) {
// set all bytes 0 to avoid problems
item = 0;
- HGENMENU mhRoot = pcli->menuProtos[i].pMenu, mhExIm;
+ HGENMENU mhRoot = it->pMenu, mhExIm;
if (mhRoot == nullptr)
break;
- PROTOACCOUNT *pa = Proto_GetAccount(pcli->menuProtos[i].szProto);
+ PROTOACCOUNT *pa = Proto_GetAccount(it->szProto);
// create service name main (account module name) and set pointer to end it
char text[200];
- mir_strcpy(text, pcli->menuProtos[i].szProto);
+ mir_strcpy(text, it->szProto);
CMenuItem mi;
mi.pszService = text;
@@ -526,6 +524,7 @@ INT_PTR RebuildAccount(WPARAM, LPARAM lParam) // support new genmenu style
mi.root = mhRoot;
+ int i = pcli->menuProtos->indexOf(&it);
switch (flag) {
case 3:
// cascade off
|