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 | |
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')
-rw-r--r-- | src/modules/extraicons/DefaultExtraIcons.cpp | 6 | ||||
-rw-r--r-- | src/modules/extraicons/IcolibExtraIcon.cpp | 18 | ||||
-rw-r--r-- | src/modules/extraicons/extraicons.cpp | 2 | ||||
-rw-r--r-- | src/modules/extraicons/usedIcons.cpp | 5 |
4 files changed, 19 insertions, 12 deletions
diff --git a/src/modules/extraicons/DefaultExtraIcons.cpp b/src/modules/extraicons/DefaultExtraIcons.cpp index 872c5915cc..6599be7aa6 100644 --- a/src/modules/extraicons/DefaultExtraIcons.cpp +++ b/src/modules/extraicons/DefaultExtraIcons.cpp @@ -176,7 +176,7 @@ static void SetExtraIcons(HANDLE hContact) if (info.db[j + 1] == NULL)
break;
- DBVARIANT dbv = { 0 };
+ DBVARIANT dbv;
if (!DBGetContactSettingString(hContact, info.db[j] == NULL ? proto : info.db[j], info.db[j+1], &dbv)) {
if (!IsEmpty(dbv.pszVal)) {
info.SetIcon(hContact, &info, dbv.pszVal);
@@ -253,8 +253,8 @@ static int DefaultOnClick(WPARAM wParam, LPARAM lParam, LPARAM param) if (info->db[j + 1] == NULL)
break;
- DBVARIANT dbv = { 0 };
- if (!DBGetContactSettingString(hContact, info->db[j] == NULL ? proto : info->db[j], info->db[j+1], &dbv)) {
+ DBVARIANT dbv;
+ if ( !DBGetContactSettingString(hContact, info->db[j] == NULL ? proto : info->db[j], info->db[j+1], &dbv)) {
if (!IsEmpty(dbv.pszVal)) {
info->OnClick(info, dbv.pszVal);
found = true;
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);
diff --git a/src/modules/extraicons/extraicons.cpp b/src/modules/extraicons/extraicons.cpp index 9f119d5706..71565bb89a 100644 --- a/src/modules/extraicons/extraicons.cpp +++ b/src/modules/extraicons/extraicons.cpp @@ -146,7 +146,7 @@ static void LoadGroups(vector<ExtraIconGroup *> &groups) for (unsigned int j = 0; j < items; j++) {
mir_snprintf(setting, SIZEOF(setting), "%d_%d", i, j);
- DBVARIANT dbv = { 0 };
+ DBVARIANT dbv;
if (!DBGetContactSettingString(NULL, MODULE_NAME "Groups", setting, &dbv)) {
if (!IsEmpty(dbv.pszVal)) {
BaseExtraIcon *extra = GetExtraIconByName(dbv.pszVal);
diff --git a/src/modules/extraicons/usedIcons.cpp b/src/modules/extraicons/usedIcons.cpp index e36fac7d96..682573168b 100644 --- a/src/modules/extraicons/usedIcons.cpp +++ b/src/modules/extraicons/usedIcons.cpp @@ -33,8 +33,11 @@ struct Icon }
Icon(HANDLE _hIcolib) :
- name(""), hIcoLib(_hIcolib), refCount(0), hImage(INVALID_HANDLE_VALUE)
+ hIcoLib(_hIcolib), refCount(0), hImage(INVALID_HANDLE_VALUE)
{
+ char szId[30];
+ wsprintfA(szId, "{%p}", _hIcolib);
+ name = szId;
}
};
|