From c6fb861d7159279b6ee4a4dd678d4693ee56bac6 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 7 Oct 2012 12:50:40 +0000 Subject: death of old nasty clutch with MS_PROTO_ENUMPROTOCOLS & PROTOACCOUNT::type git-svn-id: http://svn.miranda-ng.org/main/trunk@1799 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/TooltipNotify/src/TooltipNotify.cpp | 40 ++++++++++++----------------- 1 file changed, 16 insertions(+), 24 deletions(-) (limited to 'plugins/TooltipNotify') diff --git a/plugins/TooltipNotify/src/TooltipNotify.cpp b/plugins/TooltipNotify/src/TooltipNotify.cpp index c6c0b45e79..ab80715591 100644 --- a/plugins/TooltipNotify/src/TooltipNotify.cpp +++ b/plugins/TooltipNotify/src/TooltipNotify.cpp @@ -709,39 +709,31 @@ BOOL CTooltipNotify::ProtosDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lP // enum protocols currently running int iProtoCount = 0; - PROTOCOLDESCRIPTOR **ppProtos = 0; - ::CallService(MS_PROTO_ENUMPROTOCOLS, (WPARAM)&iProtoCount, (LPARAM)&ppProtos); + PROTOACCOUNT **ppProtos = 0; + ProtoEnumAccounts(&iProtoCount, &ppProtos); // and fill in the list - int iNonProtoCount = 0; for (int i=0; i < iProtoCount; i++) { - if (ppProtos[i]->type == PROTOTYPE_PROTOCOL) - { - LV_ITEM lvi; + LV_ITEM lvi; - lvi.mask = LVIF_TEXT; - lvi.iSubItem = 0; - lvi.iItem = i; - lvi.lParam = i; + lvi.mask = LVIF_TEXT; + lvi.iSubItem = 0; + lvi.iItem = i; + lvi.lParam = i; - WCHAR wszProto[128]; - long lLen = MultiByteToWideChar(CP_ACP, 0, ppProtos[i]->szName, - (int)strlen(ppProtos[i]->szName), wszProto, ARRAY_SIZE(wszProto)); - wszProto[lLen] = L'\0'; + WCHAR wszProto[128]; + long lLen = MultiByteToWideChar(CP_ACP, 0, ppProtos[i]->szModuleName, + (int)strlen(ppProtos[i]->szModuleName), wszProto, ARRAY_SIZE(wszProto)); + wszProto[lLen] = L'\0'; - lvi.pszText = wszProto; + lvi.pszText = wszProto; - int new_item = ListView_InsertItem(GetDlgItem(hDlg,IDC_PROTOS),&lvi); + int new_item = ListView_InsertItem(GetDlgItem(hDlg,IDC_PROTOS),&lvi); - BYTE bProtoState = ReadSettingByte(ppProtos[i]->szName, ProtoUserBit|ProtoIntBit); - BOOL bProtoEnabled = (bProtoState & ProtoUserBit) != 0; - ListView_SetCheckState(GetDlgItem(hDlg,IDC_PROTOS), i-iNonProtoCount, bProtoEnabled); - } - else - { - iNonProtoCount++; - } + BYTE bProtoState = ReadSettingByte(ppProtos[i]->szModuleName, ProtoUserBit|ProtoIntBit); + BOOL bProtoEnabled = (bProtoState & ProtoUserBit) != 0; + ListView_SetCheckState(GetDlgItem(hDlg,IDC_PROTOS), i, bProtoEnabled); } return TRUE; -- cgit v1.2.3