summaryrefslogtreecommitdiff
path: root/plugins/UserInfoEx/src/Flags/svc_flags.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-11-19 12:51:53 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-11-19 12:51:53 +0000
commit32dedc767dec565c576b78b786e7a95d76ac806e (patch)
tree0f2eb209b3716569a8e3c3ef146a91f402ebbb4d /plugins/UserInfoEx/src/Flags/svc_flags.cpp
parentadf7367cfdb57b32aadeb74af45dce9a6a3c02a5 (diff)
- added another helper, ExtraIcon_Clear, to remove an icon from slot;
- added ability to pass IcoLib handles instead of icons' names git-svn-id: http://svn.miranda-ng.org/main/trunk@2371 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/UserInfoEx/src/Flags/svc_flags.cpp')
-rw-r--r--plugins/UserInfoEx/src/Flags/svc_flags.cpp22
1 files changed, 6 insertions, 16 deletions
diff --git a/plugins/UserInfoEx/src/Flags/svc_flags.cpp b/plugins/UserInfoEx/src/Flags/svc_flags.cpp
index c864e0bca8..e3b59f47f8 100644
--- a/plugins/UserInfoEx/src/Flags/svc_flags.cpp
+++ b/plugins/UserInfoEx/src/Flags/svc_flags.cpp
@@ -234,30 +234,20 @@ static INT_PTR ServiceDetectContactOriginCountry(WPARAM wParam,LPARAM lParam)
static void CALLBACK SetExtraImage(LPARAM lParam)
{
/* get contact's country */
- int countryNumber = ServiceDetectContactOriginCountry((WPARAM)lParam,0);;
-
- EXTRAICON ico = { sizeof(ico) };
- ico.hContact = (HANDLE)lParam;
- ico.hExtraIcon = hExtraIconSvc;
- ico.icoName = (char*)0; //preset
+ int countryNumber = ServiceDetectContactOriginCountry((WPARAM)lParam,0);
if (countryNumber != 0xFFFF || gFlagsOpts.bUseUnknownFlag) {
char szId[20];
- mir_snprintf(szId, SIZEOF(szId), (countryNumber==0xFFFF)?"%s_0x%X":"%s_%i","flags",countryNumber); /* buffer safe */
- ico.icoName = szId;
+ mir_snprintf(szId, SIZEOF(szId), (countryNumber == 0xFFFF) ? "%s_0x%X" : "%s_%i","flags", countryNumber); /* buffer safe */
+ ExtraIcon_SetIcon(hExtraIconSvc, (HANDLE)lParam, szId);
}
- CallService(MS_EXTRAICON_SET_ICON, (WPARAM)&ico, 0);
+ else ExtraIcon_Clear(hExtraIconSvc, (HANDLE)lParam);
}
static void CALLBACK RemoveExtraImages(LPARAM lParam)
{
- EXTRAICON ico = { sizeof(ico) };
- ico.hExtraIcon = hExtraIconSvc;
- ico.icoName = 0; /* invalidate icon for contact*/
/* enum all contacts */
- for (HANDLE hContact = DB::Contact::FindFirst(); hContact != NULL; hContact = DB::Contact::FindNext(hContact)) {
- ico.hContact = hContact;
- CallService(MS_EXTRAICON_SET_ICON, (WPARAM)&ico, 0);
- }
+ for (HANDLE hContact = DB::Contact::FindFirst(); hContact != NULL; hContact = DB::Contact::FindNext(hContact))
+ ExtraIcon_Clear(hExtraIconSvc, hContact);
}
// always call in context of main thread