summaryrefslogtreecommitdiff
path: root/plugins/TooltipNotify/src/TooltipNotify.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-10-07 12:50:40 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-10-07 12:50:40 +0000
commitc6fb861d7159279b6ee4a4dd678d4693ee56bac6 (patch)
treedf911e6eaf7bd944081aae96f5df9c2ef84c2476 /plugins/TooltipNotify/src/TooltipNotify.cpp
parent95da57c8e9cf894adf3afae124a29d292b085c5e (diff)
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
Diffstat (limited to 'plugins/TooltipNotify/src/TooltipNotify.cpp')
-rw-r--r--plugins/TooltipNotify/src/TooltipNotify.cpp40
1 files changed, 16 insertions, 24 deletions
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;