diff options
author | George Hazan <george.hazan@gmail.com> | 2015-12-28 16:41:16 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2015-12-28 16:41:16 +0000 |
commit | 12d56e14046d4ea6fd9d4edd3e2e32e051f145ad (patch) | |
tree | bc9f1943e44c194f3baebd0257b5fc7efa063d74 /src/mir_app | |
parent | b6e04ef297e00d046da2401c91c517bf6856b1c1 (diff) |
missing menu ids for the protocol menus
git-svn-id: http://svn.miranda-ng.org/main/trunk@15957 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/mir_app')
-rw-r--r-- | src/mir_app/src/menu_utils.cpp | 10 | ||||
-rw-r--r-- | src/mir_app/src/proto_accs.cpp | 6 |
2 files changed, 12 insertions, 4 deletions
diff --git a/src/mir_app/src/menu_utils.cpp b/src/mir_app/src/menu_utils.cpp index 5e2dd18262..03c477061d 100644 --- a/src/mir_app/src/menu_utils.cpp +++ b/src/mir_app/src/menu_utils.cpp @@ -243,6 +243,16 @@ MIR_APP_DLL(HGENMENU) Menu_GetProtocolRoot(PROTO_INTERFACE *pThis) mi.position = 500090000;
mi.flags = CMIF_TCHAR | CMIF_KEEPUNTRANSLATED;
mi.hIcolibItem = pThis->m_hProtoIcon;
+
+ char szUid[33];
+ if (db_get_static(NULL, pThis->m_szModuleName, "AM_MenuId", szUid, _countof(szUid))) {
+ UUID id;
+ UuidCreate(&id);
+ bin2hex(&id, sizeof(id), szUid);
+ db_set_s(NULL, pThis->m_szModuleName, "AM_MenuId", szUid);
+ }
+ hex2bin(szUid, &mi.uid, sizeof(mi.uid));
+
return pThis->m_hMainMenuItem = Menu_AddMainMenuItem(&mi);
}
diff --git a/src/mir_app/src/proto_accs.cpp b/src/mir_app/src/proto_accs.cpp index 10f0299705..619bdcabef 100644 --- a/src/mir_app/src/proto_accs.cpp +++ b/src/mir_app/src/proto_accs.cpp @@ -45,21 +45,19 @@ LIST<PROTOACCOUNT> accounts(10, CompareAccounts); static int EnumDbModules(const char *szModuleName, DWORD, LPARAM)
{
- char *szProtoName = db_get_sa(NULL, szModuleName, "AM_BaseProto");
+ ptrA szProtoName(db_get_sa(NULL, szModuleName, "AM_BaseProto"));
if (szProtoName) {
if (!Proto_GetAccount(szModuleName)) {
PROTOACCOUNT *pa = (PROTOACCOUNT*)mir_calloc(sizeof(PROTOACCOUNT));
pa->cbSize = sizeof(*pa);
pa->szModuleName = mir_strdup(szModuleName);
- pa->szProtoName = szProtoName;
+ pa->szProtoName = szProtoName.detach();
pa->tszAccountName = mir_a2t(szModuleName);
pa->bIsVisible = TRUE;
pa->bIsEnabled = FALSE;
pa->iOrder = accounts.getCount();
accounts.insert(pa);
}
- else
- mir_free(szProtoName);
}
return 0;
}
|