From 12d56e14046d4ea6fd9d4edd3e2e32e051f145ad Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 28 Dec 2015 16:41:16 +0000 Subject: missing menu ids for the protocol menus git-svn-id: http://svn.miranda-ng.org/main/trunk@15957 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- src/mir_app/src/menu_utils.cpp | 10 ++++++++++ src/mir_app/src/proto_accs.cpp | 6 ++---- 2 files changed, 12 insertions(+), 4 deletions(-) (limited to 'src/mir_app') 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 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; } -- cgit v1.2.3