summaryrefslogtreecommitdiff
path: root/src
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 /src
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 'src')
-rw-r--r--src/core/miranda.h4
-rw-r--r--src/core/stdplug.h2
-rw-r--r--src/modules/addcontact/addcontact.cpp2
-rw-r--r--src/modules/clist/Docking.cpp4
-rw-r--r--src/modules/clist/clcutils.cpp2
-rw-r--r--src/modules/clist/clistevents.cpp4
-rw-r--r--src/modules/clist/clistmenus.cpp4
-rw-r--r--src/modules/clist/clistmod.cpp2
-rw-r--r--src/modules/clist/clisttray.cpp6
-rw-r--r--src/modules/clist/clui.cpp14
-rw-r--r--src/modules/clist/contacts.cpp22
-rw-r--r--src/modules/clist/genmenu.cpp2
-rw-r--r--src/modules/clist/genmenuopt.cpp2
-rw-r--r--src/modules/clist/groups.cpp42
-rw-r--r--src/modules/clist/keyboard.cpp2
-rw-r--r--src/modules/database/dbini.cpp2
-rw-r--r--src/modules/extraicons/CallbackExtraIcon.cpp9
-rw-r--r--src/modules/extraicons/CallbackExtraIcon.h3
-rw-r--r--src/modules/extraicons/DefaultExtraIcons.cpp14
-rw-r--r--src/modules/extraicons/ExtraIcon.h17
-rw-r--r--src/modules/extraicons/ExtraIconGroup.cpp63
-rw-r--r--src/modules/extraicons/ExtraIconGroup.h6
-rw-r--r--src/modules/extraicons/IcolibExtraIcon.cpp61
-rw-r--r--src/modules/extraicons/IcolibExtraIcon.h6
-rw-r--r--src/modules/extraicons/extraicons.cpp33
-rw-r--r--src/modules/extraicons/options_ei.cpp4
-rw-r--r--src/modules/extraicons/usedIcons.cpp69
-rw-r--r--src/modules/extraicons/usedIcons.h9
-rw-r--r--src/modules/findadd/findadd.cpp2
-rw-r--r--src/modules/fonts/FontOptions.cpp2
-rw-r--r--src/modules/fonts/services.cpp2
-rw-r--r--src/modules/icolib/skin2icons.cpp2
-rw-r--r--src/modules/json/JSONNode.h4
-rw-r--r--src/modules/langpack/lpservices.cpp2
-rw-r--r--src/modules/netlib/netlib.cpp2
-rw-r--r--src/modules/netlib/netliblog.cpp6
-rw-r--r--src/modules/netlib/netlibopts.cpp10
-rw-r--r--src/modules/options/options.cpp6
-rw-r--r--src/modules/protocols/protoaccs.cpp16
-rw-r--r--src/modules/protocols/protoopts.cpp4
-rw-r--r--src/modules/skin/skinicons.cpp6
-rw-r--r--src/modules/skin/sounds.cpp10
-rw-r--r--src/modules/utils/openurl.cpp2
-rw-r--r--src/modules/utils/path.cpp2
-rw-r--r--src/modules/utils/timezones.cpp6
45 files changed, 296 insertions, 198 deletions
diff --git a/src/core/miranda.h b/src/core/miranda.h
index b0369e0f08..614c4aee98 100644
--- a/src/core/miranda.h
+++ b/src/core/miranda.h
@@ -255,7 +255,7 @@ public:
extern "C"
{
- MIR_CORE_DLL(int) Langpack_MarkPluginLoaded(PLUGININFOEX* pInfo);
- MIR_CORE_DLL(int) GetSubscribersCount(HANDLE hHook);
+ MIR_CORE_DLL(int)Langpack_MarkPluginLoaded(PLUGININFOEX* pInfo);
+ MIR_CORE_DLL(int)GetSubscribersCount(HANDLE hHook);
MIR_CORE_DLL(void) db_setCurrent(MIDatabase* _db);
};
diff --git a/src/core/stdplug.h b/src/core/stdplug.h
index 269eeeba3d..00cecdbbfa 100644
--- a/src/core/stdplug.h
+++ b/src/core/stdplug.h
@@ -13,7 +13,7 @@ MIRANDA_EXE_FUNC(HANDLE) IcoLib_AddNewIcon(int hLangpack, SKINICONDESC* sid);
MIRANDA_EXE_FUNC(HICON) IcoLib_GetIcon(const char* pszIconName, bool big);
MIRANDA_EXE_FUNC(HICON) IcoLib_GetIconByHandle(HANDLE hItem, bool big);
MIRANDA_EXE_FUNC(HANDLE) IcoLib_IsManaged(HICON hIcon);
-MIRANDA_EXE_FUNC(int) IcoLib_ReleaseIcon(HICON hIcon, char* szIconName, bool big=false);
+MIRANDA_EXE_FUNC(int) IcoLib_ReleaseIcon(HICON hIcon, char* szIconName, bool big=false);
MIRANDA_EXE_FUNC(void) Button_SetIcon_IcoLib(HWND hDlg, int itemId, int iconId, const char* tooltip);
MIRANDA_EXE_FUNC(void) Button_FreeIcon_IcoLib(HWND hDlg, int itemId);
diff --git a/src/modules/addcontact/addcontact.cpp b/src/modules/addcontact/addcontact.cpp
index 1736e35917..60ef8cca0d 100644
--- a/src/modules/addcontact/addcontact.cpp
+++ b/src/modules/addcontact/addcontact.cpp
@@ -98,7 +98,7 @@ INT_PTR CALLBACK AddContactDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lp
if (DBGetContactSettingTString(NULL, "CListGroups", idstr, &dbv)) break;
id = SendDlgItemMessage(hdlg, IDC_GROUP, CB_ADDSTRING, 0, (LPARAM)(dbv.ptszVal+1));
SendDlgItemMessage(hdlg, IDC_GROUP, CB_SETITEMDATA , id, groupId+1);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
diff --git a/src/modules/clist/Docking.cpp b/src/modules/clist/Docking.cpp
index 3308176347..d2695ef6b6 100644
--- a/src/modules/clist/Docking.cpp
+++ b/src/modules/clist/Docking.cpp
@@ -170,8 +170,8 @@ int fnDocking_ProcessWindowMessage(WPARAM wParam, LPARAM lParam)
draggingTitle = 0;
docked = db_get_b(NULL, "CLUI", "DockToSides", 1) ?
(char) db_get_b(NULL, "CList", "Docked", 0) : 0;
- dockPos.x = (int) db_get_dw(NULL, "CList", "DockX", 0);
- dockPos.y = (int) db_get_dw(NULL, "CList", "DockY", 0);
+ dockPos.x = (int)db_get_dw(NULL, "CList", "DockX", 0);
+ dockPos.y = (int)db_get_dw(NULL, "CList", "DockY", 0);
break;
case WM_ACTIVATE:
diff --git a/src/modules/clist/clcutils.cpp b/src/modules/clist/clcutils.cpp
index 8b237e7d8f..e3ae2be605 100644
--- a/src/modules/clist/clcutils.cpp
+++ b/src/modules/clist/clcutils.cpp
@@ -225,7 +225,7 @@ void fnScrollTo(HWND hwnd, struct ClcData *dat, int desty, int noSmooth)
nowTick = GetTickCount();
if (nowTick >= startTick + dat->scrollTime)
break;
- dat->yScroll = oldy + (desty - oldy) * (int) (nowTick - startTick) / dat->scrollTime;
+ dat->yScroll = oldy + (desty - oldy) * (int)(nowTick - startTick) / dat->scrollTime;
if (dat->backgroundBmpUse & CLBF_SCROLL || dat->hBmpBackground == NULL)
ScrollWindowEx(hwnd, 0, previousy - dat->yScroll, NULL, NULL, NULL, NULL, SW_INVALIDATE);
else
diff --git a/src/modules/clist/clistevents.cpp b/src/modules/clist/clistevents.cpp
index 5f85903d1d..71a520b2ff 100644
--- a/src/modules/clist/clistevents.cpp
+++ b/src/modules/clist/clistevents.cpp
@@ -386,9 +386,9 @@ static int CListEventSettingsChanged(WPARAM wParam, LPARAM lParam)
DBCONTACTWRITESETTING *cws = (DBCONTACTWRITESETTING *) lParam;
if (hContact == NULL && cws && cws->szModule && cws->szSetting && strcmp(cws->szModule, "CList") == 0) {
if (strcmp(cws->szSetting, "DisableTrayFlash") == 0)
- disableTrayFlash = (int) cws->value.bVal;
+ disableTrayFlash = (int)cws->value.bVal;
else if (strcmp(cws->szSetting, "NoIconBlink") == 0)
- disableIconFlash = (int) cws->value.bVal;
+ disableIconFlash = (int)cws->value.bVal;
}
return 0;
}
diff --git a/src/modules/clist/clistmenus.cpp b/src/modules/clist/clistmenus.cpp
index 567fa0c1f2..4b54616adf 100644
--- a/src/modules/clist/clistmenus.cpp
+++ b/src/modules/clist/clistmenus.cpp
@@ -810,12 +810,12 @@ int fnGetProtoIndexByPos(PROTOCOLDESCRIPTOR ** proto, int protoCnt, int Pos)
if ( !DBGetContactSetting(NULL, "Protocols", buf, &dbv)) {
for (p=0; p < protoCnt; p++) {
if (lstrcmpA(proto[p]->szName, dbv.pszVal) == 0) {
- DBFreeVariant(&dbv);
+ db_free(&dbv);
return p;
}
}
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
return -1;
diff --git a/src/modules/clist/clistmod.cpp b/src/modules/clist/clistmod.cpp
index cb14eb0c42..fdbc75fe82 100644
--- a/src/modules/clist/clistmod.cpp
+++ b/src/modules/clist/clistmod.cpp
@@ -143,7 +143,7 @@ static int ProtocolAck(WPARAM, LPARAM lParam)
CallService(MS_CLUI_PROTOCOLSTATUSCHANGED, ack->lParam, (LPARAM) ack->szModule);
- if ((int) ack->hProcess < ID_STATUS_ONLINE && ack->lParam >= ID_STATUS_ONLINE) {
+ if ((int)ack->hProcess < ID_STATUS_ONLINE && ack->lParam >= ID_STATUS_ONLINE) {
DWORD caps = (DWORD)CallProtoServiceInt(NULL,ack->szModule, PS_GETCAPS, PFLAGNUM_1, 0);
if (caps & PF1_SERVERCLIST) {
HANDLE hContact = db_find_first();
diff --git a/src/modules/clist/clisttray.cpp b/src/modules/clist/clisttray.cpp
index ae9e9e7da0..351ca78a7b 100644
--- a/src/modules/clist/clisttray.cpp
+++ b/src/modules/clist/clisttray.cpp
@@ -65,7 +65,7 @@ static TCHAR* sttGetXStatus(const char* szProto)
if ( !DBGetContactSettingTString(NULL, szProto, dbTitle, &dbv)) {
if (dbv.ptszVal[0] != 0)
result = mir_tstrdup(dbv.ptszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
}
@@ -285,7 +285,7 @@ int fnTrayIconInit(HWND hwnd)
szProto = NULL;
cli.pfnTrayIconAdd(hwnd, NULL, szProto, szProto ? CallProtoServiceInt(NULL,szProto, PS_GETSTATUS, 0, 0) : CallService(MS_CLIST_GETSTATUSMODE, 0, 0));
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
else if (trayIconSetting == SETTING_TRAYICON_MULTI && (averageMode < 0 || db_get_b(NULL, "CList", "AlwaysMulti", SETTING_ALWAYSMULTI_DEFAULT)))
{
@@ -552,7 +552,7 @@ void fnTrayIconUpdateBase(const char *szChangedProto)
changed = cli.pfnTrayIconSetBaseInfo(cli.pfnGetIconFromStatusMode(NULL, szProto, szProto ?
CallProtoServiceInt(NULL,szProto, PS_GETSTATUS, 0, 0) :
CallService(MS_CLIST_GETSTATUSMODE, 0, 0)), szProto);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
break;
diff --git a/src/modules/clist/clui.cpp b/src/modules/clist/clui.cpp
index 15f6ab4e8e..58f3978b84 100644
--- a/src/modules/clist/clui.cpp
+++ b/src/modules/clist/clui.cpp
@@ -311,14 +311,14 @@ int LoadCLUIModule(void)
lstrcpyn(titleText, _T(MIRANDANAME), SIZEOF(titleText));
else {
lstrcpyn(titleText, dbv.ptszVal, SIZEOF(titleText));
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
RECT pos;
- pos.left = (int) db_get_dw(NULL, "CList", "x", 700);
- pos.top = (int) db_get_dw(NULL, "CList", "y", 221);
- pos.right = pos.left + (int) db_get_dw(NULL, "CList", "Width", 108);
- pos.bottom = pos.top + (int) db_get_dw(NULL, "CList", "Height", 310);
+ pos.left = (int)db_get_dw(NULL, "CList", "x", 700);
+ pos.top = (int)db_get_dw(NULL, "CList", "y", 221);
+ pos.right = pos.left + (int)db_get_dw(NULL, "CList", "Width", 108);
+ pos.bottom = pos.top + (int)db_get_dw(NULL, "CList", "Height", 310);
Utils_AssertInsideScreen(&pos);
@@ -639,7 +639,7 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
}
case WM_TIMER:
- if ((int) wParam == TM_AUTOALPHA) {
+ if ((int)wParam == TM_AUTOALPHA) {
int inwnd;
if (GetForegroundWindow() == hwnd) {
@@ -693,7 +693,7 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
if (thisTick >= startTick + 200)
break;
setLayeredWindowAttributes(hwnd, RGB(0, 0, 0),
- (BYTE) (sourceAlpha + (destAlpha - sourceAlpha) * (int) (thisTick - startTick) / 200), LWA_ALPHA);
+ (BYTE) (sourceAlpha + (destAlpha - sourceAlpha) * (int)(thisTick - startTick) / 200), LWA_ALPHA);
}
setLayeredWindowAttributes(hwnd, RGB(0, 0, 0), (BYTE) destAlpha, LWA_ALPHA);
}
diff --git a/src/modules/clist/contacts.cpp b/src/modules/clist/contacts.cpp
index 65ecf618e3..ec1717dfd5 100644
--- a/src/modules/clist/contacts.cpp
+++ b/src/modules/clist/contacts.cpp
@@ -62,7 +62,7 @@ static int ProcessDatabaseValueDefault(CONTACTINFO *ci, const char* setting)
ci->pszVal = dbv.ptszVal;
return 0;
}
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
if (DBGetContactSetting(ci->hContact, ci->szProto, setting, &dbv))
@@ -83,7 +83,7 @@ static int ProcessDatabaseValueDefault(CONTACTINFO *ci, const char* setting)
return 0;
}
- DBFreeVariant(&dbv);
+ db_free(&dbv);
return 1;
}
@@ -159,12 +159,12 @@ static INT_PTR GetContactInfo(WPARAM, LPARAM lParam) {
else ci->pszVal = (TCHAR*)mir_strdup(countries[i].szName);
ci->type = CNFT_ASCIIZ;
- DBFreeVariant(&dbv);
+ db_free(&dbv);
return 0;
}
}
else return ProcessDatabaseValueDefault(ci, (ci->dwFlag & 0x7F) == CNF_COUNTRY ? "Country" : "CompanyCountry");
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
break;
@@ -187,11 +187,11 @@ static INT_PTR GetContactInfo(WPARAM, LPARAM lParam) {
strcat(strcat(strcpy(buf, dbv.pszVal), " "), dbv2.pszVal);
ci->pszVal = (TCHAR*)buf;
}
- DBFreeVariant(&dbv);
- DBFreeVariant(&dbv2);
+ db_free(&dbv);
+ db_free(&dbv2);
return 0;
}
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
break;
@@ -305,11 +305,11 @@ static INT_PTR GetContactInfo(WPARAM, LPARAM lParam) {
ci->pszVal = (TCHAR*)buf;
}
- DBFreeVariant(&dbv);
- DBFreeVariant(&dbv2);
+ db_free(&dbv);
+ db_free(&dbv2);
return 0;
}
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
break;
@@ -510,7 +510,7 @@ int LoadContactsModule(void)
DBVARIANT dbv;
if ( !DBGetContactSetting(NULL, "Contact", "NameOrder", &dbv)) {
CopyMemory(nameOrder, dbv.pbVal, dbv.cpbVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
CreateServiceFunction(MS_CONTACT_GETCONTACTINFO, GetContactInfo);
diff --git a/src/modules/clist/genmenu.cpp b/src/modules/clist/genmenu.cpp
index df8903a58d..8f6944f837 100644
--- a/src/modules/clist/genmenu.cpp
+++ b/src/modules/clist/genmenu.cpp
@@ -932,7 +932,7 @@ HMENU BuildRecursiveMenu(HMENU hMenu, PMO_IntMenuItem pRootMenu, ListParam *para
if ( !DBGetContactSettingTString(NULL, MenuNameItems, DBString, &dbv)) {
if (_tcslen(dbv.ptszVal) > 0)
replaceStrT(pmi->CustomName, dbv.ptszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
mir_snprintf(DBString, SIZEOF(DBString), "%s_pos", menuItemName);
diff --git a/src/modules/clist/genmenuopt.cpp b/src/modules/clist/genmenuopt.cpp
index d3b0b157c3..e9e4bff881 100644
--- a/src/modules/clist/genmenuopt.cpp
+++ b/src/modules/clist/genmenuopt.cpp
@@ -265,7 +265,7 @@ static int BuildTree(HWND hwndDlg, int MenuObjectId, BOOL bReread)
if ( !DBGetContactSettingTString(NULL, MenuNameItems, buf, &dbv)) {
PD->name = mir_tstrdup(dbv.ptszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
else PD->name = mir_tstrdup(GetMenuItemText(p));
}
diff --git a/src/modules/clist/groups.cpp b/src/modules/clist/groups.cpp
index fb9ce4cc3b..e3a6424c48 100644
--- a/src/modules/clist/groups.cpp
+++ b/src/modules/clist/groups.cpp
@@ -38,7 +38,7 @@ static int CountGroups(void)
_itoa(i, str, 10);
if (DBGetContactSetting(NULL, "CListGroups", str, &dbv))
break;
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
return i;
}
@@ -56,10 +56,10 @@ static int GroupNameExists(const TCHAR *name, int skipGroup)
if (DBGetContactSettingTString(NULL, "CListGroups", idstr, &dbv))
break;
if ( !_tcscmp(dbv.ptszVal + 1, name)) {
- DBFreeVariant(&dbv);
+ db_free(&dbv);
return i+1;
}
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
return 0;
}
@@ -120,7 +120,7 @@ static INT_PTR GetGroupName2(WPARAM wParam, LPARAM lParam)
lstrcpynA(name, dbv.pszVal + 1, SIZEOF(name));
if ((DWORD *) lParam != NULL)
*(DWORD *) lParam = dbv.pszVal[0];
- DBFreeVariant(&dbv);
+ db_free(&dbv);
return (INT_PTR) name;
}
@@ -137,7 +137,7 @@ TCHAR* fnGetGroupName(int idx, DWORD* pdwFlags)
lstrcpyn(name, dbv.ptszVal + 1, SIZEOF(name));
if (pdwFlags != NULL)
*pdwFlags = dbv.ptszVal[0];
- DBFreeVariant(&dbv);
+ db_free(&dbv);
return name;
}
@@ -163,7 +163,7 @@ static INT_PTR DeleteGroup(WPARAM wParam, LPARAM)
if (DBGetContactSettingTString(NULL, "CListGroups", str, &dbv))
return 1;
lstrcpyn(name, dbv.ptszVal + 1, SIZEOF(name));
- DBFreeVariant(&dbv);
+ db_free(&dbv);
if (db_get_b(NULL, "CList", "ConfirmDelete", SETTING_CONFIRMDELETE_DEFAULT))
{
TCHAR szQuestion[256+100];
@@ -192,10 +192,10 @@ static INT_PTR DeleteGroup(WPARAM wParam, LPARAM)
if (_tcscmp(dbv.ptszVal, name))
{
- DBFreeVariant(&dbv);
+ db_free(&dbv);
continue;
}
- DBFreeVariant(&dbv);
+ db_free(&dbv);
if (szNewParent[0])
{
@@ -216,7 +216,7 @@ static INT_PTR DeleteGroup(WPARAM wParam, LPARAM)
break;
_itoa(i, str, 10);
DBWriteContactSettingStringUtf(NULL, "CListGroups", str, dbv.pszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
_itoa(i, str, 10);
DBDeleteContactSetting(NULL, "CListGroups", str);
@@ -237,7 +237,7 @@ static INT_PTR DeleteGroup(WPARAM wParam, LPARAM)
lstrcpyn(szNewName, dbv.ptszVal + len + 2, SIZEOF(szNewName));
cli.pfnRenameGroup(i + 1, szNewName);
}
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
SetCursor(LoadCursor(NULL, IDC_ARROW));
@@ -268,7 +268,7 @@ static int RenameGroupWithMove(int groupId, const TCHAR *szName, int move)
return 1;
str[0] = dbv.pszVal[0] & 0x7F;
lstrcpyn(oldName, dbv.ptszVal + 1, SIZEOF(oldName));
- DBFreeVariant(&dbv);
+ db_free(&dbv);
lstrcpyn(str + 1, szName, SIZEOF(str) - 1);
db_set_ts(NULL, "CListGroups", idstr, str);
@@ -300,7 +300,7 @@ static int RenameGroupWithMove(int groupId, const TCHAR *szName, int move)
mir_sntprintf(szNewName, SIZEOF(szNewName), _T("%s\\%s"), szName, dbv.ptszVal + len + 2);
RenameGroupWithMove(i, szNewName, 0); //luckily, child groups will never need reordering
}
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
@@ -323,7 +323,7 @@ static int RenameGroupWithMove(int groupId, const TCHAR *szName, int move)
MoveGroupBefore(groupId + 1, i + 2);
break;
}
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
}
@@ -360,7 +360,7 @@ static INT_PTR SetGroupExpandedState(WPARAM wParam, LPARAM lParam)
else
dbv.pszVal[0] = dbv.pszVal[0] & ~GROUPF_EXPANDED;
DBWriteContactSettingStringUtf(NULL, "CListGroups", idstr, dbv.pszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
return 0;
}
@@ -377,7 +377,7 @@ static INT_PTR SetGroupFlags(WPARAM wParam, LPARAM lParam)
oldval = dbv.pszVal[0];
newval = dbv.pszVal[0] = ((oldval & ~HIWORD(lParam)) | flags) & 0x7f;
DBWriteContactSettingStringUtf(NULL, "CListGroups", idstr, dbv.pszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
if ((oldval & GROUPF_HIDEOFFLINE) != (newval & GROUPF_HIDEOFFLINE))
cli.pfnLoadContactTree();
return 0;
@@ -423,7 +423,7 @@ static INT_PTR MoveGroupBefore(WPARAM wParam, LPARAM lParam)
}
_itoa(i, str, 10);
DBWriteContactSettingStringUtf(NULL, "CListGroups", str, dbv.pszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
else {
@@ -435,7 +435,7 @@ static INT_PTR MoveGroupBefore(WPARAM wParam, LPARAM lParam)
} //never happens
_itoa(i, str, 10);
DBWriteContactSettingStringUtf(NULL, "CListGroups", str, dbv.pszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
_itoa(shuffleTo, str, 10);
@@ -457,7 +457,7 @@ static INT_PTR BuildGroupMenu(WPARAM, LPARAM)
if (DBGetContactSettingStringUtf(NULL, "CListGroups", "0", &dbv))
return (INT_PTR) (HMENU) NULL;
- DBFreeVariant(&dbv);
+ db_free(&dbv);
hRootMenu = CreateMenu();
for (groupId = 0;; groupId++) {
_itoa(groupId, idstr, 10);
@@ -510,7 +510,7 @@ static INT_PTR BuildGroupMenu(WPARAM, LPARAM)
}
break;
}
- if ((int) mii.dwItemData - 1 > groupId)
+ if ((int)mii.dwItemData - 1 > groupId)
break;
}
if (compareResult) {
@@ -533,7 +533,7 @@ static INT_PTR BuildGroupMenu(WPARAM, LPARAM)
}
} while (pNextField);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
return (INT_PTR) hRootMenu;
}
@@ -553,7 +553,7 @@ int InitGroupServices(void)
dbv.pszVal[0] &= 0x7f;
DBWriteContactSettingStringUtf(NULL, "CListGroups", str, dbv.pszVal);
}
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
CreateServiceFunction(MS_CLIST_GROUPCREATE, CreateGroup);
diff --git a/src/modules/clist/keyboard.cpp b/src/modules/clist/keyboard.cpp
index 6da22a5fb7..37fe94b30c 100644
--- a/src/modules/clist/keyboard.cpp
+++ b/src/modules/clist/keyboard.cpp
@@ -35,7 +35,7 @@ INT_PTR hkSearch(WPARAM wParam, LPARAM lParam)
DBVARIANT dbv = {0};
if ( !DBGetContactSettingString(NULL, "CList", "SearchUrl", &dbv)) {
CallService(MS_UTILS_OPENURL, db_get_b(NULL, "CList", "HKSearchNewWnd", 0), (LPARAM)dbv.pszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
return 0;
}
diff --git a/src/modules/database/dbini.cpp b/src/modules/database/dbini.cpp
index 2d148f146c..f6731cc20d 100644
--- a/src/modules/database/dbini.cpp
+++ b/src/modules/database/dbini.cpp
@@ -337,7 +337,7 @@ static void ProcessIniFile(TCHAR* szIniPath, char *szSafeSections, char *szUnsaf
ConvertBackslashes(szValue+1, Langpack_GetDefaultCodePage());
case 's':
case 'S':
- DBWriteContactSettingString(NULL, szSection, szName, szValue+1);
+ db_set_s(NULL, szSection, szName, szValue+1);
break;
case 'g':
case 'G':
diff --git a/src/modules/extraicons/CallbackExtraIcon.cpp b/src/modules/extraicons/CallbackExtraIcon.cpp
index 703628e73d..8c07bfd327 100644
--- a/src/modules/extraicons/CallbackExtraIcon.cpp
+++ b/src/modules/extraicons/CallbackExtraIcon.cpp
@@ -60,12 +60,17 @@ void CallbackExtraIcon::applyIcon(HANDLE hContact)
ApplyIcon((WPARAM) hContact, 0);
}
-int CallbackExtraIcon::setIcon(int id, HANDLE hContact, void *icon)
+int CallbackExtraIcon::setIcon(int id, HANDLE hContact, HANDLE icon)
{
if (!isEnabled() || hContact == NULL || id != this->id)
return -1;
- return ClistSetExtraIcon(hContact, (HANDLE) icon);
+ return ClistSetExtraIcon(hContact, icon);
+}
+
+int CallbackExtraIcon::setIconByName(int id, HANDLE hContact, const char *icon)
+{
+ return -1;
}
void CallbackExtraIcon::storeIcon(HANDLE hContact, void *icon)
diff --git a/src/modules/extraicons/CallbackExtraIcon.h b/src/modules/extraicons/CallbackExtraIcon.h
index 547f81a477..b339ce53d3 100644
--- a/src/modules/extraicons/CallbackExtraIcon.h
+++ b/src/modules/extraicons/CallbackExtraIcon.h
@@ -34,7 +34,8 @@ public:
virtual void rebuildIcons();
virtual void applyIcon(HANDLE hContact);
- virtual int setIcon(int id, HANDLE hContact, void *icon);
+ virtual int setIcon(int id, HANDLE hContact, HANDLE icon);
+ virtual int setIconByName(int id, HANDLE hContact, const char* icon);
virtual void storeIcon(HANDLE hContact, void *icon);
private:
diff --git a/src/modules/extraicons/DefaultExtraIcons.cpp b/src/modules/extraicons/DefaultExtraIcons.cpp
index 539475b10a..5a7917a331 100644
--- a/src/modules/extraicons/DefaultExtraIcons.cpp
+++ b/src/modules/extraicons/DefaultExtraIcons.cpp
@@ -63,7 +63,7 @@ static void SetVisibility(HANDLE hContact, int apparentMode, BOOL clear)
return;
char *proto = (char*) CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM) hContact, 0);
- if (IsEmpty(proto))
+ if ( IsEmpty(proto))
return;
if (apparentMode <= 0)
@@ -102,7 +102,7 @@ static void SetGender(HANDLE hContact, int gender, BOOL clear)
return;
char *proto = (char*) CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM) hContact, 0);
- if (IsEmpty(proto))
+ if ( IsEmpty(proto))
return;
if (gender <= 0)
@@ -172,7 +172,7 @@ static void SetExtraIcons(HANDLE hContact)
return;
char *proto = (char*) CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM) hContact, 0);
- if (IsEmpty(proto))
+ if ( IsEmpty(proto))
return;
for (unsigned int i = 0; i < SIZEOF(infos); i++) {
@@ -189,7 +189,7 @@ static void SetExtraIcons(HANDLE hContact)
info.SetIcon(hContact, &info, dbv.pszVal);
show = true;
}
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
}
@@ -252,7 +252,7 @@ static int DefaultOnClick(WPARAM wParam, LPARAM lParam, LPARAM param)
return 0;
char *proto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM) hContact, 0);
- if (IsEmpty(proto))
+ if ( IsEmpty(proto))
return 0;
bool found = false;
@@ -267,7 +267,7 @@ static int DefaultOnClick(WPARAM wParam, LPARAM lParam, LPARAM param)
found = true;
}
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
@@ -347,7 +347,7 @@ static int ProtocolApplyIcon(WPARAM wParam, LPARAM lParam)
HANDLE hContact = (HANDLE)wParam;
char *proto = (char*) CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM) hContact, 0);
- if (IsEmpty(proto))
+ if ( IsEmpty(proto))
return 0;
ProtoInfo *pi = FindProto(proto);
diff --git a/src/modules/extraicons/ExtraIcon.h b/src/modules/extraicons/ExtraIcon.h
index 281e9e25eb..0fec56562c 100644
--- a/src/modules/extraicons/ExtraIcon.h
+++ b/src/modules/extraicons/ExtraIcon.h
@@ -30,18 +30,19 @@ public:
ExtraIcon(const char *name);
virtual ~ExtraIcon();
- virtual void rebuildIcons() =0;
+ virtual void rebuildIcons() = 0;
virtual void applyIcons();
- virtual void applyIcon(HANDLE hContact) =0;
- virtual void onClick(HANDLE hContact) =0;
+ virtual void applyIcon(HANDLE hContact) =0 ;
+ virtual void onClick(HANDLE hContact) = 0;
- virtual int setIcon(int id, HANDLE hContact, void *icon) =0;
- virtual void storeIcon(HANDLE hContact, void *icon) =0;
+ virtual int setIcon(int id, HANDLE hContact, HANDLE icon) = 0;
+ virtual int setIconByName(int id, HANDLE hContact, const char* icon) = 0;
+ virtual void storeIcon(HANDLE hContact, void *icon) = 0;
virtual const char *getName() const;
- virtual const TCHAR *getDescription() const =0;
- virtual const char *getDescIcon() const =0;
- virtual int getType() const =0;
+ virtual const TCHAR *getDescription() const = 0;
+ virtual const char *getDescIcon() const = 0;
+ virtual int getType() const = 0;
virtual int getSlot() const;
virtual void setSlot(int slot);
diff --git a/src/modules/extraicons/ExtraIconGroup.cpp b/src/modules/extraicons/ExtraIconGroup.cpp
index 5d26f8488c..0f9e162877 100644
--- a/src/modules/extraicons/ExtraIconGroup.cpp
+++ b/src/modules/extraicons/ExtraIconGroup.cpp
@@ -65,17 +65,15 @@ void ExtraIconGroup::applyIcon(HANDLE hContact)
insideApply = true;
unsigned int i;
- for (i = 0; i < items.size(); i++)
- {
+ for (i = 0; i < items.size(); i++) {
items[i]->applyIcon(hContact);
-
if (setValidExtraIcon)
break;
}
insideApply = false;
- DBWriteContactSettingDword(hContact, MODULE_NAME, name.c_str(), setValidExtraIcon ? items[i]->getID() : 0);
+ db_set_dw(hContact, MODULE_NAME, name.c_str(), setValidExtraIcon ? items[i]->getID() : 0);
}
int ExtraIconGroup::getPosition() const
@@ -96,7 +94,7 @@ void ExtraIconGroup::setSlot(int slot)
ExtraIcon * ExtraIconGroup::getCurrentItem(HANDLE hContact) const
{
- int id = (int) DBGetContactSettingDword(hContact, MODULE_NAME, name.c_str(), 0);
+ int id = (int)DBGetContactSettingDword(hContact, MODULE_NAME, name.c_str(), 0);
if (id < 1)
return NULL;
@@ -114,13 +112,25 @@ void ExtraIconGroup::onClick(HANDLE hContact)
extra->onClick(hContact);
}
-int ExtraIconGroup::setIcon(int id, HANDLE hContact, void *icon)
+int ExtraIconGroup::setIcon(int id, HANDLE hContact, HANDLE value)
{
- if (insideApply)
- {
+ return internalSetIcon(id, hContact, (void*)value, false);
+}
+
+int ExtraIconGroup::setIconByName(int id, HANDLE hContact, const char *value)
+{
+ return internalSetIcon(id, hContact, (void*)value, true);
+}
+
+int ExtraIconGroup::internalSetIcon(int id, HANDLE hContact, void *value, bool bByName)
+{
+ if (insideApply) {
for (unsigned int i = 0; i < items.size(); i++)
- if (items[i]->getID() == id)
- return items[i]->setIcon(id, hContact, icon);
+ if (items[i]->getID() == id) {
+ if (bByName)
+ return items[i]->setIconByName(id, hContact, (const char*)value);
+ return items[i]->setIcon(id, hContact, (HANDLE)value);
+ }
return -1;
}
@@ -128,8 +138,7 @@ int ExtraIconGroup::setIcon(int id, HANDLE hContact, void *icon)
ExtraIcon *current = getCurrentItem(hContact);
int currentPos = (int)items.size();
int storePos = (int)items.size();
- for (unsigned int i = 0; i < items.size(); i++)
- {
+ for (unsigned int i = 0; i < items.size(); i++) {
if (items[i]->getID() == id)
storePos = i;
@@ -140,9 +149,8 @@ int ExtraIconGroup::setIcon(int id, HANDLE hContact, void *icon)
if (storePos == items.size())
return -1;
- if (storePos > currentPos)
- {
- items[storePos]->storeIcon(hContact, icon);
+ if (storePos > currentPos) {
+ items[storePos]->storeIcon(hContact, value);
return 0;
}
@@ -150,25 +158,24 @@ int ExtraIconGroup::setIcon(int id, HANDLE hContact, void *icon)
setValidExtraIcon = false;
- int ret = items[storePos]->setIcon(id, hContact, icon);
+ int ret;
+ if (bByName)
+ ret = items[storePos]->setIconByName(id, hContact, (const char*)value);
+ else
+ ret = items[storePos]->setIcon(id, hContact, (HANDLE)value);
- if (storePos < currentPos)
- {
+ if (storePos < currentPos) {
if (setValidExtraIcon)
- DBWriteContactSettingDword(hContact, MODULE_NAME, name.c_str(), items[storePos]->getID());
+ db_set_dw(hContact, MODULE_NAME, name.c_str(), items[storePos]->getID());
}
- else if (storePos == currentPos)
- {
- if (!setValidExtraIcon)
- {
- DBWriteContactSettingDword(hContact, MODULE_NAME, name.c_str(), 0);
+ else if (storePos == currentPos) {
+ if (!setValidExtraIcon) {
+ db_set_dw(hContact, MODULE_NAME, name.c_str(), 0);
insideApply = true;
- for (++storePos; storePos < (int)items.size(); ++storePos)
- {
+ for (++storePos; storePos < (int)items.size(); ++storePos) {
items[storePos]->applyIcon(hContact);
-
if (setValidExtraIcon)
break;
}
@@ -176,7 +183,7 @@ int ExtraIconGroup::setIcon(int id, HANDLE hContact, void *icon)
insideApply = false;
if (setValidExtraIcon)
- DBWriteContactSettingDword(hContact, MODULE_NAME, name.c_str(), items[storePos]->getID());
+ db_set_dw(hContact, MODULE_NAME, name.c_str(), items[storePos]->getID());
}
}
diff --git a/src/modules/extraicons/ExtraIconGroup.h b/src/modules/extraicons/ExtraIconGroup.h
index eb2aec5561..bddc3bed5e 100644
--- a/src/modules/extraicons/ExtraIconGroup.h
+++ b/src/modules/extraicons/ExtraIconGroup.h
@@ -27,6 +27,7 @@ class BaseExtraIcon;
class ExtraIconGroup : public ExtraIcon
{
+ int internalSetIcon(int id, HANDLE hContact, HANDLE icon, bool bByName);
public:
ExtraIconGroup(const char *name);
virtual ~ExtraIconGroup();
@@ -37,7 +38,8 @@ public:
virtual void applyIcon(HANDLE hContact);
virtual void onClick(HANDLE hContact);
- virtual int setIcon(int id, HANDLE hContact, void *icon);
+ virtual int setIcon(int id, HANDLE hContact, HANDLE icon);
+ virtual int setIconByName(int id, HANDLE hContact, const char* icon);
virtual void storeIcon(HANDLE hContact, void *icon);
virtual const TCHAR *getDescription() const;
@@ -56,7 +58,7 @@ protected:
bool setValidExtraIcon;
bool insideApply;
- virtual ExtraIcon * getCurrentItem(HANDLE hContact) const;
+ virtual ExtraIcon *getCurrentItem(HANDLE hContact) const;
};
#endif // __EXTRAICONGROUP_H__
diff --git a/src/modules/extraicons/IcolibExtraIcon.cpp b/src/modules/extraicons/IcolibExtraIcon.cpp
index bfc273fd0b..53d627da9e 100644
--- a/src/modules/extraicons/IcolibExtraIcon.cpp
+++ b/src/modules/extraicons/IcolibExtraIcon.cpp
@@ -54,18 +54,50 @@ void IcolibExtraIcon::applyIcon(HANDLE hContact)
HANDLE hImage = INVALID_HANDLE_VALUE;
DBVARIANT dbv = { 0 };
- if (!DBGetContactSettingString(hContact, MODULE_NAME, name.c_str(), &dbv))
- {
+ if ( !DBGetContactSettingString(hContact, MODULE_NAME, name.c_str(), &dbv)) {
if (!IsEmpty(dbv.pszVal))
hImage = GetIcon(dbv.pszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
ClistSetExtraIcon(hContact, hImage);
}
-int IcolibExtraIcon::setIcon(int id, HANDLE hContact, void *icon)
+int IcolibExtraIcon::setIcon(int id, HANDLE hContact, HANDLE hIcoLib)
+{
+ if (hContact == NULL || id != this->id)
+ return -1;
+
+ if (hIcoLib == INVALID_HANDLE_VALUE)
+ hIcoLib = NULL;
+
+ if (isEnabled()) {
+ DBVARIANT dbv = { 0 };
+ if ( !DBGetContactSettingString(hContact, MODULE_NAME, name.c_str(), &dbv)) {
+ if (!IsEmpty(dbv.pszVal))
+ RemoveIcon(dbv.pszVal);
+
+ db_free(&dbv);
+ }
+ }
+
+ storeIcon(hContact, hIcoLib);
+
+ if (isEnabled()) {
+ HANDLE hImage;
+ if (hIcoLib == NULL)
+ hImage = INVALID_HANDLE_VALUE;
+ else
+ hImage = AddIcon(hIcoLib);
+
+ return ClistSetExtraIcon(hContact, hImage);
+ }
+
+ return 0;
+}
+
+int IcolibExtraIcon::setIconByName(int id, HANDLE hContact, const char *icon)
{
if (hContact == NULL || id != this->id)
return -1;
@@ -73,26 +105,23 @@ int IcolibExtraIcon::setIcon(int id, HANDLE hContact, void *icon)
if (icon == INVALID_HANDLE_VALUE)
icon = NULL;
- if (isEnabled())
- {
+ if (isEnabled()) {
DBVARIANT dbv = { 0 };
- if (!DBGetContactSettingString(hContact, MODULE_NAME, name.c_str(), &dbv))
- {
+ if ( !DBGetContactSettingString(hContact, MODULE_NAME, name.c_str(), &dbv)) {
if (!IsEmpty(dbv.pszVal))
RemoveIcon(dbv.pszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
- storeIcon(hContact, icon);
+ storeIcon(hContact, "");
- if (isEnabled())
- {
+ if (isEnabled()) {
const char *icolibName = (const char *) icon;
HANDLE hImage;
- if (IsEmpty(icolibName))
+ if ( IsEmpty(icolibName))
hImage = INVALID_HANDLE_VALUE;
else
hImage = AddIcon(icolibName);
@@ -109,8 +138,8 @@ void IcolibExtraIcon::storeIcon(HANDLE hContact, void *icon)
return;
const char *icolibName = (const char *) icon;
- if (IsEmpty(icolibName))
- icolibName = ""; // Delete don't work and I don't know why
+ if ( IsEmpty(icolibName))
+ icolibName = ""; // Delete doesn't work, and I don't know why
- DBWriteContactSettingString(hContact, MODULE_NAME, name.c_str(), icolibName);
+ db_set_s(hContact, MODULE_NAME, name.c_str(), icolibName);
}
diff --git a/src/modules/extraicons/IcolibExtraIcon.h b/src/modules/extraicons/IcolibExtraIcon.h
index 5f113e7251..beb24fbdc3 100644
--- a/src/modules/extraicons/IcolibExtraIcon.h
+++ b/src/modules/extraicons/IcolibExtraIcon.h
@@ -25,8 +25,7 @@
class IcolibExtraIcon : public BaseExtraIcon
{
public:
- IcolibExtraIcon(int id, const char *name, const TCHAR *description, const char *descIcon, MIRANDAHOOKPARAM OnClick,
- LPARAM param);
+ IcolibExtraIcon(int id, const char *name, const TCHAR *description, const char *descIcon, MIRANDAHOOKPARAM OnClick, LPARAM param);
virtual ~IcolibExtraIcon();
virtual int getType() const;
@@ -34,7 +33,8 @@ public:
virtual void rebuildIcons();
virtual void applyIcon(HANDLE hContact);
- virtual int setIcon(int id, HANDLE hContact, void *icon);
+ virtual int setIcon(int id, HANDLE hContact, HANDLE icon);
+ virtual int setIconByName(int id, HANDLE hContact, const char* icon);
virtual void storeIcon(HANDLE hContact, void *icon);
};
diff --git a/src/modules/extraicons/extraicons.cpp b/src/modules/extraicons/extraicons.cpp
index 45a81235e6..9f119d5706 100644
--- a/src/modules/extraicons/extraicons.cpp
+++ b/src/modules/extraicons/extraicons.cpp
@@ -102,7 +102,7 @@ int Clist_SetExtraIcon(HANDLE hContact, int slot, HANDLE hImage)
ExtraIcon* GetExtraIcon(HANDLE id)
{
- unsigned int i = (int) id;
+ unsigned int i = (int)id;
if (i < 1 || i > extraIconsByHandle.size())
return NULL;
@@ -157,7 +157,7 @@ static void LoadGroups(vector<ExtraIconGroup *> &groups)
group->setSlot(extra->getSlot());
}
}
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
@@ -257,7 +257,7 @@ int ClistExtraClick(WPARAM wParam, LPARAM lParam)
if (hContact == NULL)
return 0;
- int clistSlot = (int) lParam;
+ int clistSlot = (int)lParam;
for (unsigned int i = 0; i < extraIconsBySlot.size(); i++) {
ExtraIcon *extra = extraIconsBySlot[i];
@@ -349,11 +349,11 @@ INT_PTR ExtraIcon_Register(WPARAM wParam, LPARAM lParam)
return 0;
EXTRAICON_INFO *ei = (EXTRAICON_INFO *) wParam;
- if (ei->cbSize < (int) sizeof(EXTRAICON_INFO))
+ if (ei->cbSize < (int)sizeof(EXTRAICON_INFO))
return 0;
if (ei->type != EXTRAICON_TYPE_CALLBACK && ei->type != EXTRAICON_TYPE_ICOLIB)
return 0;
- if (IsEmpty(ei->name) || IsEmpty(ei->description))
+ if ( IsEmpty(ei->name) || IsEmpty(ei->description))
return 0;
if (ei->type == EXTRAICON_TYPE_CALLBACK && (ei->ApplyIcon == NULL || ei->RebuildIcons == NULL))
return 0;
@@ -457,17 +457,31 @@ INT_PTR ExtraIcon_SetIcon(WPARAM wParam, LPARAM lParam)
if (wParam == 0)
return -1;
- EXTRAICON *ei = (EXTRAICON *) wParam;
- if (ei->cbSize < (int) sizeof(EXTRAICON))
+ EXTRAICON *ei = (EXTRAICON*)wParam;
+ if (ei->cbSize < (int)sizeof(EXTRAICON) || ei->hExtraIcon == NULL || ei->hContact == NULL)
return -1;
- if (ei->hExtraIcon == NULL || ei->hContact == NULL)
+
+ ExtraIcon *extra = GetExtraIcon(ei->hExtraIcon);
+ if (extra == NULL)
+ return -1;
+
+ return extra->setIcon((int)ei->hExtraIcon, ei->hContact, ei->hImage);
+}
+
+INT_PTR ExtraIcon_SetIconByName(WPARAM wParam, LPARAM lParam)
+{
+ if (wParam == 0)
+ return -1;
+
+ EXTRAICON *ei = (EXTRAICON*)wParam;
+ if (ei->cbSize < (int)sizeof(EXTRAICON) || ei->hExtraIcon == NULL || ei->hContact == NULL)
return -1;
ExtraIcon *extra = GetExtraIcon(ei->hExtraIcon);
if (extra == NULL)
return -1;
- return extra->setIcon((int) ei->hExtraIcon, ei->hContact, ei->hImage);
+ return extra->setIconByName((int)ei->hExtraIcon, ei->hContact, ei->icoName);
}
static INT_PTR svcExtraIcon_Add(WPARAM wParam, LPARAM lParam)
@@ -486,6 +500,7 @@ void LoadExtraIconsModule()
// Services
CreateServiceFunction(MS_EXTRAICON_REGISTER, &ExtraIcon_Register);
CreateServiceFunction(MS_EXTRAICON_SET_ICON, &ExtraIcon_SetIcon);
+ CreateServiceFunction(MS_EXTRAICON_SET_ICON_BY_NAME, &ExtraIcon_SetIconByName);
CreateServiceFunction(MS_CLIST_EXTRA_ADD_ICON, &svcExtraIcon_Add);
diff --git a/src/modules/extraicons/options_ei.cpp b/src/modules/extraicons/options_ei.cpp
index b04ec3fec3..2d4e9fd7df 100644
--- a/src/modules/extraicons/options_ei.cpp
+++ b/src/modules/extraicons/options_ei.cpp
@@ -419,7 +419,7 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP
TranslateDialogDefault(hwndDlg);
{
int numSlots = GetNumberOfSlots();
- if (numSlots < (int) registeredExtraIcons.size()) {
+ if (numSlots < (int)registeredExtraIcons.size()) {
TCHAR txt[512];
mir_sntprintf(txt, SIZEOF(txt), TranslateT("* only the first %d icons will be shown"), numSlots);
@@ -573,7 +573,7 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP
BaseExtraIcon *extra = group->items[j];
mir_snprintf(setting, SIZEOF(setting), "%d_%d", i, j);
- DBWriteContactSettingString(NULL, MODULE_NAME "Groups", setting, extra->getName());
+ db_set_s(NULL, MODULE_NAME "Groups", setting, extra->getName());
}
}
diff --git a/src/modules/extraicons/usedIcons.cpp b/src/modules/extraicons/usedIcons.cpp
index 1c42104490..e810dd1878 100644
--- a/src/modules/extraicons/usedIcons.cpp
+++ b/src/modules/extraicons/usedIcons.cpp
@@ -25,41 +25,69 @@ struct Icon
{
string name;
int refCount;
- HANDLE hImage;
+ HANDLE hIcoLib, hImage;
Icon(const char *icolibName) :
- name(icolibName), refCount(0), hImage(INVALID_HANDLE_VALUE)
+ name(icolibName), hIcoLib(0), refCount(0), hImage(INVALID_HANDLE_VALUE)
+ {
+ }
+
+ Icon(HANDLE _hIcolib) :
+ name(""), hIcoLib(_hIcolib), refCount(0), hImage(INVALID_HANDLE_VALUE)
{
}
};
static vector<Icon> usedIcons;
-static Icon * FindIcon(const char *icolibName)
+static Icon* FindIcon(const char *icolibName)
{
Icon *icon = NULL;
- for (unsigned int i = 0; i < usedIcons.size(); i++)
- {
+ for (unsigned int i = 0; i < usedIcons.size(); i++) {
Icon *tmp = &usedIcons[i];
- if (tmp->name != icolibName)
- continue;
-
- icon = tmp;
- break;
+ if (tmp->name == icolibName) {
+ icon = tmp;
+ break;
+ }
}
- if (icon == NULL)
- {
- usedIcons.push_back(Icon(icolibName));
+ if (icon == NULL) {
+ usedIcons.push_back( Icon(icolibName));
icon = &usedIcons[usedIcons.size() - 1];
}
- if (icon->hImage == INVALID_HANDLE_VALUE)
- {
+ if (icon->hImage == INVALID_HANDLE_VALUE) {
HICON hIcon = Skin_GetIcon(icon->name.c_str());
- if (hIcon != NULL)
- {
+ if (hIcon != NULL) {
+ icon->hImage = ExtraIcon_Add(hIcon);
+ Skin_ReleaseIcon(hIcon);
+ }
+ }
+
+ return icon;
+}
+
+static Icon* FindIcon(HANDLE hIcolib)
+{
+ Icon *icon = NULL;
+
+ for (unsigned int i = 0; i < usedIcons.size(); i++) {
+ Icon *tmp = &usedIcons[i];
+ if (tmp->hImage == hIcolib) {
+ icon = tmp;
+ break;
+ }
+ }
+
+ if (icon == NULL) {
+ usedIcons.push_back( Icon(hIcolib));
+ icon = &usedIcons[usedIcons.size() - 1];
+ }
+
+ if (icon->hImage == INVALID_HANDLE_VALUE) {
+ HICON hIcon = Skin_GetIconByHandle(icon->hIcoLib);
+ if (hIcon != NULL) {
icon->hImage = ExtraIcon_Add(hIcon);
Skin_ReleaseIcon(hIcon);
}
@@ -80,6 +108,13 @@ HANDLE AddIcon(const char *icolibName)
return icon->hImage;
}
+HANDLE AddIcon(HANDLE hIcolib)
+{
+ Icon *icon = FindIcon(hIcolib);
+ icon->refCount++;
+ return icon->hImage;
+}
+
void RemoveIcon(const char *icolibName)
{
for (unsigned int i = 0; i < usedIcons.size(); i++)
diff --git a/src/modules/extraicons/usedIcons.h b/src/modules/extraicons/usedIcons.h
index ef3a0f0200..b8aeee226c 100644
--- a/src/modules/extraicons/usedIcons.h
+++ b/src/modules/extraicons/usedIcons.h
@@ -20,9 +20,12 @@
#ifndef __USEDICONS_H__
#define __USEDICONS_H__
-HANDLE GetIcon(const char *icolibName);
-HANDLE AddIcon(const char *icolibName);
-void RemoveIcon(const char *icolibName);
+HANDLE GetIcon(LPCSTR icolibName);
+
+HANDLE AddIcon(LPCSTR icolibName);
+HANDLE AddIcon(HANDLE hIcolib);
+
+void RemoveIcon(LPCSTR icolibName);
void ResetIcons();
diff --git a/src/modules/findadd/findadd.cpp b/src/modules/findadd/findadd.cpp
index c5306516ab..a693cc4c45 100644
--- a/src/modules/findadd/findadd.cpp
+++ b/src/modules/findadd/findadd.cpp
@@ -391,7 +391,7 @@ static INT_PTR CALLBACK DlgProcFindAdd(HWND hwndDlg, UINT msg, WPARAM wParam, LP
if ((rect.right-rect.left)<cbwidth)
SendDlgItemMessage(hwndDlg, IDC_PROTOLIST, CB_SETDROPPEDWIDTH, cbwidth, 0);
SendDlgItemMessage(hwndDlg, IDC_PROTOLIST, CB_SETCURSEL, index, 0);
- DBFreeVariant(&dbv); /* free string szProto was fetched with */
+ db_free(&dbv); /* free string szProto was fetched with */
}
SendMessage(hwndDlg, M_SETGROUPVISIBILITIES, 0, 0);
Utils_RestoreWindowPosition(hwndDlg, NULL, "FindAdd", "");
diff --git a/src/modules/fonts/FontOptions.cpp b/src/modules/fonts/FontOptions.cpp
index 46cf322731..21b786db0b 100644
--- a/src/modules/fonts/FontOptions.cpp
+++ b/src/modules/fonts/FontOptions.cpp
@@ -535,7 +535,7 @@ static void sttSaveFontData(HWND hwndDlg, FontInternal &F)
if (db_set_ts(NULL, F.dbSettingsGroup, str, F.value.szFace)) {
char buff[1024];
WideCharToMultiByte(code_page, 0, F.value.szFace, -1, buff, 1024, 0, 0);
- DBWriteContactSettingString(NULL, F.dbSettingsGroup, str, buff);
+ db_set_s(NULL, F.dbSettingsGroup, str, buff);
}
mir_snprintf(str, SIZEOF(str), "%sSize", F.prefix);
diff --git a/src/modules/fonts/services.cpp b/src/modules/fonts/services.cpp
index 7ec7d0397b..74c8ba9860 100644
--- a/src/modules/fonts/services.cpp
+++ b/src/modules/fonts/services.cpp
@@ -146,7 +146,7 @@ int GetFontSettingFromDB(char *settings_group, char *prefix, LOGFONT* lf, COLORR
if ( !DBGetContactSettingTString(NULL, settings_group, idstr, &dbv)) {
_tcscpy(lf->lfFaceName, dbv.ptszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
else retval = 1;
diff --git a/src/modules/icolib/skin2icons.cpp b/src/modules/icolib/skin2icons.cpp
index 0fd774a087..eec1dff500 100644
--- a/src/modules/icolib/skin2icons.cpp
+++ b/src/modules/icolib/skin2icons.cpp
@@ -674,7 +674,7 @@ HICON IconItem_GetIcon(IconItem* item, bool big)
int cx = item->cx ? item->cx : GetSystemMetrics(big ? SM_CXICON : SM_CXSMICON);
int cy = item->cy ? item->cy : GetSystemMetrics(big ? SM_CYICON : SM_CYSMICON);
source = GetIconSourceItemFromPath(tszFullPath, cx, cy);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
if (source)
diff --git a/src/modules/json/JSONNode.h b/src/modules/json/JSONNode.h
index 3552f9f73c..0c4f19d08d 100644
--- a/src/modules/json/JSONNode.h
+++ b/src/modules/json/JSONNode.h
@@ -61,7 +61,7 @@
#define DECLARE_FOR_ALL_TYPES_CONST(foo)\
foo(char) const; foo(unsigned char) const;\
foo(short) const; foo(unsigned short) const;\
- foo(int) const; foo(unsigned int) const;\
+ foo(int)const; foo(unsigned int) const;\
foo(long) const; foo(unsigned long) const;\
foo(float) const; foo(double) const;\
foo(bool) const;\
@@ -72,7 +72,7 @@
#define IMPLEMENT_FOR_ALL_NUMBERS(foo)\
foo(char) foo(unsigned char)\
foo(short) foo(unsigned short)\
- foo(int) foo(unsigned int)\
+ foo(int)foo(unsigned int)\
foo(long) foo(unsigned long)\
foo(float) foo(double)
diff --git a/src/modules/langpack/lpservices.cpp b/src/modules/langpack/lpservices.cpp
index 01a1f9cf07..a761f50dec 100644
--- a/src/modules/langpack/lpservices.cpp
+++ b/src/modules/langpack/lpservices.cpp
@@ -95,7 +95,7 @@ static INT_PTR srvGetPluginLangpack(WPARAM wParam, LPARAM lParam)
/////////////////////////////////////////////////////////////////////////////////////////
-MIR_CORE_DLL(int) LoadLangPackModule(void);
+MIR_CORE_DLL(int)LoadLangPackModule(void);
int LoadLangpackModule(void)
{
diff --git a/src/modules/netlib/netlib.cpp b/src/modules/netlib/netlib.cpp
index 2c799ffa2e..b0d228ca09 100644
--- a/src/modules/netlib/netlib.cpp
+++ b/src/modules/netlib/netlib.cpp
@@ -121,7 +121,7 @@ static char *GetNetlibUserSettingString(const char *szUserModule, const char *sz
char *szRet;
if (decode) CallService(MS_DB_CRYPT_DECODESTRING, strlen(dbv.pszVal) + 1, (LPARAM)dbv.pszVal);
szRet = mir_strdup(dbv.pszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
if (szRet == NULL) SetLastError(ERROR_OUTOFMEMORY);
return szRet;
}
diff --git a/src/modules/netlib/netliblog.cpp b/src/modules/netlib/netliblog.cpp
index 01f5855e10..05b4e899dd 100644
--- a/src/modules/netlib/netliblog.cpp
+++ b/src/modules/netlib/netliblog.cpp
@@ -92,7 +92,7 @@ static INT_PTR CALLBACK LogOptionsDlgProc(HWND hwndDlg, UINT message, WPARAM wPa
DBVARIANT dbv;
if ( !DBGetContactSettingString(NULL, "Netlib", "RunAtStart", &dbv)) {
SetDlgItemTextA(hwndDlg, IDC_RUNATSTART, dbv.pszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
logOptions.save = 0;
@@ -575,7 +575,7 @@ void NetlibLogInit(void)
logOptions.szFile = mir_tstrdup(path);
mir_free(pszNewPath);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
else {
logOptions.szUserFile = mir_tstrdup(_T("%miranda_logpath%\\netlog.txt"));
@@ -598,7 +598,7 @@ void NetlibLogInit(void)
si.cb = sizeof(si);
if (dbv.ptszVal[0])
CreateProcess(NULL, dbv.ptszVal, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
diff --git a/src/modules/netlib/netlibopts.cpp b/src/modules/netlib/netlibopts.cpp
index 1131980bc5..1a28e62df4 100644
--- a/src/modules/netlib/netlibopts.cpp
+++ b/src/modules/netlib/netlibopts.cpp
@@ -199,21 +199,21 @@ static void WriteSettingsStructToDb(const char *szSettingsModule, NETLIBUSERSETT
db_set_b(NULL, szSettingsModule, "NLValidateSSL", (BYTE)settings->validateSSL);
db_set_b(NULL, szSettingsModule, "NLUseProxy", (BYTE)settings->useProxy);
db_set_b(NULL, szSettingsModule, "NLProxyType", (BYTE)settings->proxyType);
- DBWriteContactSettingString(NULL, szSettingsModule, "NLProxyServer", settings->szProxyServer?settings->szProxyServer:"");
+ db_set_s(NULL, szSettingsModule, "NLProxyServer", settings->szProxyServer?settings->szProxyServer:"");
DBWriteContactSettingWord(NULL, szSettingsModule, "NLProxyPort", (WORD)settings->wProxyPort);
db_set_b(NULL, szSettingsModule, "NLUseProxyAuth", (BYTE)settings->useProxyAuth);
- DBWriteContactSettingString(NULL, szSettingsModule, "NLProxyAuthUser", settings->szProxyAuthUser?settings->szProxyAuthUser:"");
+ db_set_s(NULL, szSettingsModule, "NLProxyAuthUser", settings->szProxyAuthUser?settings->szProxyAuthUser:"");
lstrcpynA(szEncodedPassword, settings->szProxyAuthPassword?settings->szProxyAuthPassword:"", SIZEOF(szEncodedPassword));
CallService(MS_DB_CRYPT_ENCODESTRING, SIZEOF(szEncodedPassword), (LPARAM)szEncodedPassword);
- DBWriteContactSettingString(NULL, szSettingsModule, "NLProxyAuthPassword", szEncodedPassword);
+ db_set_s(NULL, szSettingsModule, "NLProxyAuthPassword", szEncodedPassword);
db_set_b(NULL, szSettingsModule, "NLDnsThroughProxy", (BYTE)settings->dnsThroughProxy);
db_set_b(NULL, szSettingsModule, "NLSpecifyOutgoingPorts", (BYTE)settings->specifyOutgoingPorts);
- DBWriteContactSettingString(NULL, szSettingsModule, "NLOutgoingPorts", settings->szOutgoingPorts?settings->szOutgoingPorts:"");
+ db_set_s(NULL, szSettingsModule, "NLOutgoingPorts", settings->szOutgoingPorts?settings->szOutgoingPorts:"");
}
if (flags & NUF_INCOMING) {
db_set_b(NULL, szSettingsModule, "NLEnableUPnP", (BYTE)settings->enableUPnP);
db_set_b(NULL, szSettingsModule, "NLSpecifyIncomingPorts", (BYTE)settings->specifyIncomingPorts);
- DBWriteContactSettingString(NULL, szSettingsModule, "NLIncomingPorts", settings->szIncomingPorts?settings->szIncomingPorts:"");
+ db_set_s(NULL, szSettingsModule, "NLIncomingPorts", settings->szIncomingPorts?settings->szIncomingPorts:"");
}
}
diff --git a/src/modules/options/options.cpp b/src/modules/options/options.cpp
index 64879ee5c8..4d8d71c438 100644
--- a/src/modules/options/options.cpp
+++ b/src/modules/options/options.cpp
@@ -718,13 +718,13 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hdlg, UINT message, WPARAM wParam, L
if (ood->pszPage == NULL) {
if ( !DBGetContactSettingTString(NULL, "Options", "LastPage", &dbv)) {
lastPage = mir_tstrdup(dbv.ptszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
if (ood->pszGroup == NULL) {
if ( !DBGetContactSettingTString(NULL, "Options", "LastGroup", &dbv)) {
lastGroup = mir_tstrdup(dbv.ptszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
else lastGroup = mir_a2t(ood->pszGroup);
@@ -737,7 +737,7 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hdlg, UINT message, WPARAM wParam, L
if (ood->pszTab == NULL) {
if ( !DBGetContactSettingTString(NULL, "Options", "LastTab", &dbv)) {
lastTab = mir_tstrdup(dbv.ptszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
else lastTab = mir_a2t(ood->pszTab);
diff --git a/src/modules/protocols/protoaccs.cpp b/src/modules/protocols/protoaccs.cpp
index fff20b30c2..b643a960e8 100644
--- a/src/modules/protocols/protoaccs.cpp
+++ b/src/modules/protocols/protoaccs.cpp
@@ -54,7 +54,7 @@ static int EnumDbModules(const char *szModuleName, DWORD ofsModuleName, LPARAM l
pa->iOrder = accounts.getCount();
accounts.insert(pa);
}
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
return 0;
}
@@ -73,12 +73,12 @@ void LoadDbAccounts(void)
PROTOACCOUNT* pa = (PROTOACCOUNT*)mir_calloc(sizeof(PROTOACCOUNT));
if (pa == NULL) {
- DBFreeVariant(&dbv);
+ db_free(&dbv);
continue;
}
pa->cbSize = sizeof(*pa);
pa->szModuleName = mir_strdup(dbv.pszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
_itoa(OFFSET_VISIBLE+i, buf, 10);
pa->bIsVisible = db_get_dw(NULL, "Protocols", buf, 1);
@@ -87,11 +87,11 @@ void LoadDbAccounts(void)
pa->iOrder = db_get_dw(NULL, "Protocols", buf, 1);
if (ver >= 4) {
- DBFreeVariant(&dbv);
+ db_free(&dbv);
_itoa(OFFSET_NAME+i, buf, 10);
if ( !DBGetContactSettingTString(NULL, "Protocols", buf, &dbv)) {
pa->tszAccountName = mir_tstrdup(dbv.ptszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
_itoa(OFFSET_ENABLED+i, buf, 10);
@@ -99,14 +99,14 @@ void LoadDbAccounts(void)
if ( !DBGetContactSettingString(NULL, pa->szModuleName, "AM_BaseProto", &dbv)) {
pa->szProtoName = mir_strdup(dbv.pszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
else pa->bIsEnabled = TRUE;
if ( !pa->szProtoName) {
pa->szProtoName = mir_strdup(pa->szModuleName);
- DBWriteContactSettingString(NULL, pa->szModuleName, "AM_BaseProto", pa->szProtoName);
+ db_set_s(NULL, pa->szModuleName, "AM_BaseProto", pa->szProtoName);
}
if ( !pa->tszAccountName)
@@ -173,7 +173,7 @@ void WriteDbAccounts()
char buf[ 20 ];
_itoa(i, buf, 10);
- DBWriteContactSettingString(NULL, "Protocols", buf, pa->szModuleName);
+ db_set_s(NULL, "Protocols", buf, pa->szModuleName);
_itoa(OFFSET_PROTOPOS+i, buf, 10);
db_set_dw(NULL, "Protocols", buf, pa->iOrder);
diff --git a/src/modules/protocols/protoopts.cpp b/src/modules/protocols/protoopts.cpp
index 52bd819123..9aa7436b4d 100644
--- a/src/modules/protocols/protoopts.cpp
+++ b/src/modules/protocols/protoopts.cpp
@@ -175,7 +175,7 @@ static INT_PTR CALLBACK AccFormDlgProc(HWND hwndDlg, UINT message, WPARAM wParam
mir_snprintf(buf, SIZEOF(buf), "%s_%d", pa->szProtoName, count++);
if (DBGetContactSettingString(NULL, buf, "AM_BaseProto", &dbv))
break;
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
pa->szModuleName = mir_strdup(buf);
@@ -185,7 +185,7 @@ static INT_PTR CALLBACK AccFormDlgProc(HWND hwndDlg, UINT message, WPARAM wParam
pa->tszAccountName = mir_a2t(buf);
}
- DBWriteContactSettingString(NULL, pa->szModuleName, "AM_BaseProto", pa->szProtoName);
+ db_set_s(NULL, pa->szModuleName, "AM_BaseProto", pa->szProtoName);
accounts.insert(pa);
if ( ActivateAccount(pa)) {
diff --git a/src/modules/skin/skinicons.cpp b/src/modules/skin/skinicons.cpp
index 37b01b0e40..b4e69eb602 100644
--- a/src/modules/skin/skinicons.cpp
+++ b/src/modules/skin/skinicons.cpp
@@ -369,7 +369,7 @@ static void convertOneProtocol(char *moduleName, char *iconName)
_itoa(i, pi, 10);
db_set_ts(NULL, "SkinIcons", iconName, dbv.ptszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
DBDeleteContactSetting(NULL, "Icons", moduleName);
} } }
@@ -414,7 +414,7 @@ int LoadSkinIcons(void)
mir_snprintf(iconName, SIZEOF(iconName), "%s%d", mainIconsFmt, i);
db_set_ts(NULL, "SkinIcons", iconName, dbv.ptszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
DBDeleteContactSetting(NULL, "Icons", moduleName);
}
@@ -435,7 +435,7 @@ int LoadSkinIcons(void)
mir_snprintf(iconName, SIZEOF(iconName), "%s" TCHAR_STR_PARAM, statusIconsFmt, dbv.ptszVal);
convertOneProtocol(moduleName, iconName);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
moduleName[0] = 0;
strcpy(iconName, "core_status_" GLOBAL_PROTO_NAME);
diff --git a/src/modules/skin/sounds.cpp b/src/modules/skin/sounds.cpp
index 42e51898ed..ebf2be6f80 100644
--- a/src/modules/skin/sounds.cpp
+++ b/src/modules/skin/sounds.cpp
@@ -96,7 +96,7 @@ static INT_PTR ServiceSkinAddNewSound(WPARAM wParam, LPARAM lParam)
if (DBGetContactSettingString(NULL, "SkinSounds", item->name, &dbv))
db_set_ts(NULL, "SkinSounds", item->name, ptszDefaultFile);
else
- DBFreeVariant(&dbv);
+ db_free(&dbv);
mir_free(ptszDefaultFile);
}
@@ -129,7 +129,7 @@ static INT_PTR ServiceSkinPlaySound(WPARAM, LPARAM lParam)
TCHAR szFull[MAX_PATH];
PathToAbsoluteT(dbv.ptszVal, szFull, NULL);
NotifyEventHooks(hPlayEvent, 0, (LPARAM)szFull);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
return 1;
@@ -253,7 +253,7 @@ INT_PTR CALLBACK DlgProcSoundOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
TCHAR szPathFull[MAX_PATH];
PathToAbsoluteT(dbv.ptszVal, szPathFull, NULL);
NotifyEventHooks(hPlayEvent, 1, (LPARAM)szPathFull);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
break;
@@ -282,7 +282,7 @@ INT_PTR CALLBACK DlgProcSoundOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
DBVARIANT dbv;
if (DBGetContactSettingTString(NULL, "SkinSounds", snd.name, &dbv) == 0) {
PathToAbsoluteT(dbv.ptszVal, strdir, NULL);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
} } }
mir_sntprintf(strFull, SIZEOF(strFull), _T("%s"), snd.ptszTempFile ? snd.ptszTempFile : _T(""));
@@ -381,7 +381,7 @@ INT_PTR CALLBACK DlgProcSoundOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
DBVARIANT dbv;
if ( !DBGetContactSettingTString(NULL, "SkinSounds", arSounds[tvi.lParam].name, &dbv)) {
SetDlgItemText(hwndDlg, IDC_LOCATION, dbv.ptszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
else SetDlgItemText(hwndDlg, IDC_LOCATION, TranslateT("<not specified>"));
}
diff --git a/src/modules/utils/openurl.cpp b/src/modules/utils/openurl.cpp
index a50ee22e7e..ebf462cca4 100644
--- a/src/modules/utils/openurl.cpp
+++ b/src/modules/utils/openurl.cpp
@@ -57,7 +57,7 @@ static void OpenURLThread(void *arg)
DBVARIANT dbv;
if (!DBGetContactSettingTString(NULL, "Miranda", "OpenUrlBrowser", &dbv)) {
ShellExecute(NULL, _T("open"), dbv.ptszVal, szResult, NULL, (hUrlInfo->newWindow) ? SW_NORMAL : SW_SHOWDEFAULT);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
else ShellExecute(NULL, _T("open"), szResult, NULL, NULL, (hUrlInfo->newWindow) ? SW_NORMAL : SW_SHOWDEFAULT);
diff --git a/src/modules/utils/path.cpp b/src/modules/utils/path.cpp
index 9d2f543e4a..24e30fcf4a 100644
--- a/src/modules/utils/path.cpp
+++ b/src/modules/utils/path.cpp
@@ -71,7 +71,7 @@ TCHAR *GetContactID(HANDLE hContact)
DBVARIANT dbv;
if ( !DBGetContactSettingTString(hContact, szProto, "ChatRoomID", &dbv)) {
theValue = (TCHAR *)mir_tstrdup(dbv.ptszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
return theValue;
} }
else {
diff --git a/src/modules/utils/timezones.cpp b/src/modules/utils/timezones.cpp
index 2f7153442b..a230fa7083 100644
--- a/src/modules/utils/timezones.cpp
+++ b/src/modules/utils/timezones.cpp
@@ -190,7 +190,7 @@ static HANDLE timeapiGetInfoByContact(HANDLE hContact, DWORD dwFlags)
if ( !DBGetContactSettingTString(hContact, "UserInfo", "TzName", &dbv))
{
HANDLE res = timeapiGetInfoByName(dbv.ptszVal, dwFlags);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
if (res) return res;
}
@@ -201,7 +201,7 @@ static HANDLE timeapiGetInfoByContact(HANDLE hContact, DWORD dwFlags)
if ( !DBGetContactSettingTString(hContact, szProto, "TzName", &dbv))
{
HANDLE res = timeapiGetInfoByName(dbv.ptszVal, dwFlags);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
if (res) return res;
}
timezone = (signed char)db_get_b(hContact, szProto, "Timezone", -1);
@@ -390,7 +390,7 @@ static int timeapiSelectListItem(HANDLE hContact, HWND hWnd, DWORD dwFlags)
break;
}
}
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}