summaryrefslogtreecommitdiff
path: root/plugins/Svc_dbepp/icons.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-07-09 17:53:15 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-07-09 17:53:15 +0000
commitcee90240b1301ad373e98fe874a924fcdbb83447 (patch)
tree2a289365c84efbfd0c27eca4663294b04737d2f1 /plugins/Svc_dbepp/icons.cpp
parent132e74c3f3f5a31558b6b50be7be70e7bc283804 (diff)
- fix for button states errors in Clist Modern;
- fix for message handling duplicates; - fix for naming toolbar icons; - removed duplicate icon entry in dbeditor++ git-svn-id: http://svn.miranda-ng.org/main/trunk@884 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Svc_dbepp/icons.cpp')
-rw-r--r--plugins/Svc_dbepp/icons.cpp49
1 files changed, 12 insertions, 37 deletions
diff --git a/plugins/Svc_dbepp/icons.cpp b/plugins/Svc_dbepp/icons.cpp
index ae77539ae0..6da3723bfe 100644
--- a/plugins/Svc_dbepp/icons.cpp
+++ b/plugins/Svc_dbepp/icons.cpp
@@ -79,34 +79,28 @@ HICON LoadSkinnedDBEIcon(int icon)
int AddIconToList(HIMAGELIST hil, HICON hIcon)
{
-
- if (!hIcon || !hil) return 0;
+ if (!hIcon || !hil)
+ return 0;
ImageList_AddIcon(hil, hIcon);
-
return 1;
-
}
-
static PROTOCOLDESCRIPTOR **protocols = NULL;
static int protoCount = 0;
static int shift = 0;
-
void AddProtoIconsToList(HIMAGELIST hil, int newshift)
{
- HICON hIcon;
- int i;
shift = newshift;
CallService(MS_PROTO_ENUMPROTOCOLS,(WPARAM)&protoCount,(LPARAM)&protocols);
- for(i = 0 ;i < protoCount; i++)
- {
+ for (int i = 0; i < protoCount; i++) {
if (protocols[i]->type != PROTOTYPE_PROTOCOL)
continue;
+ HICON hIcon;
if (hIcon=LoadSkinnedProtoIcon(protocols[i]->szName, ID_STATUS_ONLINE))
AddIconToList(hil, hIcon);
else
@@ -114,49 +108,30 @@ void AddProtoIconsToList(HIMAGELIST hil, int newshift)
}
}
-
int GetProtoIcon(char *szProto)
{
- int result = DEF_ICON;
- int i, n = 0;
+ if ( !protoCount || !protocols || !szProto)
+ return DEF_ICON;
- if (!protoCount || !protocols || !szProto) return result;
+ int n = 0;
- for(i = 0 ;i < protoCount; i++)
- {
+ for (int i = 0; i < protoCount; i++) {
if (protocols[i]->type != PROTOTYPE_PROTOCOL)
continue;
if (!mir_strcmp(protocols[i]->szName, szProto))
- {
- result = n + shift;
- break;
- }
+ return n + shift;
n++;
-
}
- return result;
+ return DEF_ICON;
}
-
BOOL IsProtocolLoaded(char* pszProtocolName)
{
-/*
- if (pszProtocolName && pszProtocolName[0])
- {
- int res = CallService(MS_PROTO_ISPROTOCOLLOADED, 0, (LPARAM)pszProtocolName);
-
- if (res != CALLSERVICE_NOTFOUND && res)
- return TRUE;
- }
-*/
- int i;
-
- if (protoCount)
- for(i = 0 ;i < protoCount; i++)
- {
+ if (protoCount)
+ for(int i = 0; i < protoCount; i++) {
if (protocols[i]->type != PROTOTYPE_PROTOCOL)
continue;