diff options
author | George Hazan <george.hazan@gmail.com> | 2013-03-17 11:13:48 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2013-03-17 11:13:48 +0000 |
commit | 79c0e81fbfd1f933a1e251db23dc1fd537ddd239 (patch) | |
tree | a43cd8362d2f65c11e7db664fded2f3e1b105ca0 /plugins/Clist_modern/src/modern_clistmod.cpp | |
parent | 702f2b6951058a0569f0210a19545c79bcb5b511 (diff) |
- all file paths inside clist_modern became Unicode;
- some major resource leaks fixed;
- code cleaning
git-svn-id: http://svn.miranda-ng.org/main/trunk@4069 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Clist_modern/src/modern_clistmod.cpp')
-rw-r--r-- | plugins/Clist_modern/src/modern_clistmod.cpp | 36 |
1 files changed, 11 insertions, 25 deletions
diff --git a/plugins/Clist_modern/src/modern_clistmod.cpp b/plugins/Clist_modern/src/modern_clistmod.cpp index 3a102bd281..fdc095d935 100644 --- a/plugins/Clist_modern/src/modern_clistmod.cpp +++ b/plugins/Clist_modern/src/modern_clistmod.cpp @@ -67,49 +67,35 @@ BOOL (WINAPI *MySetProcessWorkingSetSize)(HANDLE,SIZE_T,SIZE_T); //returns normal icon or combined with status overlay. Needs to be destroyed.
HICON cliGetIconFromStatusMode(HANDLE hContact, const char *szProto,int status)
{
- HICON hIcon = NULL;
- HICON hXIcon = NULL;
// check if options is turned on
BYTE trayOption = db_get_b(NULL,"CLUI","XStatusTray",SETTING_TRAYOPTION_DEFAULT);
- if (trayOption&3 && szProto != NULL)
- {
+ if (trayOption&3 && szProto != NULL) {
// check service exists
char str[MAXMODULELABELLENGTH];
strcpy(str,szProto);
strcat(str,"/GetXStatusIcon");
- if ( ServiceExists(str))
- {
+ if ( ServiceExists(str)) {
// check status is online
- if (status>ID_STATUS_OFFLINE)
- {
+ if (status > ID_STATUS_OFFLINE) {
// get xicon
- hXIcon = (HICON)CallService(str, 0, 0);
- if (hXIcon)
- {
+ HICON hXIcon = (HICON)CallService(str, 0, 0);
+ if (hXIcon) {
// check overlay mode
- if (trayOption&2)
- {
+ if (trayOption & 2) {
// get overlay
HICON MainOverlay = (HICON)GetMainStatusOverlay(status);
- hIcon = ske_CreateJoinedIcon(hXIcon,MainOverlay,(trayOption&4)?192:0);
+ HICON hIcon = ske_CreateJoinedIcon(hXIcon,MainOverlay,(trayOption&4)?192:0);
DestroyIcon_protect(hXIcon);
DestroyIcon_protect(MainOverlay);
+ return hIcon;
}
- else
- {
- // paint it
- hIcon = hXIcon;
- }
+ return hXIcon;
}
}
}
}
- if ( !hIcon)
- {
- hIcon = ske_ImageList_GetIcon(g_himlCListClc,ExtIconFromStatusMode(hContact,szProto,status),ILD_NORMAL);
- }
- // if not ready take normal icon
- return hIcon;
+
+ return ske_ImageList_GetIcon(g_himlCListClc,ExtIconFromStatusMode(hContact,szProto,status),ILD_NORMAL);
}
int ExtIconFromStatusMode(HANDLE hContact, const char *szProto,int status)
|