summaryrefslogtreecommitdiff
path: root/src/modules/extraicons/IcolibExtraIcon.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-11-19 17:59:03 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-11-19 17:59:03 +0000
commit6a519f13155c9012db6fb95f7f48a74029d6e3d2 (patch)
tree140d3e46bc2786d96eff7a2366fa61740331b4b5 /src/modules/extraicons/IcolibExtraIcon.cpp
parent32f40b0ecb51fe9bee56e4f7ce2476c4cff53bed (diff)
minor code cleaning
git-svn-id: http://svn.miranda-ng.org/main/trunk@2379 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/modules/extraicons/IcolibExtraIcon.cpp')
-rw-r--r--src/modules/extraicons/IcolibExtraIcon.cpp16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/modules/extraicons/IcolibExtraIcon.cpp b/src/modules/extraicons/IcolibExtraIcon.cpp
index 53d627da9e..323f47bcba 100644
--- a/src/modules/extraicons/IcolibExtraIcon.cpp
+++ b/src/modules/extraicons/IcolibExtraIcon.cpp
@@ -82,7 +82,7 @@ int IcolibExtraIcon::setIcon(int id, HANDLE hContact, HANDLE hIcoLib)
}
}
- storeIcon(hContact, hIcoLib);
+ storeIcon(hContact, "");
if (isEnabled()) {
HANDLE hImage;
@@ -115,16 +115,14 @@ int IcolibExtraIcon::setIconByName(int id, HANDLE hContact, const char *icon)
}
}
- storeIcon(hContact, "");
+ storeIcon(hContact, (char*)icon);
if (isEnabled()) {
- const char *icolibName = (const char *) icon;
-
HANDLE hImage;
- if ( IsEmpty(icolibName))
+ if ( IsEmpty(icon))
hImage = INVALID_HANDLE_VALUE;
else
- hImage = AddIcon(icolibName);
+ hImage = AddIcon(icon);
return ClistSetExtraIcon(hContact, hImage);
}
@@ -139,7 +137,7 @@ void IcolibExtraIcon::storeIcon(HANDLE hContact, void *icon)
const char *icolibName = (const char *) icon;
if ( IsEmpty(icolibName))
- icolibName = ""; // Delete doesn't work, and I don't know why
-
- db_set_s(hContact, MODULE_NAME, name.c_str(), icolibName);
+ db_unset(hContact, MODULE_NAME, name.c_str());
+ else
+ db_set_s(hContact, MODULE_NAME, name.c_str(), icolibName);
}