diff options
author | George Hazan <george.hazan@gmail.com> | 2012-11-19 19:24:30 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2012-11-19 19:24:30 +0000 |
commit | e06301258eb9730619cd527917965dd2ed82ef7a (patch) | |
tree | 135014fe6d8eaff7b58607c99411b4b83369c6a3 /src/modules/extraicons/IcolibExtraIcon.cpp | |
parent | 6a519f13155c9012db6fb95f7f48a74029d6e3d2 (diff) |
ugly clutch for those blasted extra icons
git-svn-id: http://svn.miranda-ng.org/main/trunk@2380 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/modules/extraicons/IcolibExtraIcon.cpp')
-rw-r--r-- | src/modules/extraicons/IcolibExtraIcon.cpp | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src/modules/extraicons/IcolibExtraIcon.cpp b/src/modules/extraicons/IcolibExtraIcon.cpp index 323f47bcba..bf598c3e7e 100644 --- a/src/modules/extraicons/IcolibExtraIcon.cpp +++ b/src/modules/extraicons/IcolibExtraIcon.cpp @@ -28,9 +28,11 @@ IcolibExtraIcon::IcolibExtraIcon(int _id, const char *_name, const TCHAR *_descr MIRANDAHOOKPARAM _OnClick, LPARAM _param) :
BaseExtraIcon(_id, _name, _description, _descIcon, _OnClick, _param)
{
- char setting[512];
- mir_snprintf(setting, SIZEOF(setting), "%s/%s", MODULE_NAME, _name);
- CallService(MS_DB_SETSETTINGRESIDENT, TRUE, (WPARAM) setting);
+ #ifndef _DEBUG
+ char setting[512];
+ mir_snprintf(setting, SIZEOF(setting), "%s/%s", MODULE_NAME, _name);
+ CallService(MS_DB_SETSETTINGRESIDENT, TRUE, (WPARAM) setting);
+ #endif
}
IcolibExtraIcon::~IcolibExtraIcon()
@@ -53,7 +55,7 @@ void IcolibExtraIcon::applyIcon(HANDLE hContact) HANDLE hImage = INVALID_HANDLE_VALUE;
- DBVARIANT dbv = { 0 };
+ DBVARIANT dbv;
if ( !DBGetContactSettingString(hContact, MODULE_NAME, name.c_str(), &dbv)) {
if (!IsEmpty(dbv.pszVal))
hImage = GetIcon(dbv.pszVal);
@@ -73,7 +75,7 @@ int IcolibExtraIcon::setIcon(int id, HANDLE hContact, HANDLE hIcoLib) hIcoLib = NULL;
if (isEnabled()) {
- DBVARIANT dbv = { 0 };
+ DBVARIANT dbv;
if ( !DBGetContactSettingString(hContact, MODULE_NAME, name.c_str(), &dbv)) {
if (!IsEmpty(dbv.pszVal))
RemoveIcon(dbv.pszVal);
@@ -82,7 +84,9 @@ int IcolibExtraIcon::setIcon(int id, HANDLE hContact, HANDLE hIcoLib) }
}
- storeIcon(hContact, "");
+ char szId[30];
+ wsprintfA(szId, "{%p}", hIcoLib);
+ storeIcon(hContact, szId);
if (isEnabled()) {
HANDLE hImage;
@@ -106,7 +110,7 @@ int IcolibExtraIcon::setIconByName(int id, HANDLE hContact, const char *icon) icon = NULL;
if (isEnabled()) {
- DBVARIANT dbv = { 0 };
+ DBVARIANT dbv;
if ( !DBGetContactSettingString(hContact, MODULE_NAME, name.c_str(), &dbv)) {
if (!IsEmpty(dbv.pszVal))
RemoveIcon(dbv.pszVal);
|