summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/clist/Docking.cpp18
-rw-r--r--src/modules/clist/clc.cpp6
-rw-r--r--src/modules/clist/clcitems.cpp8
-rw-r--r--src/modules/clist/clcmsgs.cpp2
-rw-r--r--src/modules/clist/clcutils.cpp42
-rw-r--r--src/modules/clist/clistcore.cpp2
-rw-r--r--src/modules/clist/clistevents.cpp4
-rw-r--r--src/modules/clist/clistmenus.cpp8
-rw-r--r--src/modules/clist/clistmod.cpp14
-rw-r--r--src/modules/clist/clistsettings.cpp6
-rw-r--r--src/modules/clist/clisttray.cpp28
-rw-r--r--src/modules/clist/clui.cpp84
-rw-r--r--src/modules/clist/cluiservices.cpp20
-rw-r--r--src/modules/clist/contact.cpp14
-rw-r--r--src/modules/clist/genmenu.cpp12
-rw-r--r--src/modules/clist/genmenuopt.cpp8
-rw-r--r--src/modules/clist/groups.cpp2
-rw-r--r--src/modules/clist/keyboard.cpp2
-rw-r--r--src/modules/database/dbini.cpp2
-rw-r--r--src/modules/findadd/searchresults.cpp6
-rw-r--r--src/modules/fonts/FontOptions.cpp10
-rw-r--r--src/modules/fonts/services.cpp22
-rw-r--r--src/modules/icolib/skin2opts.cpp2
-rw-r--r--src/modules/netlib/netliblog.cpp30
-rw-r--r--src/modules/netlib/netlibupnp.cpp2
-rw-r--r--src/modules/options/options.cpp4
-rw-r--r--src/modules/plugins/newplugins.cpp2
-rw-r--r--src/modules/protocols/protoaccs.cpp22
-rw-r--r--src/modules/protocols/protoopts.cpp4
-rw-r--r--src/modules/skin/hotkey_opts.cpp4
-rw-r--r--src/modules/skin/hotkeys.cpp8
-rw-r--r--src/modules/skin/sounds.cpp10
-rw-r--r--src/modules/utils/path.cpp2
-rw-r--r--src/modules/utils/timezones.cpp4
-rw-r--r--src/modules/utils/utils.cpp16
35 files changed, 215 insertions, 215 deletions
diff --git a/src/modules/clist/Docking.cpp b/src/modules/clist/Docking.cpp
index 382794b9d7..c2aeafec93 100644
--- a/src/modules/clist/Docking.cpp
+++ b/src/modules/clist/Docking.cpp
@@ -150,8 +150,8 @@ int fnDocking_ProcessWindowMessage(WPARAM wParam, LPARAM lParam)
if (docked)
{
DBWriteContactSettingByte(NULL, "CList", "Docked", (BYTE) docked);
- DBWriteContactSettingDword(NULL, "CList", "DockX", (DWORD) dockPos.x);
- DBWriteContactSettingDword(NULL, "CList", "DockY", (DWORD) dockPos.y);
+ db_set_dw(NULL, "CList", "DockX", (DWORD) dockPos.x);
+ db_set_dw(NULL, "CList", "DockY", (DWORD) dockPos.y);
}
else
{
@@ -168,10 +168,10 @@ int fnDocking_ProcessWindowMessage(WPARAM wParam, LPARAM lParam)
{
case WM_CREATE:
draggingTitle = 0;
- docked = DBGetContactSettingByte(NULL, "CLUI", "DockToSides", 1) ?
- (char) DBGetContactSettingByte(NULL, "CList", "Docked", 0) : 0;
- dockPos.x = (int) DBGetContactSettingDword(NULL, "CList", "DockX", 0);
- dockPos.y = (int) DBGetContactSettingDword(NULL, "CList", "DockY", 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);
break;
case WM_ACTIVATE:
@@ -284,7 +284,7 @@ int fnDocking_ProcessWindowMessage(WPARAM wParam, LPARAM lParam)
if (((ptCursor.x < rcMonitor.left + EDGESENSITIVITY) ||
(ptCursor.x >= rcMonitor.right - EDGESENSITIVITY)) &&
- DBGetContactSettingByte(NULL, "CLUI", "DockToSides", 1))
+ db_get_b(NULL, "CLUI", "DockToSides", 1))
{
docked = (ptCursor.x < rcMonitor.left + EDGESENSITIVITY) ? DOCKED_LEFT : DOCKED_RIGHT;
PostMessage(msg->hwnd, WM_LBUTTONUP, 0, MAKELPARAM(ptCursor.x, ptCursor.y));
@@ -350,8 +350,8 @@ int fnDocking_ProcessWindowMessage(WPARAM wParam, LPARAM lParam)
PostMessage(msg->hwnd, WM_NCLBUTTONDOWN, HTCAPTION, MAKELPARAM(pt.x, pt.y));
SetWindowPos(msg->hwnd, 0, pt.x - rc.right / 2,
pt.y - GetSystemMetrics(SM_CYFRAME) - GetSystemMetrics(SM_CYSMCAPTION) / 2,
- DBGetContactSettingDword(NULL, "CList", "Width", 0),
- DBGetContactSettingDword(NULL, "CList", "Height", 0),
+ db_get_dw(NULL, "CList", "Width", 0),
+ db_get_dw(NULL, "CList", "Height", 0),
SWP_NOZORDER);
Docking_Command(msg->hwnd, ABM_REMOVE);
}
diff --git a/src/modules/clist/clc.cpp b/src/modules/clist/clc.cpp
index a46879aaad..dba24ad84b 100644
--- a/src/modules/clist/clc.cpp
+++ b/src/modules/clist/clc.cpp
@@ -482,7 +482,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam,
flags = contact->flags;
}
cli.pfnDeleteItemFromTree(hwnd, (HANDLE) wParam);
- if (GetWindowLongPtr(hwnd, GWL_STYLE) & CLS_SHOWHIDDEN || !DBGetContactSettingByte((HANDLE) wParam, "CList", "Hidden", 0)) {
+ if (GetWindowLongPtr(hwnd, GWL_STYLE) & CLS_SHOWHIDDEN || !db_get_b((HANDLE) wParam, "CList", "Hidden", 0)) {
NMCLISTCONTROL nm;
cli.pfnAddContactToTree(hwnd, dat, (HANDLE) wParam, 1, 1);
if (cli.pfnFindItem(hwnd, dat, (HANDLE) wParam, &contact, NULL, NULL)) {
@@ -519,7 +519,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam,
// this means an offline msg is flashing, so the contact should be shown
DWORD style = GetWindowLongPtr(hwnd, GWL_STYLE);
- shouldShow = (style & CLS_SHOWHIDDEN || !DBGetContactSettingByte((HANDLE) wParam, "CList", "Hidden", 0))
+ shouldShow = (style & CLS_SHOWHIDDEN || !db_get_b((HANDLE) wParam, "CList", "Hidden", 0))
&& ( !cli.pfnIsHiddenMode(dat, status) || CallService(MS_CLIST_GETCONTACTICON, wParam, 0) != lParam);
if ( !cli.pfnFindItem(hwnd, dat, (HANDLE) wParam, &contact, &group, NULL)) {
if (shouldShow && CallService(MS_DB_CONTACT_IS, wParam, 0)) {
@@ -638,7 +638,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam,
if (szProto == NULL)
break;
contact->flags &= ~CONTACTF_IDLE;
- if (DBGetContactSettingDword((HANDLE) wParam, szProto, "IdleTS", 0)) {
+ if (db_get_dw((HANDLE) wParam, szProto, "IdleTS", 0)) {
contact->flags |= CONTACTF_IDLE;
}
cli.pfnInvalidateRect(hwnd, NULL, FALSE);
diff --git a/src/modules/clist/clcitems.cpp b/src/modules/clist/clcitems.cpp
index 77ae140f73..4ef4118104 100644
--- a/src/modules/clist/clcitems.cpp
+++ b/src/modules/clist/clcitems.cpp
@@ -200,9 +200,9 @@ int fnAddContactToGroup(struct ClcData *dat, ClcGroup *group, HANDLE hContact)
group->cl.items[i]->flags |= CONTACTF_VISTO;
else if (apparentMode)
group->cl.items[i]->flags |= CONTACTF_VISTO | CONTACTF_INVISTO;
- if (DBGetContactSettingByte(hContact, "CList", "NotOnList", 0))
+ if (db_get_b(hContact, "CList", "NotOnList", 0))
group->cl.items[i]->flags |= CONTACTF_NOTONLIST;
- idleMode = szProto != NULL ? DBGetContactSettingDword(hContact, szProto, "IdleTS", 0) : 0;
+ idleMode = szProto != NULL ? db_get_dw(hContact, szProto, "IdleTS", 0) : 0;
if (idleMode)
group->cl.items[i]->flags |= CONTACTF_IDLE;
lstrcpyn(group->cl.items[i]->szText, cli.pfnGetContactDisplayName(hContact, 0), SIZEOF(group->cl.items[i]->szText));
@@ -365,7 +365,7 @@ void fnRebuildEntireList(HWND hwnd, struct ClcData *dat)
DBVARIANT dbv;
dat->list.expanded = 1;
- dat->list.hideOffline = DBGetContactSettingByte(NULL, "CLC", "HideOfflineRoot", 0) && style&CLS_USEGROUPS;
+ dat->list.hideOffline = db_get_b(NULL, "CLC", "HideOfflineRoot", 0) && style&CLS_USEGROUPS;
dat->list.cl.count = dat->list.cl.limit = 0;
dat->selection = -1;
{
@@ -383,7 +383,7 @@ void fnRebuildEntireList(HWND hwnd, struct ClcData *dat)
hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
while (hContact) {
- if (style & CLS_SHOWHIDDEN || !DBGetContactSettingByte(hContact, "CList", "Hidden", 0)) {
+ if (style & CLS_SHOWHIDDEN || !db_get_b(hContact, "CList", "Hidden", 0)) {
if (DBGetContactSettingTString(hContact, "CList", "Group", &dbv))
group = &dat->list;
else {
diff --git a/src/modules/clist/clcmsgs.cpp b/src/modules/clist/clcmsgs.cpp
index 8c4de5232d..3c209fb62a 100644
--- a/src/modules/clist/clcmsgs.cpp
+++ b/src/modules/clist/clcmsgs.cpp
@@ -173,7 +173,7 @@ LRESULT fnProcessExternalMessages(HWND hwnd, struct ClcData *dat, UINT msg, WPAR
return (LRESULT) dat->fontInfo[wParam].hFont;
case CLM_GETHIDEOFFLINEROOT:
- return DBGetContactSettingByte(NULL, "CLC", "HideOfflineRoot", 0);
+ return db_get_b(NULL, "CLC", "HideOfflineRoot", 0);
case CLM_GETINDENT:
return dat->groupIndent;
diff --git a/src/modules/clist/clcutils.cpp b/src/modules/clist/clcutils.cpp
index dc3acdfe9e..84ab62c86e 100644
--- a/src/modules/clist/clcutils.cpp
+++ b/src/modules/clist/clcutils.cpp
@@ -698,18 +698,18 @@ void fnGetFontSetting(int i, LOGFONT* lf, COLORREF* colour)
mir_free(dbv.pszVal);
}
mir_snprintf(idstr, SIZEOF(idstr), "Font%dCol", i);
- *colour = DBGetContactSettingDword(NULL, "CLC", idstr, *colour);
+ *colour = db_get_dw(NULL, "CLC", idstr, *colour);
mir_snprintf(idstr, SIZEOF(idstr), "Font%dSize", i);
- lf->lfHeight = (char) DBGetContactSettingByte(NULL, "CLC", idstr, lf->lfHeight);
+ lf->lfHeight = (char) db_get_b(NULL, "CLC", idstr, lf->lfHeight);
mir_snprintf(idstr, SIZEOF(idstr), "Font%dSty", i);
- style = (BYTE) DBGetContactSettingByte(NULL, "CLC", idstr, (lf->lfWeight == FW_NORMAL ? 0 : DBFONTF_BOLD) | (lf->lfItalic ? DBFONTF_ITALIC : 0) | (lf->lfUnderline ? DBFONTF_UNDERLINE : 0));
+ style = (BYTE) db_get_b(NULL, "CLC", idstr, (lf->lfWeight == FW_NORMAL ? 0 : DBFONTF_BOLD) | (lf->lfItalic ? DBFONTF_ITALIC : 0) | (lf->lfUnderline ? DBFONTF_UNDERLINE : 0));
lf->lfWidth = lf->lfEscapement = lf->lfOrientation = 0;
lf->lfWeight = style & DBFONTF_BOLD ? FW_BOLD : FW_NORMAL;
lf->lfItalic = (style & DBFONTF_ITALIC) != 0;
lf->lfUnderline = (style & DBFONTF_UNDERLINE) != 0;
lf->lfStrikeOut = 0;
mir_snprintf(idstr, SIZEOF(idstr), "Font%dSet", i);
- lf->lfCharSet = DBGetContactSettingByte(NULL, "CLC", idstr, lf->lfCharSet);
+ lf->lfCharSet = db_get_b(NULL, "CLC", idstr, lf->lfCharSet);
lf->lfOutPrecision = OUT_DEFAULT_PRECIS;
lf->lfClipPrecision = CLIP_DEFAULT_PRECIS;
lf->lfQuality = DEFAULT_QUALITY;
@@ -718,7 +718,7 @@ void fnGetFontSetting(int i, LOGFONT* lf, COLORREF* colour)
void fnLoadClcOptions(HWND hwnd, struct ClcData *dat)
{
- dat->rowHeight = DBGetContactSettingByte(NULL, "CLC", "RowHeight", CLCDEFAULT_ROWHEIGHT);
+ dat->rowHeight = db_get_b(NULL, "CLC", "RowHeight", CLCDEFAULT_ROWHEIGHT);
LOGFONT lf;
SIZE fontSize;
@@ -742,23 +742,23 @@ void fnLoadClcOptions(HWND hwnd, struct ClcData *dat)
}
ReleaseDC(hwnd, hdc);
- dat->leftMargin = DBGetContactSettingByte(NULL, "CLC", "LeftMargin", CLCDEFAULT_LEFTMARGIN);
- dat->exStyle = DBGetContactSettingDword(NULL, "CLC", "ExStyle", cli.pfnGetDefaultExStyle());
+ dat->leftMargin = db_get_b(NULL, "CLC", "LeftMargin", CLCDEFAULT_LEFTMARGIN);
+ dat->exStyle = db_get_dw(NULL, "CLC", "ExStyle", cli.pfnGetDefaultExStyle());
dat->scrollTime = DBGetContactSettingWord(NULL, "CLC", "ScrollTime", CLCDEFAULT_SCROLLTIME);
- dat->groupIndent = DBGetContactSettingByte(NULL, "CLC", "GroupIndent", CLCDEFAULT_GROUPINDENT);
- dat->gammaCorrection = DBGetContactSettingByte(NULL, "CLC", "GammaCorrect", CLCDEFAULT_GAMMACORRECT);
- dat->showIdle = DBGetContactSettingByte(NULL, "CLC", "ShowIdle", CLCDEFAULT_SHOWIDLE);
- dat->noVScrollbar = DBGetContactSettingByte(NULL, "CLC", "NoVScrollBar", 0);
- dat->filterSearch = DBGetContactSettingByte(NULL, "CLC", "FilterSearch", 1);
+ dat->groupIndent = db_get_b(NULL, "CLC", "GroupIndent", CLCDEFAULT_GROUPINDENT);
+ dat->gammaCorrection = db_get_b(NULL, "CLC", "GammaCorrect", CLCDEFAULT_GAMMACORRECT);
+ dat->showIdle = db_get_b(NULL, "CLC", "ShowIdle", CLCDEFAULT_SHOWIDLE);
+ dat->noVScrollbar = db_get_b(NULL, "CLC", "NoVScrollBar", 0);
+ dat->filterSearch = db_get_b(NULL, "CLC", "FilterSearch", 1);
SendMessage(hwnd, INTM_SCROLLBARCHANGED, 0, 0);
if ( !dat->bkChanged) {
DBVARIANT dbv;
- dat->bkColour = DBGetContactSettingDword(NULL, "CLC", "BkColour", CLCDEFAULT_BKCOLOUR);
+ dat->bkColour = db_get_dw(NULL, "CLC", "BkColour", CLCDEFAULT_BKCOLOUR);
if (dat->hBmpBackground) {
DeleteObject(dat->hBmpBackground);
dat->hBmpBackground = NULL;
}
- if (DBGetContactSettingByte(NULL, "CLC", "UseBitmap", CLCDEFAULT_USEBITMAP)) {
+ if (db_get_b(NULL, "CLC", "UseBitmap", CLCDEFAULT_USEBITMAP)) {
if ( !DBGetContactSettingString(NULL, "CLC", "BkBitmap", &dbv)) {
dat->hBmpBackground = (HBITMAP) CallService(MS_UTILS_LOADBITMAP, 0, (LPARAM) dbv.pszVal);
mir_free(dbv.pszVal);
@@ -766,13 +766,13 @@ void fnLoadClcOptions(HWND hwnd, struct ClcData *dat)
}
dat->backgroundBmpUse = DBGetContactSettingWord(NULL, "CLC", "BkBmpUse", CLCDEFAULT_BKBMPUSE);
}
- dat->greyoutFlags = DBGetContactSettingDword(NULL, "CLC", "GreyoutFlags", CLCDEFAULT_GREYOUTFLAGS);
- dat->offlineModes = DBGetContactSettingDword(NULL, "CLC", "OfflineModes", CLCDEFAULT_OFFLINEMODES);
- dat->selBkColour = DBGetContactSettingDword(NULL, "CLC", "SelBkColour", CLCDEFAULT_SELBKCOLOUR);
- dat->selTextColour = DBGetContactSettingDword(NULL, "CLC", "SelTextColour", CLCDEFAULT_SELTEXTCOLOUR);
- dat->hotTextColour = DBGetContactSettingDword(NULL, "CLC", "HotTextColour", CLCDEFAULT_HOTTEXTCOLOUR);
- dat->quickSearchColour = DBGetContactSettingDword(NULL, "CLC", "QuickSearchColour", CLCDEFAULT_QUICKSEARCHCOLOUR);
- dat->useWindowsColours = DBGetContactSettingByte(NULL, "CLC", "UseWinColours", CLCDEFAULT_USEWINDOWSCOLOURS);
+ dat->greyoutFlags = db_get_dw(NULL, "CLC", "GreyoutFlags", CLCDEFAULT_GREYOUTFLAGS);
+ dat->offlineModes = db_get_dw(NULL, "CLC", "OfflineModes", CLCDEFAULT_OFFLINEMODES);
+ dat->selBkColour = db_get_dw(NULL, "CLC", "SelBkColour", CLCDEFAULT_SELBKCOLOUR);
+ dat->selTextColour = db_get_dw(NULL, "CLC", "SelTextColour", CLCDEFAULT_SELTEXTCOLOUR);
+ dat->hotTextColour = db_get_dw(NULL, "CLC", "HotTextColour", CLCDEFAULT_HOTTEXTCOLOUR);
+ dat->quickSearchColour = db_get_dw(NULL, "CLC", "QuickSearchColour", CLCDEFAULT_QUICKSEARCHCOLOUR);
+ dat->useWindowsColours = db_get_b(NULL, "CLC", "UseWinColours", CLCDEFAULT_USEWINDOWSCOLOURS);
NMHDR hdr;
hdr.code = CLN_OPTIONSCHANGED;
diff --git a/src/modules/clist/clistcore.cpp b/src/modules/clist/clistcore.cpp
index 0ac6bb9a7f..12fbcc032e 100644
--- a/src/modules/clist/clistcore.cpp
+++ b/src/modules/clist/clistcore.cpp
@@ -56,7 +56,7 @@ static void fnOnCreateClc(void)
static void fnReloadProtoMenus(void)
{
RebuildMenuOrder();
- if (DBGetContactSettingByte(NULL, "CList", "MoveProtoMenus", TRUE))
+ if (db_get_b(NULL, "CList", "MoveProtoMenus", TRUE))
BuildProtoMenus();
cli.pfnCluiProtocolStatusChanged(0, 0);
}
diff --git a/src/modules/clist/clistevents.cpp b/src/modules/clist/clistevents.cpp
index 96d5a95a9e..0e19129dee 100644
--- a/src/modules/clist/clistevents.cpp
+++ b/src/modules/clist/clistevents.cpp
@@ -397,8 +397,8 @@ int InitCListEvents(void)
memset(&cli.events, 0, sizeof(cli.events));
cli.events.increment = 10;
- disableTrayFlash = DBGetContactSettingByte(NULL, "CList", "DisableTrayFlash", 0);
- disableIconFlash = DBGetContactSettingByte(NULL, "CList", "NoIconBlink", 0);
+ disableTrayFlash = db_get_b(NULL, "CList", "DisableTrayFlash", 0);
+ disableIconFlash = db_get_b(NULL, "CList", "NoIconBlink", 0);
CreateServiceFunction(MS_CLIST_ADDEVENT, AddEventSyncStub); //need to be called through sync to keep flash timer workable
CreateServiceFunction(MS_CLIST_ADDEVENT"_SYNC", AddEventStub);
CreateServiceFunction(MS_CLIST_REMOVEEVENT, RemoveEventStub);
diff --git a/src/modules/clist/clistmenus.cpp b/src/modules/clist/clistmenus.cpp
index 00d5ad157a..364461d688 100644
--- a/src/modules/clist/clistmenus.cpp
+++ b/src/modules/clist/clistmenus.cpp
@@ -335,7 +335,7 @@ static INT_PTR BuildContactMenu(WPARAM wParam, LPARAM)
BuildContactParam bcp;
bcp.szProto = szProto;
- bcp.isOnList = (DBGetContactSettingByte(hContact, "CList", "NotOnList", 0) == 0);
+ bcp.isOnList = (db_get_b(hContact, "CList", "NotOnList", 0) == 0);
bcp.isOnline = (szProto != NULL && ID_STATUS_OFFLINE != DBGetContactSettingWord(hContact, szProto, "Status", ID_STATUS_OFFLINE));
ListParam param = { 0 };
@@ -571,7 +571,7 @@ INT_PTR StatusMenuExecService(WPARAM wParam, LPARAM)
char *prot = smep->proto;
char szHumanName[64] = {0};
PROTOACCOUNT * acc = Proto_GetAccount(smep->proto);
- int i = (DBGetContactSettingByte(NULL, prot, "LockMainStatus", 0)?0:1);
+ int i = (db_get_b(NULL, prot, "LockMainStatus", 0)?0:1);
DBWriteContactSettingByte(NULL, prot, "LockMainStatus", (BYTE)i);
CallProtoServiceInt(NULL,smep->proto, PS_GETNAME, (WPARAM)SIZEOF(szHumanName), (LPARAM)szHumanName);
@@ -824,7 +824,7 @@ void RebuildMenuOrder(void)
int i, j, s;
DWORD flags;
- BYTE bHideStatusMenu = DBGetContactSettingByte(NULL, "CLUI", "DontHideStatusMenu", 0); // cool perversion, though
+ BYTE bHideStatusMenu = db_get_b(NULL, "CLUI", "DontHideStatusMenu", 0); // cool perversion, though
//clear statusmenu
RecursiveDeleteMenu(hStatusMenu);
@@ -1253,7 +1253,7 @@ static INT_PTR HotkeySetStatus(WPARAM wParam, LPARAM lParam)
static INT_PTR AddProtoMenuItem(WPARAM wParam, LPARAM lParam)
{
- if (DBGetContactSettingByte(NULL, "CList", "MoveProtoMenus", TRUE))
+ if (db_get_b(NULL, "CList", "MoveProtoMenus", TRUE))
return AddStatusMenuItem(wParam, lParam);
return AddMainMenuItem(wParam, lParam);
diff --git a/src/modules/clist/clistmod.cpp b/src/modules/clist/clistmod.cpp
index 375b80367f..2f1cbfbfd0 100644
--- a/src/modules/clist/clistmod.cpp
+++ b/src/modules/clist/clistmod.cpp
@@ -150,7 +150,7 @@ static int ProtocolAck(WPARAM, LPARAM lParam)
while (hContact) {
char *szProto = (char *) CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM) hContact, 0);
if (szProto != NULL && !strcmp(szProto, ack->szModule))
- if (DBGetContactSettingByte(hContact, "CList", "Delete", 0))
+ if (db_get_b(hContact, "CList", "Delete", 0))
CallService(MS_DB_CONTACT_DELETE, (WPARAM) hContact, 0);
hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM) hContact, 0);
}
@@ -379,7 +379,7 @@ int fnShowHide(WPARAM, LPARAM)
switch (iVisibleState) {
case GWVS_PARTIALLY_COVERED:
//If we don't want to bring it to top, we can use a simple break. This goes against readability ;-) but the comment explains it.
- if ( !DBGetContactSettingByte(NULL, "CList", "BringToFront", SETTING_BRINGTOFRONT_DEFAULT))
+ if ( !db_get_b(NULL, "CList", "BringToFront", SETTING_BRINGTOFRONT_DEFAULT))
break;
case GWVS_COVERED: //Fall through (and we're already falling)
case GWVS_HIDDEN:
@@ -396,7 +396,7 @@ int fnShowHide(WPARAM, LPARAM)
RECT rcWindow;
ShowWindow(cli.hwndContactList, SW_RESTORE);
- if ( !DBGetContactSettingByte(NULL, "CList", "OnTop", SETTING_ONTOP_DEFAULT))
+ if ( !db_get_b(NULL, "CList", "OnTop", SETTING_ONTOP_DEFAULT))
SetWindowPos(cli.hwndContactList, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE);
else
SetWindowPos(cli.hwndContactList, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
@@ -412,8 +412,8 @@ int fnShowHide(WPARAM, LPARAM)
}
}
else { //It needs to be hidden
- if (DBGetContactSettingByte(NULL, "CList", "ToolWindow", SETTING_TOOLWINDOW_DEFAULT) ||
- DBGetContactSettingByte(NULL, "CList", "Min2Tray", SETTING_MIN2TRAY_DEFAULT)) {
+ if (db_get_b(NULL, "CList", "ToolWindow", SETTING_TOOLWINDOW_DEFAULT) ||
+ db_get_b(NULL, "CList", "Min2Tray", SETTING_MIN2TRAY_DEFAULT)) {
ShowWindow(cli.hwndContactList, SW_HIDE);
DBWriteContactSettingByte(NULL, "CList", "State", SETTING_STATE_HIDDEN);
}
@@ -422,7 +422,7 @@ int fnShowHide(WPARAM, LPARAM)
DBWriteContactSettingByte(NULL, "CList", "State", SETTING_STATE_MINIMIZED);
}
- if (MySetProcessWorkingSetSize != NULL && DBGetContactSettingByte(NULL, "CList", "DisableWorkingSet", 1))
+ if (MySetProcessWorkingSetSize != NULL && db_get_b(NULL, "CList", "DisableWorkingSet", 1))
MySetProcessWorkingSetSize(GetCurrentProcess(), -1, -1);
}
return 0;
@@ -555,7 +555,7 @@ void UnloadContactListModule()
HANDLE hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
while (hContact != NULL) {
HANDLE hNext = (HANDLE) CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM) hContact, 0);
- if (DBGetContactSettingByte(hContact, "CList", "NotOnList", 0))
+ if (db_get_b(hContact, "CList", "NotOnList", 0))
CallService(MS_DB_CONTACT_DELETE, (WPARAM) hContact, 0);
hContact = hNext;
}
diff --git a/src/modules/clist/clistsettings.cpp b/src/modules/clist/clistsettings.cpp
index 4e25504853..62795e8450 100644
--- a/src/modules/clist/clistsettings.cpp
+++ b/src/modules/clist/clistsettings.cpp
@@ -74,7 +74,7 @@ void fnCheckCacheItem(ClcCacheEntryBase* p)
}
if (p->bIsHidden == -1)
- p->bIsHidden = DBGetContactSettingByte(p->hContact, "CList", "Hidden", 0);
+ p->bIsHidden = db_get_b(p->hContact, "CList", "Hidden", 0);
}
void fnFreeCacheItem(ClcCacheEntryBase* p)
@@ -241,8 +241,8 @@ int ContactSettingChanged(WPARAM wParam, LPARAM lParam)
CallService(MS_CLUI_CONTACTRENAMED, wParam, 0);
}
else if ( !strcmp(cws->szSetting, "Status")) {
- if ( !DBGetContactSettingByte(hContact, "CList", "Hidden", 0)) {
- if (DBGetContactSettingByte(NULL, "CList", "HideOffline", SETTING_HIDEOFFLINE_DEFAULT)) {
+ if ( !db_get_b(hContact, "CList", "Hidden", 0)) {
+ if (db_get_b(NULL, "CList", "HideOffline", SETTING_HIDEOFFLINE_DEFAULT)) {
// User's state is changing, and we are hideOffline-ing
if (cws->value.wVal == ID_STATUS_OFFLINE) {
cli.pfnChangeContactIcon(hContact, cli.pfnIconFromStatusMode(cws->szModule, cws->value.wVal, hContact), 0);
diff --git a/src/modules/clist/clisttray.cpp b/src/modules/clist/clisttray.cpp
index 91af2f6b21..aaf7d79fcd 100644
--- a/src/modules/clist/clisttray.cpp
+++ b/src/modules/clist/clisttray.cpp
@@ -108,7 +108,7 @@ TCHAR* fnTrayIconMakeTooltip(const TCHAR *szPrefix, const char *szProto)
if (szPrefix && szPrefix[0]) {
lstrcpyn(cli.szTip, szPrefix, MAX_TIP_SIZE);
- if ( !DBGetContactSettingByte(NULL, "CList", "AlwaysStatus", SETTING_ALWAYSSTATUS_DEFAULT))
+ if ( !db_get_b(NULL, "CList", "AlwaysStatus", SETTING_ALWAYSSTATUS_DEFAULT))
{ ulock; return cli.szTip; }
}
else cli.szTip[0] = '\0';
@@ -158,7 +158,7 @@ TCHAR* fnTrayIconMakeTooltip(const TCHAR *szPrefix, const char *szProto)
ProtoXStatus = sttGetXStatus(szProto);
szStatus = cli.pfnGetStatusModeDescription(CallProtoServiceInt(NULL,szProto, PS_GETSTATUS, 0, 0), 0);
if (szPrefix && szPrefix[0]) {
- if (DBGetContactSettingByte(NULL, "CList", "AlwaysStatus", SETTING_ALWAYSSTATUS_DEFAULT)) {
+ if (db_get_b(NULL, "CList", "AlwaysStatus", SETTING_ALWAYSSTATUS_DEFAULT)) {
if (mToolTipTrayTips) {
if (ProtoXStatus)
mir_sntprintf(cli.szTip, MAX_TIP_SIZE, _T("%s%s<b>%-12.12s</b>\t%s%s%-24.24s"), szPrefix, szSeparator, pa->tszAccountName, szStatus, szSeparator, ProtoXStatus);
@@ -269,14 +269,14 @@ int fnTrayIconInit(HWND hwnd)
{
cli.trayIcon = (trayIconInfo_t *) mir_calloc(sizeof(trayIconInfo_t) * accounts.getCount());
- int trayIconSetting = DBGetContactSettingByte(NULL, "CList", "TrayIcon", SETTING_TRAYICON_DEFAULT);
+ int trayIconSetting = db_get_b(NULL, "CList", "TrayIcon", SETTING_TRAYICON_DEFAULT);
if (trayIconSetting == SETTING_TRAYICON_SINGLE)
{
DBVARIANT dbv = { DBVT_DELETED };
char *szProto;
if ( !DBGetContactSettingString(NULL, "CList", "PrimaryStatus", &dbv)
- && (averageMode < 0 || DBGetContactSettingByte(NULL, "CList", "AlwaysPrimary", 0)))
+ && (averageMode < 0 || db_get_b(NULL, "CList", "AlwaysPrimary", 0)))
szProto = dbv.pszVal;
else
szProto = NULL;
@@ -285,7 +285,7 @@ int fnTrayIconInit(HWND hwnd)
DBFreeVariant(&dbv);
}
else if (trayIconSetting == SETTING_TRAYICON_MULTI &&
- (averageMode < 0 || DBGetContactSettingByte(NULL, "CList", "AlwaysMulti", SETTING_ALWAYSMULTI_DEFAULT)))
+ (averageMode < 0 || db_get_b(NULL, "CList", "AlwaysMulti", SETTING_ALWAYSMULTI_DEFAULT)))
{
cli.trayIconCount = netProtoCount;
for (int i=0; i < accounts.getCount(); ++i)
@@ -422,7 +422,7 @@ int fnTrayIconUpdate(HICON hNewIcon, const TCHAR *szNewTip, const char *szPrefer
SetTaskBarIcon(NULL, NULL);
cli.trayIcon[i].isBase = isBase;
- if (DBGetContactSettingByte(NULL, "CList", "TrayIcon", SETTING_TRAYICON_DEFAULT) == SETTING_TRAYICON_MULTI)
+ if (db_get_b(NULL, "CList", "TrayIcon", SETTING_TRAYICON_DEFAULT) == SETTING_TRAYICON_MULTI)
{
DWORD time1 = DBGetContactSettingWord(NULL, "CList", "CycleTime", SETTING_CYCLETIME_DEFAULT)*200;
DWORD time2 = DBGetContactSettingWord(NULL, "CList", "IconFlashTime", 550)+1000;
@@ -455,8 +455,8 @@ int fnTrayIconSetBaseInfo(HICON hIcon, const char *szPreferredProto)
}
if ((cli.pfnGetProtocolVisibility(szPreferredProto))
&& (GetAverageMode() == -1)
- && (DBGetContactSettingByte(NULL, "CList", "TrayIcon", SETTING_TRAYICON_DEFAULT) == SETTING_TRAYICON_MULTI)
- && !(DBGetContactSettingByte(NULL, "CList", "AlwaysMulti", SETTING_ALWAYSMULTI_DEFAULT)))
+ && (db_get_b(NULL, "CList", "TrayIcon", SETTING_TRAYICON_DEFAULT) == SETTING_TRAYICON_MULTI)
+ && !(db_get_b(NULL, "CList", "AlwaysMulti", SETTING_ALWAYSMULTI_DEFAULT)))
goto LBL_Error;
}
@@ -528,11 +528,11 @@ void fnTrayIconUpdateBase(const char *szChangedProto)
if (netProtoCount > 0)
{
- int trayIconSetting = DBGetContactSettingByte(NULL, "CList", "TrayIcon", SETTING_TRAYICON_DEFAULT);
+ int trayIconSetting = db_get_b(NULL, "CList", "TrayIcon", SETTING_TRAYICON_DEFAULT);
if (averageMode > 0) {
if (trayIconSetting == SETTING_TRAYICON_MULTI) {
- if (DBGetContactSettingByte(NULL, "CList", "AlwaysMulti", SETTING_ALWAYSMULTI_DEFAULT))
+ if (db_get_b(NULL, "CList", "AlwaysMulti", SETTING_ALWAYSMULTI_DEFAULT))
//changed = cli.pfnTrayIconSetBaseInfo(cli.pfnGetIconFromStatusMode((char*)szChangedProto, NULL, averageMode), (char*)szChangedProto);
changed = cli.pfnTrayIconSetBaseInfo(cli.pfnGetIconFromStatusMode(NULL, szChangedProto, CallProtoServiceInt(NULL,szChangedProto, PS_GETSTATUS, 0, 0)), (char*)szChangedProto);
else if (cli.trayIcon && cli.trayIcon[0].szProto != NULL) {
@@ -571,7 +571,7 @@ void fnTrayIconUpdateBase(const char *szChangedProto)
if ( !cli.trayIcon) {
cli.pfnTrayIconRemove(NULL, NULL);
}
- else if ((cli.trayIconCount > 1 || netProtoCount == 1) || DBGetContactSettingByte(NULL, "CList", "AlwaysMulti", SETTING_ALWAYSMULTI_DEFAULT))
+ else if ((cli.trayIconCount > 1 || netProtoCount == 1) || db_get_b(NULL, "CList", "AlwaysMulti", SETTING_ALWAYSMULTI_DEFAULT))
changed = cli.pfnTrayIconSetBaseInfo(cli.pfnGetIconFromStatusMode(NULL, szChangedProto, CallProtoServiceInt(NULL,szChangedProto, PS_GETSTATUS, 0, 0)), (char*)szChangedProto);
else {
cli.pfnTrayIconDestroy(hwnd);
@@ -643,7 +643,7 @@ int fnTrayIconPauseAutoHide(WPARAM, LPARAM)
{
initcheck 0;
lock;
- if (DBGetContactSettingByte(NULL, "CList", "AutoHide", SETTING_AUTOHIDE_DEFAULT)) {
+ if (db_get_b(NULL, "CList", "AutoHide", SETTING_AUTOHIDE_DEFAULT)) {
if (GetActiveWindow() != cli.hwndContactList) {
KillTimer(NULL, autoHideTimerId);
autoHideTimerId = SetTimer(NULL, 0, 1000 * DBGetContactSettingWord(NULL, "CList", "HideTime", SETTING_HIDETIME_DEFAULT), TrayIconAutoHideTimer);
@@ -721,7 +721,7 @@ INT_PTR fnTrayIconProcessMessage(WPARAM wParam, LPARAM lParam)
break;
case WM_ACTIVATE:
- if (DBGetContactSettingByte(NULL, "CList", "AutoHide", SETTING_AUTOHIDE_DEFAULT)) {
+ if (db_get_b(NULL, "CList", "AutoHide", SETTING_AUTOHIDE_DEFAULT)) {
if (LOWORD(msg->wParam) == WA_INACTIVE)
autoHideTimerId = SetTimer(NULL, 0, 1000 * DBGetContactSettingWord(NULL, "CList", "HideTime", SETTING_HIDETIME_DEFAULT), TrayIconAutoHideTimer);
else
@@ -742,7 +742,7 @@ INT_PTR fnTrayIconProcessMessage(WPARAM wParam, LPARAM lParam)
if (msg->lParam == WM_MBUTTONUP)
cli.pfnShowHide(0, 0);
- else if (msg->lParam == (DBGetContactSettingByte(NULL, "CList", "Tray1Click", SETTING_TRAY1CLICK_DEFAULT) ? WM_LBUTTONUP : WM_LBUTTONDBLCLK)) {
+ else if (msg->lParam == (db_get_b(NULL, "CList", "Tray1Click", SETTING_TRAY1CLICK_DEFAULT) ? WM_LBUTTONUP : WM_LBUTTONDBLCLK)) {
if ((GetAsyncKeyState(VK_CONTROL) & 0x8000))
{
POINT pt;
diff --git a/src/modules/clist/clui.cpp b/src/modules/clist/clui.cpp
index 45b38ccdc6..3d24e77a92 100644
--- a/src/modules/clist/clui.cpp
+++ b/src/modules/clist/clui.cpp
@@ -48,10 +48,10 @@ static CluiOpts cluiopt = {0};
void fnLoadCluiGlobalOpts()
{
- cluiopt.showsbar = DBGetContactSettingByte(NULL, "CLUI", "ShowSBar", 1);
- cluiopt.showgrip = DBGetContactSettingByte(NULL, "CLUI", "ShowGrip", 1);
- cluiopt.transparent = DBGetContactSettingByte(NULL, "CList", "Transparent", SETTING_TRANSPARENT_DEFAULT);
- cluiopt.alpha = DBGetContactSettingByte(NULL, "CList", "Alpha", SETTING_ALPHA_DEFAULT);
+ cluiopt.showsbar = db_get_b(NULL, "CLUI", "ShowSBar", 1);
+ cluiopt.showgrip = db_get_b(NULL, "CLUI", "ShowGrip", 1);
+ cluiopt.transparent = db_get_b(NULL, "CList", "Transparent", SETTING_TRANSPARENT_DEFAULT);
+ cluiopt.alpha = db_get_b(NULL, "CList", "Alpha", SETTING_ALPHA_DEFAULT);
}
static int CluiModulesLoaded(WPARAM, LPARAM)
@@ -178,7 +178,7 @@ static INT_PTR MenuItem_DeleteContact(WPARAM wParam, LPARAM lParam)
//see notes about deleting contacts on PF1_SERVERCLIST servers in m_protosvc.h
UINT_PTR action;
- if (DBGetContactSettingByte(NULL, "CList", "ConfirmDelete", SETTING_CONFIRMDELETE_DEFAULT) &&
+ if (db_get_b(NULL, "CList", "ConfirmDelete", SETTING_CONFIRMDELETE_DEFAULT) &&
!(GetKeyState(VK_SHIFT)&0x8000))
// Ask user for confirmation, and if the contact should be archived (hidden, not deleted)
action = DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_DELETECONTACT), (HWND) lParam, AskForConfirmationDlgProc, wParam);
@@ -290,7 +290,7 @@ int LoadCLUIModule(void)
RegisterClassEx(&wndclass);
wndclass.style = CS_HREDRAW | CS_VREDRAW | ((IsWinVerXPPlus() &&
- DBGetContactSettingByte(NULL, "CList", "WindowShadow", 0) == 1) ? CS_DROPSHADOW : 0);
+ db_get_b(NULL, "CList", "WindowShadow", 0) == 1) ? CS_DROPSHADOW : 0);
wndclass.lpfnWndProc = ContactListWndProc;
wndclass.cbClsExtra = 0;
wndclass.cbWndExtra = 0;
@@ -311,24 +311,24 @@ int LoadCLUIModule(void)
}
RECT pos;
- pos.left = (int) DBGetContactSettingDword(NULL, "CList", "x", 700);
- pos.top = (int) DBGetContactSettingDword(NULL, "CList", "y", 221);
- pos.right = pos.left + (int) DBGetContactSettingDword(NULL, "CList", "Width", 108);
- pos.bottom = pos.top + (int) DBGetContactSettingDword(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);
cli.hwndContactList = CreateWindowEx(
- (DBGetContactSettingByte(NULL, "CList", "ToolWindow", SETTING_TOOLWINDOW_DEFAULT) ? WS_EX_TOOLWINDOW : WS_EX_APPWINDOW),
+ (db_get_b(NULL, "CList", "ToolWindow", SETTING_TOOLWINDOW_DEFAULT) ? WS_EX_TOOLWINDOW : WS_EX_APPWINDOW),
_T(MIRANDACLASS),
titleText,
WS_POPUPWINDOW | WS_THICKFRAME | WS_CLIPCHILDREN |
- (DBGetContactSettingByte(NULL, "CLUI", "ShowCaption", SETTING_SHOWCAPTION_DEFAULT) ? WS_CAPTION | WS_SYSMENU |
- (DBGetContactSettingByte(NULL, "CList", "Min2Tray", SETTING_MIN2TRAY_DEFAULT) ? 0 : WS_MINIMIZEBOX) : 0),
+ (db_get_b(NULL, "CLUI", "ShowCaption", SETTING_SHOWCAPTION_DEFAULT) ? WS_CAPTION | WS_SYSMENU |
+ (db_get_b(NULL, "CList", "Min2Tray", SETTING_MIN2TRAY_DEFAULT) ? 0 : WS_MINIMIZEBOX) : 0),
pos.left, pos.top, pos.right - pos.left, pos.bottom - pos.top,
NULL, NULL, cli.hInst, NULL);
- if (DBGetContactSettingByte(NULL, "CList", "OnDesktop", 0)) {
+ if (db_get_b(NULL, "CList", "OnDesktop", 0)) {
HWND hProgMan = FindWindow(_T("Progman"), NULL);
if (IsWindow(hProgMan))
SetParent(cli.hwndContactList, hProgMan);
@@ -339,16 +339,16 @@ int LoadCLUIModule(void)
PostMessage(cli.hwndContactList, M_RESTORESTATUS, 0, 0);
{
- int state = DBGetContactSettingByte(NULL, "CList", "State", SETTING_STATE_NORMAL);
+ int state = db_get_b(NULL, "CList", "State", SETTING_STATE_NORMAL);
cli.hMenuMain = GetMenu(cli.hwndContactList);
- if ( !DBGetContactSettingByte(NULL, "CLUI", "ShowMainMenu", SETTING_SHOWMAINMENU_DEFAULT))
+ if ( !db_get_b(NULL, "CLUI", "ShowMainMenu", SETTING_SHOWMAINMENU_DEFAULT))
SetMenu(cli.hwndContactList, NULL);
if (state == SETTING_STATE_NORMAL)
ShowWindow(cli.hwndContactList, SW_SHOW);
else if (state == SETTING_STATE_MINIMIZED)
ShowWindow(cli.hwndContactList, SW_SHOWMINIMIZED);
SetWindowPos(cli.hwndContactList,
- DBGetContactSettingByte(NULL, "CList", "OnTop", SETTING_ONTOP_DEFAULT) ? HWND_TOPMOST : HWND_NOTOPMOST,
+ db_get_b(NULL, "CList", "OnTop", SETTING_ONTOP_DEFAULT) ? HWND_TOPMOST : HWND_NOTOPMOST,
0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE);
}
{
@@ -527,9 +527,9 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
cli.hwndContactTree = CreateWindow(CLISTCONTROL_CLASS, _T(""),
WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN
| CLS_CONTACTLIST
- | (DBGetContactSettingByte(NULL, "CList", "UseGroups", SETTING_USEGROUPS_DEFAULT) ? CLS_USEGROUPS : 0)
- | (DBGetContactSettingByte(NULL, "CList", "HideOffline", SETTING_HIDEOFFLINE_DEFAULT) ? CLS_HIDEOFFLINE : 0)
- | (DBGetContactSettingByte(NULL, "CList", "HideEmptyGroups", SETTING_HIDEEMPTYGROUPS_DEFAULT) ?
+ | (db_get_b(NULL, "CList", "UseGroups", SETTING_USEGROUPS_DEFAULT) ? CLS_USEGROUPS : 0)
+ | (db_get_b(NULL, "CList", "HideOffline", SETTING_HIDEOFFLINE_DEFAULT) ? CLS_HIDEOFFLINE : 0)
+ | (db_get_b(NULL, "CList", "HideEmptyGroups", SETTING_HIDEEMPTYGROUPS_DEFAULT) ?
CLS_HIDEEMPTYGROUPS : 0), 0, 0, 0, 0, hwnd, NULL, cli.hInst, NULL);
SendMessage(hwnd, WM_SIZE, 0, 0);
break;
@@ -584,7 +584,7 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
if (wParam == SIZE_MINIMIZED)
{
if ((GetWindowLongPtr(hwnd, GWL_EXSTYLE) & WS_EX_TOOLWINDOW) ||
- DBGetContactSettingByte(NULL, "CList", "Min2Tray", SETTING_MIN2TRAY_DEFAULT))
+ db_get_b(NULL, "CList", "Min2Tray", SETTING_MIN2TRAY_DEFAULT))
{
ShowWindow(hwnd, SW_HIDE);
DBWriteContactSettingByte(NULL, "CList", "State", SETTING_STATE_HIDDEN);
@@ -592,7 +592,7 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
else
DBWriteContactSettingByte(NULL, "CList", "State", SETTING_STATE_MINIMIZED);
- if (MySetProcessWorkingSetSize != NULL && DBGetContactSettingByte(NULL, "CList", "DisableWorkingSet", 1))
+ if (MySetProcessWorkingSetSize != NULL && db_get_b(NULL, "CList", "DisableWorkingSet", 1))
MySetProcessWorkingSetSize(GetCurrentProcess(), -1, -1);
}
// drop thru
@@ -602,11 +602,11 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
GetWindowRect(hwnd, &rc);
if ( !CallService(MS_CLIST_DOCKINGISDOCKED, 0, 0)) { //if docked, dont remember pos (except for width)
- DBWriteContactSettingDword(NULL, "CList", "Height", (DWORD) (rc.bottom - rc.top));
- DBWriteContactSettingDword(NULL, "CList", "x", (DWORD) rc.left);
- DBWriteContactSettingDword(NULL, "CList", "y", (DWORD) rc.top);
+ db_set_dw(NULL, "CList", "Height", (DWORD) (rc.bottom - rc.top));
+ db_set_dw(NULL, "CList", "x", (DWORD) rc.left);
+ db_set_dw(NULL, "CList", "y", (DWORD) rc.top);
}
- DBWriteContactSettingDword(NULL, "CList", "Width", (DWORD) (rc.right - rc.left));
+ db_set_dw(NULL, "CList", "Width", (DWORD) (rc.right - rc.left));
}
return FALSE;
@@ -647,7 +647,7 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
result = DefWindowProc(hwnd, WM_NCHITTEST, wParam, lParam);
if (result == HTSIZE || result == HTTOP || result == HTTOPLEFT || result == HTTOPRIGHT ||
result == HTBOTTOM || result == HTBOTTOMRIGHT || result == HTBOTTOMLEFT)
- if (DBGetContactSettingByte(NULL, "CLUI", "AutoSize", 0))
+ if (db_get_b(NULL, "CLUI", "AutoSize", 0))
return HTCLIENT;
return result;
}
@@ -673,7 +673,7 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
if (transparentFocus)
setLayeredWindowAttributes(hwnd, RGB(0, 0, 0), (BYTE) cluiopt.alpha, LWA_ALPHA);
else
- setLayeredWindowAttributes(hwnd, RGB(0, 0, 0), (BYTE) DBGetContactSettingByte(NULL, "CList", "AutoAlpha", SETTING_AUTOALPHA_DEFAULT), LWA_ALPHA);
+ setLayeredWindowAttributes(hwnd, RGB(0, 0, 0), (BYTE) db_get_b(NULL, "CList", "AutoAlpha", SETTING_AUTOALPHA_DEFAULT), LWA_ALPHA);
}
if ( !transparentFocus)
KillTimer(hwnd, TM_AUTOALPHA);
@@ -687,7 +687,7 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
break;
if (noRecurse)
break;
- if ( !DBGetContactSettingByte(NULL, "CLUI", "FadeInOut", 0) || !IsWinVer2000Plus())
+ if ( !db_get_b(NULL, "CLUI", "FadeInOut", 0) || !IsWinVer2000Plus())
break;
if (GetWindowLongPtr(hwnd, GWL_EXSTYLE) & WS_EX_LAYERED) {
DWORD thisTick, startTick;
@@ -739,12 +739,12 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
case SC_MINIMIZE:
case SC_CLOSE:
if ((GetWindowLongPtr(hwnd, GWL_EXSTYLE) & WS_EX_TOOLWINDOW) ||
- DBGetContactSettingByte(NULL, "CList", "Min2Tray", SETTING_MIN2TRAY_DEFAULT))
+ db_get_b(NULL, "CList", "Min2Tray", SETTING_MIN2TRAY_DEFAULT))
{
ShowWindow(hwnd, SW_HIDE);
DBWriteContactSettingByte(NULL, "CList", "State", SETTING_STATE_HIDDEN);
- if (MySetProcessWorkingSetSize != NULL && DBGetContactSettingByte(NULL, "CList", "DisableWorkingSet", 1))
+ if (MySetProcessWorkingSetSize != NULL && db_get_b(NULL, "CList", "DisableWorkingSet", 1))
MySetProcessWorkingSetSize(GetCurrentProcess(), -1, -1);
return 0;
@@ -872,11 +872,11 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
RECT rcWindow, rcTree, rcWorkArea;
int maxHeight, newHeight;
- if ( !DBGetContactSettingByte(NULL, "CLUI", "AutoSize", 0))
+ if ( !db_get_b(NULL, "CLUI", "AutoSize", 0))
break;
if (CallService(MS_CLIST_DOCKINGISDOCKED, 0, 0))
break;
- maxHeight = DBGetContactSettingByte(NULL, "CLUI", "MaxSizeHeight", 75);
+ maxHeight = db_get_b(NULL, "CLUI", "MaxSizeHeight", 75);
GetWindowRect(hwnd, &rcWindow);
GetWindowRect(cli.hwndContactTree, &rcTree);
@@ -893,7 +893,7 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
newHeight = max(nmc->pt.y, 9) + 1 + (rcWindow.bottom - rcWindow.top) - (rcTree.bottom - rcTree.top);
if (newHeight > (rcWorkArea.bottom - rcWorkArea.top) * maxHeight / 100)
newHeight = (rcWorkArea.bottom - rcWorkArea.top) * maxHeight / 100;
- if (DBGetContactSettingByte(NULL, "CLUI", "AutoSizeUpward", 0)) {
+ if (db_get_b(NULL, "CLUI", "AutoSizeUpward", 0)) {
rcWindow.top = rcWindow.bottom - newHeight;
if (rcWindow.top < rcWorkArea.top)
rcWindow.top = rcWorkArea.top;
@@ -916,7 +916,7 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
break;
if ((hitFlags & (CLCHT_NOWHERE | CLCHT_INLEFTMARGIN | CLCHT_BELOWITEMS)) == 0)
break;
- if (DBGetContactSettingByte(NULL, "CLUI", "ClientAreaDrag", SETTING_CLIENTDRAG_DEFAULT)) {
+ if (db_get_b(NULL, "CLUI", "ClientAreaDrag", SETTING_CLIENTDRAG_DEFAULT)) {
POINT pt;
pt = nm->pt;
ClientToScreen(cli.hwndContactTree, &pt);
@@ -1002,7 +1002,7 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
hMenu = GetSubMenu(LoadMenu(cli.hInst, MAKEINTRESOURCE(IDR_CONTEXT)), 1);
TranslateMenu(hMenu);
CheckMenuItem(hMenu, POPUP_HIDEOFFLINE,
- DBGetContactSettingByte(NULL, "CList", "HideOffline", SETTING_HIDEOFFLINE_DEFAULT) ? MF_CHECKED : MF_UNCHECKED);
+ db_get_b(NULL, "CList", "HideOffline", SETTING_HIDEOFFLINE_DEFAULT) ? MF_CHECKED : MF_UNCHECKED);
CheckMenuItem(hMenu, POPUP_HIDEOFFLINEROOT, SendMessage(cli.hwndContactTree, CLM_GETHIDEOFFLINEROOT, 0, 0) ? MF_CHECKED : MF_UNCHECKED);
CheckMenuItem(hMenu, POPUP_HIDEEMPTYGROUPS,
GetWindowLongPtr(cli.hwndContactTree, GWL_STYLE) & CLS_HIDEEMPTYGROUPS ? MF_CHECKED : MF_UNCHECKED);
@@ -1014,7 +1014,7 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
GetWindowRect(cli.hwndStatus, &rc);
if (PtInRect(&rc, pt)) {
HMENU hMenu;
- if (DBGetContactSettingByte(NULL, "CLUI", "SBarRightClk", 0))
+ if (db_get_b(NULL, "CLUI", "SBarRightClk", 0))
hMenu = (HMENU) CallService(MS_CLIST_MENUGETMAIN, 0, 0);
else
hMenu = (HMENU) CallService(MS_CLIST_MENUGETSTATUS, 0, 0);
@@ -1038,7 +1038,7 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
if (szProto == NULL) return 0;
int status, x;
SIZE textSize;
- BYTE showOpts = DBGetContactSettingByte(NULL, "CLUI", "SBarShow", 1);
+ BYTE showOpts = db_get_b(NULL, "CLUI", "SBarShow", 1);
status = CallProtoServiceInt(NULL,szProto, PS_GETSTATUS, 0, 0);
SetBkMode(dis->hDC, TRANSPARENT);
x = dis->rcItem.left;
@@ -1102,11 +1102,11 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
GetWindowRect(hwnd, &rc);
if ( !CallService(MS_CLIST_DOCKINGISDOCKED, 0, 0)) { //if docked, dont remember pos (except for width)
- DBWriteContactSettingDword(NULL, "CList", "Height", (DWORD) (rc.bottom - rc.top));
- DBWriteContactSettingDword(NULL, "CList", "x", (DWORD) rc.left);
- DBWriteContactSettingDword(NULL, "CList", "y", (DWORD) rc.top);
+ db_set_dw(NULL, "CList", "Height", (DWORD) (rc.bottom - rc.top));
+ db_set_dw(NULL, "CList", "x", (DWORD) rc.left);
+ db_set_dw(NULL, "CList", "y", (DWORD) rc.top);
}
- DBWriteContactSettingDword(NULL, "CList", "Width", (DWORD) (rc.right - rc.left));
+ db_set_dw(NULL, "CList", "Width", (DWORD) (rc.right - rc.left));
}
RemoveMenu(cli.hMenuMain, 0, MF_BYPOSITION);
diff --git a/src/modules/clist/cluiservices.cpp b/src/modules/clist/cluiservices.cpp
index ea3c153d36..6054f55bee 100644
--- a/src/modules/clist/cluiservices.cpp
+++ b/src/modules/clist/cluiservices.cpp
@@ -91,22 +91,22 @@ static INT_PTR ListEndRebuild(WPARAM, LPARAM)
{
int rebuild = 0;
//CLC does this automatically, but we need to force it if hideoffline or hideempty has changed
- if ((DBGetContactSettingByte(NULL, "CList", "HideOffline", SETTING_HIDEOFFLINE_DEFAULT) == 0) != ((GetWindowLongPtr(cli.hwndContactTree, GWL_STYLE) & CLS_HIDEOFFLINE) == 0)) {
- if (DBGetContactSettingByte(NULL, "CList", "HideOffline", SETTING_HIDEOFFLINE_DEFAULT))
+ if ((db_get_b(NULL, "CList", "HideOffline", SETTING_HIDEOFFLINE_DEFAULT) == 0) != ((GetWindowLongPtr(cli.hwndContactTree, GWL_STYLE) & CLS_HIDEOFFLINE) == 0)) {
+ if (db_get_b(NULL, "CList", "HideOffline", SETTING_HIDEOFFLINE_DEFAULT))
SetWindowLongPtr(cli.hwndContactTree, GWL_STYLE, GetWindowLongPtr(cli.hwndContactTree, GWL_STYLE) | CLS_HIDEOFFLINE);
else
SetWindowLongPtr(cli.hwndContactTree, GWL_STYLE, GetWindowLongPtr(cli.hwndContactTree, GWL_STYLE) & ~CLS_HIDEOFFLINE);
rebuild = 1;
}
- if ((DBGetContactSettingByte(NULL, "CList", "HideEmptyGroups", SETTING_HIDEEMPTYGROUPS_DEFAULT) == 0) != ((GetWindowLongPtr(cli.hwndContactTree, GWL_STYLE) & CLS_HIDEEMPTYGROUPS) == 0)) {
- if (DBGetContactSettingByte(NULL, "CList", "HideEmptyGroups", SETTING_HIDEEMPTYGROUPS_DEFAULT))
+ if ((db_get_b(NULL, "CList", "HideEmptyGroups", SETTING_HIDEEMPTYGROUPS_DEFAULT) == 0) != ((GetWindowLongPtr(cli.hwndContactTree, GWL_STYLE) & CLS_HIDEEMPTYGROUPS) == 0)) {
+ if (db_get_b(NULL, "CList", "HideEmptyGroups", SETTING_HIDEEMPTYGROUPS_DEFAULT))
SetWindowLongPtr(cli.hwndContactTree, GWL_STYLE, GetWindowLongPtr(cli.hwndContactTree, GWL_STYLE) | CLS_HIDEEMPTYGROUPS);
else
SetWindowLongPtr(cli.hwndContactTree, GWL_STYLE, GetWindowLongPtr(cli.hwndContactTree, GWL_STYLE) & ~CLS_HIDEEMPTYGROUPS);
rebuild = 1;
}
- if ((DBGetContactSettingByte(NULL, "CList", "UseGroups", SETTING_USEGROUPS_DEFAULT) == 0) != ((GetWindowLongPtr(cli.hwndContactTree, GWL_STYLE) & CLS_USEGROUPS) == 0)) {
- if (DBGetContactSettingByte(NULL, "CList", "UseGroups", SETTING_USEGROUPS_DEFAULT))
+ if ((db_get_b(NULL, "CList", "UseGroups", SETTING_USEGROUPS_DEFAULT) == 0) != ((GetWindowLongPtr(cli.hwndContactTree, GWL_STYLE) & CLS_USEGROUPS) == 0)) {
+ if (db_get_b(NULL, "CList", "UseGroups", SETTING_USEGROUPS_DEFAULT))
SetWindowLongPtr(cli.hwndContactTree, GWL_STYLE, GetWindowLongPtr(cli.hwndContactTree, GWL_STYLE) | CLS_USEGROUPS);
else
SetWindowLongPtr(cli.hwndContactTree, GWL_STYLE, GetWindowLongPtr(cli.hwndContactTree, GWL_STYLE) & ~CLS_USEGROUPS);
@@ -166,17 +166,17 @@ void fnCluiProtocolStatusChanged(int, const char*)
SendMessage(cli.hwndStatus, SB_GETBORDERS, 0, (LPARAM)&borders);
partWidths = (int*)alloca(cli.menuProtoCount * sizeof(int));
- if (DBGetContactSettingByte(NULL, "CLUI", "EqualSections", 0)) {
+ if (db_get_b(NULL, "CLUI", "EqualSections", 0)) {
RECT rc;
GetClientRect(cli.hwndStatus, &rc);
- rc.right -= borders[0] * 2 + (DBGetContactSettingByte(NULL, "CLUI", "ShowGrip", 1) ? GetSystemMetrics(SM_CXVSCROLL) : 0);
+ rc.right -= borders[0] * 2 + (db_get_b(NULL, "CLUI", "ShowGrip", 1) ? GetSystemMetrics(SM_CXVSCROLL) : 0);
for (i=0; i < cli.menuProtoCount; i++)
partWidths[ i ] = (i+1) * rc.right / cli.menuProtoCount - (borders[2] >> 1);
}
else {
HDC hdc;
SIZE textSize;
- BYTE showOpts = DBGetContactSettingByte(NULL, "CLUI", "SBarShow", 1);
+ BYTE showOpts = db_get_b(NULL, "CLUI", "SBarShow", 1);
hdc = GetDC(NULL);
SelectObject(hdc, (HFONT) SendMessage(cli.hwndStatus, WM_GETFONT, 0, 0));
@@ -213,7 +213,7 @@ void fnCluiProtocolStatusChanged(int, const char*)
SendMessage(cli.hwndStatus, SB_SETMINHEIGHT, g_IconHeight, 0);
SendMessage(cli.hwndStatus, SB_SETPARTS, cli.menuProtoCount, (LPARAM)partWidths);
flags = SBT_OWNERDRAW;
- if (DBGetContactSettingByte(NULL, "CLUI", "SBarBevel", 1) == 0)
+ if (db_get_b(NULL, "CLUI", "SBarBevel", 1) == 0)
flags |= SBT_NOBORDERS;
for (i=0; i < cli.menuProtoCount; i++) {
SendMessage(cli.hwndStatus, SB_SETTEXT, i | flags, (LPARAM)cli.menuProtos[i].szProto);
diff --git a/src/modules/clist/contact.cpp b/src/modules/clist/contact.cpp
index a523c3b262..932efb03fc 100644
--- a/src/modules/clist/contact.cpp
+++ b/src/modules/clist/contact.cpp
@@ -78,16 +78,16 @@ void fnLoadContactTree(void)
CallService(MS_CLUI_GROUPADDED, i, 0);
}
- hideOffline = DBGetContactSettingByte(NULL, "CList", "HideOffline", SETTING_HIDEOFFLINE_DEFAULT);
+ hideOffline = db_get_b(NULL, "CList", "HideOffline", SETTING_HIDEOFFLINE_DEFAULT);
hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
while (hContact != NULL) {
status = GetContactStatus(hContact);
- if (( !hideOffline || status != ID_STATUS_OFFLINE) && !DBGetContactSettingByte(hContact, "CList", "Hidden", 0))
+ if (( !hideOffline || status != ID_STATUS_OFFLINE) && !db_get_b(hContact, "CList", "Hidden", 0))
cli.pfnChangeContactIcon(hContact, cli.pfnIconFromStatusMode((char *) CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM) hContact, 0), status, hContact), 1);
hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM) hContact, 0);
}
- sortByStatus = DBGetContactSettingByte(NULL, "CList", "SortByStatus", SETTING_SORTBYSTATUS_DEFAULT);
- sortByProto = DBGetContactSettingByte(NULL, "CList", "SortByProto", SETTING_SORTBYPROTO_DEFAULT);
+ sortByStatus = db_get_b(NULL, "CList", "SortByStatus", SETTING_SORTBYSTATUS_DEFAULT);
+ sortByProto = db_get_b(NULL, "CList", "SortByProto", SETTING_SORTBYPROTO_DEFAULT);
CallService(MS_CLUI_SORTLIST, 0, 0);
CallService(MS_CLUI_LISTENDREBUILD, 0, 0);
}
@@ -148,8 +148,8 @@ static VOID CALLBACK SortContactsTimer(HWND, UINT, UINT_PTR, DWORD)
void fnSortContacts(void)
{
//avoid doing lots of resorts in quick succession
- sortByStatus = DBGetContactSettingByte(NULL, "CList", "SortByStatus", SETTING_SORTBYSTATUS_DEFAULT);
- sortByProto = DBGetContactSettingByte(NULL, "CList", "SortByProto", SETTING_SORTBYPROTO_DEFAULT);
+ sortByStatus = db_get_b(NULL, "CList", "SortByStatus", SETTING_SORTBYSTATUS_DEFAULT);
+ sortByProto = db_get_b(NULL, "CList", "SortByProto", SETTING_SORTBYPROTO_DEFAULT);
if (resortTimerId)
KillTimer(NULL, resortTimerId);
// setting this to a higher delay causes shutdown waits.
@@ -185,7 +185,7 @@ int fnSetHideOffline(WPARAM wParam, LPARAM)
break;
case -1:
DBWriteContactSettingByte(NULL, "CList", "HideOffline",
- (BYTE) ! DBGetContactSettingByte(NULL, "CList", "HideOffline", SETTING_HIDEOFFLINE_DEFAULT));
+ (BYTE) ! db_get_b(NULL, "CList", "HideOffline", SETTING_HIDEOFFLINE_DEFAULT));
break;
}
cli.pfnLoadContactTree();
diff --git a/src/modules/clist/genmenu.cpp b/src/modules/clist/genmenu.cpp
index 1a42b7af57..e68463c781 100644
--- a/src/modules/clist/genmenu.cpp
+++ b/src/modules/clist/genmenu.cpp
@@ -236,7 +236,7 @@ INT_PTR MO_GetProtoRootMenu(WPARAM wParam, LPARAM lParam)
if (szProto == NULL)
return 0;
- if (DBGetContactSettingByte(NULL, "CList", "MoveProtoMenus", TRUE))
+ if (db_get_b(NULL, "CList", "MoveProtoMenus", TRUE))
return (INT_PTR)cli.pfnGetProtocolMenu(szProto);
int objidx = GetMenuObjbyId((int)hMainMenuObject);
@@ -912,11 +912,11 @@ HMENU BuildRecursiveMenu(HMENU hMenu, PMO_IntMenuItem pRootMenu, ListParam *para
// check if it visible
mir_snprintf(DBString, SIZEOF(DBString), "%s_visible", menuItemName);
- if (DBGetContactSettingByte(NULL, MenuNameItems, DBString, -1) == -1)
+ if (db_get_b(NULL, MenuNameItems, DBString, -1) == -1)
DBWriteContactSettingByte(NULL, MenuNameItems, DBString, 1);
pmi->OverrideShow = TRUE;
- if ( !DBGetContactSettingByte(NULL, MenuNameItems, DBString, 1)) {
+ if ( !db_get_b(NULL, MenuNameItems, DBString, 1)) {
pmi->OverrideShow = FALSE;
continue; // find out what value to return if not getting added
}
@@ -930,8 +930,8 @@ HMENU BuildRecursiveMenu(HMENU hMenu, PMO_IntMenuItem pRootMenu, ListParam *para
}
mir_snprintf(DBString, SIZEOF(DBString), "%s_pos", menuItemName);
- if ((pos = DBGetContactSettingDword(NULL, MenuNameItems, DBString, -1)) == -1) {
- DBWriteContactSettingDword(NULL, MenuNameItems, DBString, mi->position);
+ if ((pos = db_get_dw(NULL, MenuNameItems, DBString, -1)) == -1) {
+ db_set_dw(NULL, MenuNameItems, DBString, mi->position);
if (pmi->submenu.first)
mi->position = 0;
}
@@ -1180,7 +1180,7 @@ int InitGenMenu()
CreateServiceFunction(MO_SETOPTIONSMENUOBJECT, SRVMO_SetOptionsMenuObject);
CreateServiceFunction(MO_SETOPTIONSMENUITEM, SRVMO_SetOptionsMenuItem);
- bIconsDisabled = DBGetContactSettingByte(NULL, "CList", "DisableMenuIcons", 0) != 0;
+ bIconsDisabled = db_get_b(NULL, "CList", "DisableMenuIcons", 0) != 0;
bIsGenMenuInited = true;
diff --git a/src/modules/clist/genmenuopt.cpp b/src/modules/clist/genmenuopt.cpp
index 9da91f314d..96d44ff50f 100644
--- a/src/modules/clist/genmenuopt.cpp
+++ b/src/modules/clist/genmenuopt.cpp
@@ -107,7 +107,7 @@ static int SaveTree(HWND hwndDlg)
DBWriteContactSettingByte(NULL, MenuNameItems, DBString, iod->show);
mir_snprintf(DBString, SIZEOF(DBString), "%s_pos", menuItemName);
- DBWriteContactSettingDword(NULL, MenuNameItems, DBString, runtimepos);
+ db_set_dw(NULL, MenuNameItems, DBString, runtimepos);
mir_snprintf(DBString, SIZEOF(DBString), "%s_name", menuItemName);
if (lstrcmp(iod->name, iod->defname) != 0)
@@ -272,11 +272,11 @@ static int BuildTree(HWND hwndDlg, int MenuObjectId, BOOL bReread)
PD->defname = mir_tstrdup(GetMenuItemText(p));
mir_snprintf(buf, SIZEOF(buf), "%s_visible", menuItemName);
- PD->show = DBGetContactSettingByte(NULL, MenuNameItems, buf, 1);
+ PD->show = db_get_b(NULL, MenuNameItems, buf, 1);
if (bReread) {
mir_snprintf(buf, SIZEOF(buf), "%s_pos", menuItemName);
- PD->pos = DBGetContactSettingDword(NULL, MenuNameItems, buf, 1);
+ PD->pos = db_get_dw(NULL, MenuNameItems, buf, 1);
}
else PD->pos = (PD->pimi) ? PD->pimi->originalPosition : 0;
@@ -432,7 +432,7 @@ static INT_PTR CALLBACK GenMenuOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
dat = (struct OrderData*)mir_alloc(sizeof(struct OrderData));
SetWindowLongPtr( GetDlgItem(hwndDlg, IDC_MENUITEMS), GWLP_USERDATA, (LONG_PTR)dat);
dat->dragging = 0;
- dat->iInitMenuValue = DBGetContactSettingByte(NULL, "CList", "MoveProtoMenus", TRUE);
+ dat->iInitMenuValue = db_get_b(NULL, "CList", "MoveProtoMenus", TRUE);
MyOldWindowProc = (WNDPROC)GetWindowLongPtr( GetDlgItem(hwndDlg, IDC_MENUITEMS), GWLP_WNDPROC);
SetWindowLongPtr( GetDlgItem(hwndDlg, IDC_MENUITEMS), GWLP_WNDPROC, (LONG_PTR)&LBTNDOWNProc);
{
diff --git a/src/modules/clist/groups.cpp b/src/modules/clist/groups.cpp
index 740ed163a8..931a06d36e 100644
--- a/src/modules/clist/groups.cpp
+++ b/src/modules/clist/groups.cpp
@@ -164,7 +164,7 @@ static INT_PTR DeleteGroup(WPARAM wParam, LPARAM)
return 1;
lstrcpyn(name, dbv.ptszVal + 1, SIZEOF(name));
DBFreeVariant(&dbv);
- if (DBGetContactSettingByte(NULL, "CList", "ConfirmDelete", SETTING_CONFIRMDELETE_DEFAULT))
+ if (db_get_b(NULL, "CList", "ConfirmDelete", SETTING_CONFIRMDELETE_DEFAULT))
{
TCHAR szQuestion[256+100];
mir_sntprintf(szQuestion, SIZEOF(szQuestion), TranslateT("Are you sure you want to delete group '%s'? This operation can not be undone."), name);
diff --git a/src/modules/clist/keyboard.cpp b/src/modules/clist/keyboard.cpp
index e580681e5c..95df7f4ae2 100644
--- a/src/modules/clist/keyboard.cpp
+++ b/src/modules/clist/keyboard.cpp
@@ -34,7 +34,7 @@ INT_PTR hkSearch(WPARAM wParam, LPARAM lParam)
{
DBVARIANT dbv = {0};
if ( !DBGetContactSettingString(NULL, "CList", "SearchUrl", &dbv)) {
- CallService(MS_UTILS_OPENURL, DBGetContactSettingByte(NULL, "CList", "HKSearchNewWnd", 0), (LPARAM)dbv.pszVal);
+ CallService(MS_UTILS_OPENURL, db_get_b(NULL, "CList", "HKSearchNewWnd", 0), (LPARAM)dbv.pszVal);
DBFreeVariant(&dbv);
}
return 0;
diff --git a/src/modules/database/dbini.cpp b/src/modules/database/dbini.cpp
index 1af0132f2d..0ef7b261b4 100644
--- a/src/modules/database/dbini.cpp
+++ b/src/modules/database/dbini.cpp
@@ -317,7 +317,7 @@ static void ProcessIniFile(TCHAR* szIniPath, char *szSafeSections, char *szUnsaf
break;
case 'd':
case 'D':
- DBWriteContactSettingDword(NULL, szSection, szName, (DWORD)strtoul(szValue+1, NULL, 0));
+ db_set_dw(NULL, szSection, szName, (DWORD)strtoul(szValue+1, NULL, 0));
break;
case 'l':
case 'L':
diff --git a/src/modules/findadd/searchresults.cpp b/src/modules/findadd/searchresults.cpp
index 40eff6e58a..f0a6bdea2c 100644
--- a/src/modules/findadd/searchresults.cpp
+++ b/src/modules/findadd/searchresults.cpp
@@ -101,16 +101,16 @@ void LoadColumnSizes(HWND hwndResults, const char *szProto)
mir_free(lvc.pszText);
}
mir_snprintf(szSetting, SIZEOF(szSetting), "ColOrder%d", i);
- columnOrder[i] = DBGetContactSettingByte(NULL, "FindAdd", szSetting, -1);
+ columnOrder[i] = db_get_b(NULL, "FindAdd", szSetting, -1);
if (columnOrder[i] == -1 || columnOrder[i] >= NUM_COLUMNID) colOrdersValid = false;
}
if (colOrdersValid)
ListView_SetColumnOrderArray(hwndResults, columnCount, columnOrder);
- dat->iLastColumnSortIndex = DBGetContactSettingByte(NULL, "FindAdd", "SortColumn", COLUMNID_NICK);
+ dat->iLastColumnSortIndex = db_get_b(NULL, "FindAdd", "SortColumn", COLUMNID_NICK);
if (dat->iLastColumnSortIndex >= columnCount) dat->iLastColumnSortIndex = COLUMNID_NICK;
- dat->bSortAscending = DBGetContactSettingByte(NULL, "FindAdd", "SortAscending", TRUE);
+ dat->bSortAscending = db_get_b(NULL, "FindAdd", "SortAscending", TRUE);
hdi.mask = HDI_BITMAP | HDI_FORMAT;
hdi.fmt = HDF_LEFT | HDF_BITMAP | HDF_STRING | HDF_BITMAP_ON_RIGHT;
diff --git a/src/modules/fonts/FontOptions.cpp b/src/modules/fonts/FontOptions.cpp
index c0fe7ab0e2..efa1bb2382 100644
--- a/src/modules/fonts/FontOptions.cpp
+++ b/src/modules/fonts/FontOptions.cpp
@@ -392,7 +392,7 @@ static void sttFsuiCreateSettingsTreeNode(HWND hwndTree, const TCHAR *groupName,
ZeroMemory(&tvis.item, sizeof(tvis.item));
tvis.item.hItem = hItem;
tvis.item.mask = TVIF_HANDLE|TVIF_STATE;
- tvis.item.state = tvis.item.stateMask = DBGetContactSettingByte(NULL, "FontServiceUI", treeItem->paramName, TVIS_EXPANDED);
+ tvis.item.state = tvis.item.stateMask = db_get_b(NULL, "FontServiceUI", treeItem->paramName, TVIS_EXPANDED);
TreeView_SetItem(hwndTree, &tvis.item);
} }
@@ -570,7 +570,7 @@ static void sttSaveFontData(HWND hwndDlg, FontInternal &F)
mir_snprintf(str, SIZEOF(str), "%sSet", F.prefix);
DBWriteContactSettingByte(NULL, F.dbSettingsGroup, str, F.value.charset);
mir_snprintf(str, SIZEOF(str), "%sCol", F.prefix);
- DBWriteContactSettingDword(NULL, F.dbSettingsGroup, str, F.value.colour);
+ db_set_dw(NULL, F.dbSettingsGroup, str, F.value.colour);
if (F.flags & FIDF_NOAS) {
mir_snprintf(str, SIZEOF(str), "%sAs", F.prefix);
DBWriteContactSettingWord(NULL, F.dbSettingsGroup, str, (WORD)0x00FF);
@@ -1197,7 +1197,7 @@ static INT_PTR CALLBACK DlgProcLogOptions(HWND hwndDlg, UINT msg, WPARAM wParam,
ColourInternal& C = colour_id_list_w2[i];
mir_snprintf(str, SIZEOF(str), "%s", C.setting);
- DBWriteContactSettingDword(NULL, C.dbSettingsGroup, str, C.value);
+ db_set_dw(NULL, C.dbSettingsGroup, str, C.value);
}
for (i=0; i < effect_id_list_w2.getCount(); i++) {
@@ -1207,10 +1207,10 @@ static INT_PTR CALLBACK DlgProcLogOptions(HWND hwndDlg, UINT msg, WPARAM wParam,
DBWriteContactSettingByte(NULL, E.dbSettingsGroup, str, E.value.effectIndex);
mir_snprintf(str, SIZEOF(str), "%sEffectCol1", E.setting);
- DBWriteContactSettingDword(NULL, E.dbSettingsGroup, str, E.value.baseColour);
+ db_set_dw(NULL, E.dbSettingsGroup, str, E.value.baseColour);
mir_snprintf(str, SIZEOF(str), "%sEffectCol2", E.setting);
- DBWriteContactSettingDword(NULL, E.dbSettingsGroup, str, E.value.secondaryColour);
+ db_set_dw(NULL, E.dbSettingsGroup, str, E.value.secondaryColour);
}
OptionsChanged();
diff --git a/src/modules/fonts/services.cpp b/src/modules/fonts/services.cpp
index 5a7c9696ab..35f5c5a321 100644
--- a/src/modules/fonts/services.cpp
+++ b/src/modules/fonts/services.cpp
@@ -152,22 +152,22 @@ int GetFontSettingFromDB(char *settings_group, char *prefix, LOGFONT* lf, COLORR
if (colour) {
mir_snprintf(idstr, SIZEOF(idstr), "%sCol", prefix);
- *colour = DBGetContactSettingDword(NULL, settings_group, idstr, *colour);
+ *colour = db_get_dw(NULL, settings_group, idstr, *colour);
}
mir_snprintf(idstr, SIZEOF(idstr), "%sSize", prefix);
- lf->lfHeight = (char)DBGetContactSettingByte(NULL, settings_group, idstr, lf->lfHeight);
+ lf->lfHeight = (char)db_get_b(NULL, settings_group, idstr, lf->lfHeight);
//wsprintf(idstr, "%sFlags", prefix);
- //if (DBGetContactSettingDword(NULL, settings_group, idstr, 0) & FIDF_SAVEACTUALHEIGHT) {
+ //if (db_get_dw(NULL, settings_group, idstr, 0) & FIDF_SAVEACTUALHEIGHT) {
// HDC hdc = GetDC(0);
// lf->lfHeight = -lf->lfHeight;
// ReleaseDC(0, hdc);
//}
mir_snprintf(idstr, SIZEOF(idstr), "%sSty", prefix);
- style = (BYTE) DBGetContactSettingByte(NULL, settings_group, idstr,
+ style = (BYTE) db_get_b(NULL, settings_group, idstr,
(lf->lfWeight == FW_NORMAL ? 0 : DBFONTF_BOLD) | (lf->lfItalic ? DBFONTF_ITALIC : 0) | (lf->lfUnderline ? DBFONTF_UNDERLINE : 0) | lf->lfStrikeOut ? DBFONTF_STRIKEOUT : 0);
lf->lfWidth = lf->lfEscapement = lf->lfOrientation = 0;
@@ -177,7 +177,7 @@ int GetFontSettingFromDB(char *settings_group, char *prefix, LOGFONT* lf, COLORR
lf->lfStrikeOut = (style & DBFONTF_STRIKEOUT) != 0;
mir_snprintf(idstr, SIZEOF(idstr), "%sSet", prefix);
- lf->lfCharSet = DBGetContactSettingByte(NULL, settings_group, idstr, lf->lfCharSet);
+ lf->lfCharSet = db_get_b(NULL, settings_group, idstr, lf->lfCharSet);
lf->lfOutPrecision = OUT_DEFAULT_PRECIS;
lf->lfClipPrecision = CLIP_DEFAULT_PRECIS;
@@ -296,7 +296,7 @@ static int sttRegisterFontWorker(FontIDW* font_id, int hLangpack)
char idstr[256];
mir_snprintf(idstr, SIZEOF(idstr), "%sFlags", font_id->prefix);
- DBWriteContactSettingDword(0, font_id->dbSettingsGroup, idstr, font_id->flags);
+ db_set_dw(0, font_id->dbSettingsGroup, idstr, font_id->flags);
FontInternal* newItem = new FontInternal;
memset(newItem, 0, sizeof(FontInternal));
@@ -382,7 +382,7 @@ void KillModuleFonts(int hLangpack)
void UpdateColourSettings(ColourIDW* colour_id, COLORREF *colour)
{
- *colour = (COLORREF)DBGetContactSettingDword(NULL, colour_id->dbSettingsGroup, colour_id->setting, GetColorFromDefault(colour_id->defcolour));
+ *colour = (COLORREF)db_get_dw(NULL, colour_id->dbSettingsGroup, colour_id->setting, GetColorFromDefault(colour_id->defcolour));
}
static INT_PTR sttRegisterColourWorker(ColourIDW* colour_id, int hLangpack)
@@ -425,7 +425,7 @@ static INT_PTR sttGetColourWorker(ColourIDW* colour_id)
for (int i=0; i < colour_id_list.getCount(); i++) {
ColourInternal& C = colour_id_list[i];
if ( !_tcscmp(C.group, colour_id->group) && !_tcscmp(C.name, colour_id->name))
- return DBGetContactSettingDword(NULL, C.dbSettingsGroup, C.setting, GetColorFromDefault(C.defcolour));
+ return db_get_dw(NULL, C.dbSettingsGroup, C.setting, GetColorFromDefault(C.defcolour));
}
return -1;
@@ -459,13 +459,13 @@ void UpdateEffectSettings(EffectIDW* effect_id, FONTEFFECT* effectsettings)
{
char str[256];
mir_snprintf(str, SIZEOF(str), "%sEffect", effect_id->setting);
- effectsettings->effectIndex = DBGetContactSettingByte(NULL, effect_id->dbSettingsGroup, str, effect_id->defeffect.effectIndex);
+ effectsettings->effectIndex = db_get_b(NULL, effect_id->dbSettingsGroup, str, effect_id->defeffect.effectIndex);
mir_snprintf(str, SIZEOF(str), "%sEffectCol1", effect_id->setting);
- effectsettings->baseColour = DBGetContactSettingDword(NULL, effect_id->dbSettingsGroup, str, effect_id->defeffect.baseColour);
+ effectsettings->baseColour = db_get_dw(NULL, effect_id->dbSettingsGroup, str, effect_id->defeffect.baseColour);
mir_snprintf(str, SIZEOF(str), "%sEffectCol2", effect_id->setting);
- effectsettings->secondaryColour = DBGetContactSettingDword(NULL, effect_id->dbSettingsGroup, str, effect_id->defeffect.secondaryColour);
+ effectsettings->secondaryColour = db_get_dw(NULL, effect_id->dbSettingsGroup, str, effect_id->defeffect.secondaryColour);
}
/////////////////////////////////////////////////////////////////////////////////////////
diff --git a/src/modules/icolib/skin2opts.cpp b/src/modules/icolib/skin2opts.cpp
index 6386dac99c..7303eb0464 100644
--- a/src/modules/icolib/skin2opts.cpp
+++ b/src/modules/icolib/skin2opts.cpp
@@ -726,7 +726,7 @@ INT_PTR CALLBACK DlgProcIcoLibOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
tvis.item.pszText = pItemName;
tvis.item.lParam = (LPARAM) treeItem;
- tvis.item.state = tvis.item.stateMask = DBGetContactSettingByte(NULL, "SkinIconsUI", treeItem->paramName, TVIS_EXPANDED);
+ tvis.item.state = tvis.item.stateMask = db_get_b(NULL, "SkinIconsUI", treeItem->paramName, TVIS_EXPANDED);
hItem = TreeView_InsertItem(hwndTree, &tvis);
}
else {
diff --git a/src/modules/netlib/netliblog.cpp b/src/modules/netlib/netliblog.cpp
index 88fe4731b5..ed02cc30c5 100644
--- a/src/modules/netlib/netliblog.cpp
+++ b/src/modules/netlib/netliblog.cpp
@@ -87,7 +87,7 @@ static INT_PTR CALLBACK LogOptionsDlgProc(HWND hwndDlg, UINT message, WPARAM wPa
CheckDlgButton(hwndDlg, IDC_TOFILE, logOptions.toFile?BST_CHECKED:BST_UNCHECKED);
SetDlgItemText(hwndDlg, IDC_FILENAME, logOptions.szUserFile);
SetDlgItemText(hwndDlg, IDC_PATH, logOptions.szFile);
- CheckDlgButton(hwndDlg, IDC_SHOWTHISDLGATSTART, DBGetContactSettingByte(NULL, "Netlib", "ShowLogOptsAtStart", 0)?BST_CHECKED:BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_SHOWTHISDLGATSTART, db_get_b(NULL, "Netlib", "ShowLogOptsAtStart", 0)?BST_CHECKED:BST_UNCHECKED);
{ DBVARIANT dbv;
if ( !DBGetContactSettingString(NULL, "Netlib", "RunAtStart", &dbv)) {
SetDlgItemTextA(hwndDlg, IDC_RUNATSTART, dbv.pszVal);
@@ -247,13 +247,13 @@ static INT_PTR CALLBACK LogOptionsDlgProc(HWND hwndDlg, UINT message, WPARAM wPa
if (tvi.lParam == -1) {
logOptions.toLog = checked;
if (logOptions.save)
- DBWriteContactSettingDword(NULL, "Netlib", "NLlog", checked);
+ db_set_dw(NULL, "Netlib", "NLlog", checked);
}
else
if (tvi.lParam < netlibUser.getCount()) {
netlibUser[tvi.lParam]->toLog = checked;
if (logOptions.save)
- DBWriteContactSettingDword(NULL, netlibUser[tvi.lParam]->user.szSettingsModule, "NLlog", checked);
+ db_set_dw(NULL, netlibUser[tvi.lParam]->user.szSettingsModule, "NLlog", checked);
}
tvi.hItem = TreeView_GetNextSibling(hwndFilter, tvi.hItem);
@@ -552,17 +552,17 @@ void NetlibLogInit(void)
hLogEvent = CreateHookableEvent(ME_NETLIB_FASTDUMP);
InitializeCriticalSection(&logOptions.cs);
- logOptions.dumpRecv = DBGetContactSettingByte(NULL, "Netlib", "DumpRecv", 1);
- logOptions.dumpSent = DBGetContactSettingByte(NULL, "Netlib", "DumpSent", 1);
- logOptions.dumpProxy = DBGetContactSettingByte(NULL, "Netlib", "DumpProxy", 1);
- logOptions.dumpSsl = DBGetContactSettingByte(NULL, "Netlib", "DumpSsl", 0);
- logOptions.textDumps = DBGetContactSettingByte(NULL, "Netlib", "TextDumps", 1);
- logOptions.autoDetectText = DBGetContactSettingByte(NULL, "Netlib", "AutoDetectText", 1);
- logOptions.timeFormat = DBGetContactSettingByte(NULL, "Netlib", "TimeFormat", TIMEFORMAT_HHMMSS);
- logOptions.showUser = DBGetContactSettingByte(NULL, "Netlib", "ShowUser", 1);
- logOptions.toOutputDebugString = DBGetContactSettingByte(NULL, "Netlib", "ToOutputDebugString", 0);
- logOptions.toFile = DBGetContactSettingByte(NULL, "Netlib", "ToFile", 0);
- logOptions.toLog = DBGetContactSettingDword(NULL, "Netlib", "NLlog", 1);
+ logOptions.dumpRecv = db_get_b(NULL, "Netlib", "DumpRecv", 1);
+ logOptions.dumpSent = db_get_b(NULL, "Netlib", "DumpSent", 1);
+ logOptions.dumpProxy = db_get_b(NULL, "Netlib", "DumpProxy", 1);
+ logOptions.dumpSsl = db_get_b(NULL, "Netlib", "DumpSsl", 0);
+ logOptions.textDumps = db_get_b(NULL, "Netlib", "TextDumps", 1);
+ logOptions.autoDetectText = db_get_b(NULL, "Netlib", "AutoDetectText", 1);
+ logOptions.timeFormat = db_get_b(NULL, "Netlib", "TimeFormat", TIMEFORMAT_HHMMSS);
+ logOptions.showUser = db_get_b(NULL, "Netlib", "ShowUser", 1);
+ logOptions.toOutputDebugString = db_get_b(NULL, "Netlib", "ToOutputDebugString", 0);
+ logOptions.toFile = db_get_b(NULL, "Netlib", "ToFile", 0);
+ logOptions.toLog = db_get_dw(NULL, "Netlib", "NLlog", 1);
if ( !DBGetContactSettingTString(NULL, "Netlib", "File", &dbv)) {
logOptions.szUserFile = mir_tstrdup(dbv.ptszVal);
@@ -587,7 +587,7 @@ void NetlibLogInit(void)
fclose(fp);
}
- if (DBGetContactSettingByte(NULL, "Netlib", "ShowLogOptsAtStart", 0))
+ if (db_get_b(NULL, "Netlib", "ShowLogOptsAtStart", 0))
NetlibLogShowOptions();
if ( !DBGetContactSettingTString(NULL, "Netlib", "RunAtStart", &dbv)) {
diff --git a/src/modules/netlib/netlibupnp.cpp b/src/modules/netlib/netlibupnp.cpp
index b75953d280..31b52bb433 100644
--- a/src/modules/netlib/netlibupnp.cpp
+++ b/src/modules/netlib/netlibupnp.cpp
@@ -795,7 +795,7 @@ void NetlibUPnPDeletePortMapping(WORD extport, char* proto)
void NetlibUPnPCleanup(void*)
{
- if (DBGetContactSettingByte(NULL, "Netlib", "NLEnableUPnP", 1) == 0)
+ if (db_get_b(NULL, "Netlib", "NLEnableUPnP", 1) == 0)
// upnp is disabled globally, no need for a cleanup
return;
diff --git a/src/modules/options/options.cpp b/src/modules/options/options.cpp
index efabe24e0a..20a14de456 100644
--- a/src/modules/options/options.cpp
+++ b/src/modules/options/options.cpp
@@ -694,7 +694,7 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hdlg, UINT message, WPARAM wParam, L
Utils_RestoreWindowPositionNoSize(hdlg, NULL, "Options", "");
Window_SetIcon_IcoLib(hdlg, SKINICON_OTHER_OPTIONS);
- CheckDlgButton(hdlg, IDC_EXPERT, DBGetContactSettingByte(NULL, "Options", "Expert", SETTING_SHOWEXPERT_DEFAULT)?BST_CHECKED:BST_UNCHECKED);
+ CheckDlgButton(hdlg, IDC_EXPERT, db_get_b(NULL, "Options", "Expert", SETTING_SHOWEXPERT_DEFAULT)?BST_CHECKED:BST_UNCHECKED);
EnableWindow( GetDlgItem(hdlg, IDC_APPLY), FALSE);
dat = new OptionsDlgData;
SetWindowLongPtr(hdlg, GWLP_USERDATA, (LONG_PTR)dat);
@@ -918,7 +918,7 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hdlg, UINT message, WPARAM wParam, L
if (SendMessageA(hwndTree, TVM_GETITEMA, 0, (LPARAM)&tvi)) {
char buf[130];
mir_snprintf(buf, SIZEOF(buf), "%s%s", OPTSTATE_PREFIX, str);
- if ( !DBGetContactSettingByte(NULL, "Options", buf, 1))
+ if ( !db_get_b(NULL, "Options", buf, 1))
TreeView_Expand(hwndTree, tvi.hItem, TVE_COLLAPSE);
}
tvi.hItem = TreeView_GetNextSibling(hwndTree, tvi.hItem);
diff --git a/src/modules/plugins/newplugins.cpp b/src/modules/plugins/newplugins.cpp
index 38f583b12a..14378fd5e8 100644
--- a/src/modules/plugins/newplugins.cpp
+++ b/src/modules/plugins/newplugins.cpp
@@ -480,7 +480,7 @@ void SetPluginOnWhiteList(const TCHAR* pluginname, int allow)
int isPluginOnWhiteList(const TCHAR* pluginname)
{
char* pluginnameA = _strlwr(mir_t2a(pluginname));
- int rc = DBGetContactSettingByte(NULL, PLUGINDISABLELIST, pluginnameA, 0);
+ int rc = db_get_b(NULL, PLUGINDISABLELIST, pluginnameA, 0);
mir_free(pluginnameA);
if (rc != 0 && askAboutIgnoredPlugins) {
TCHAR buf[256];
diff --git a/src/modules/protocols/protoaccs.cpp b/src/modules/protocols/protoaccs.cpp
index 0b31bfab25..c21e1a85c8 100644
--- a/src/modules/protocols/protoaccs.cpp
+++ b/src/modules/protocols/protoaccs.cpp
@@ -63,8 +63,8 @@ static int EnumDbModules(const char *szModuleName, DWORD ofsModuleName, LPARAM l
void LoadDbAccounts(void)
{
DBVARIANT dbv;
- int ver = DBGetContactSettingDword(NULL, "Protocols", "PrVer", -1);
- int count = DBGetContactSettingDword(NULL, "Protocols", "ProtoCount", 0), i;
+ int ver = db_get_dw(NULL, "Protocols", "PrVer", -1);
+ int count = db_get_dw(NULL, "Protocols", "ProtoCount", 0), i;
for (i=0; i < count; i++) {
char buf[10];
@@ -83,10 +83,10 @@ void LoadDbAccounts(void)
DBFreeVariant(&dbv);
_itoa(OFFSET_VISIBLE+i, buf, 10);
- pa->bIsVisible = DBGetContactSettingDword(NULL, "Protocols", buf, 1);
+ pa->bIsVisible = db_get_dw(NULL, "Protocols", buf, 1);
_itoa(OFFSET_PROTOPOS+i, buf, 10);
- pa->iOrder = DBGetContactSettingDword(NULL, "Protocols", buf, 1);
+ pa->iOrder = db_get_dw(NULL, "Protocols", buf, 1);
if (ver >= 4) {
DBFreeVariant(&dbv);
@@ -97,7 +97,7 @@ void LoadDbAccounts(void)
}
_itoa(OFFSET_ENABLED+i, buf, 10);
- pa->bIsEnabled = DBGetContactSettingDword(NULL, "Protocols", buf, 1);
+ pa->bIsEnabled = db_get_dw(NULL, "Protocols", buf, 1);
if ( !DBGetContactSettingString(NULL, pa->szModuleName, "AM_BaseProto", &dbv)) {
pa->szProtoName = mir_strdup(dbv.pszVal);
@@ -178,21 +178,21 @@ void WriteDbAccounts()
DBWriteContactSettingString(NULL, "Protocols", buf, pa->szModuleName);
_itoa(OFFSET_PROTOPOS+i, buf, 10);
- DBWriteContactSettingDword(NULL, "Protocols", buf, pa->iOrder);
+ db_set_dw(NULL, "Protocols", buf, pa->iOrder);
_itoa(OFFSET_VISIBLE+i, buf, 10);
- DBWriteContactSettingDword(NULL, "Protocols", buf, pa->bIsVisible);
+ db_set_dw(NULL, "Protocols", buf, pa->bIsVisible);
_itoa(OFFSET_ENABLED+i, buf, 10);
- DBWriteContactSettingDword(NULL, "Protocols", buf, pa->bIsEnabled);
+ db_set_dw(NULL, "Protocols", buf, pa->bIsEnabled);
_itoa(OFFSET_NAME+i, buf, 10);
DBWriteContactSettingTString(NULL, "Protocols", buf, pa->tszAccountName);
}
DBDeleteContactSetting(0, "Protocols", "ProtoCount");
- DBWriteContactSettingDword(0, "Protocols", "ProtoCount", accounts.getCount());
- DBWriteContactSettingDword(0, "Protocols", "PrVer", 4);
+ db_set_dw(0, "Protocols", "ProtoCount", accounts.getCount());
+ db_set_dw(0, "Protocols", "PrVer", 4);
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -238,7 +238,7 @@ static int InitializeStaticAccounts(WPARAM, LPARAM)
BuildProtoMenus();
- if (count == 0 && !DBGetContactSettingByte(NULL, "FirstRun", "AccManager", 0)) {
+ if (count == 0 && !db_get_b(NULL, "FirstRun", "AccManager", 0)) {
DBWriteContactSettingByte(NULL, "FirstRun", "AccManager", 1);
CallService(MS_PROTO_SHOWACCMGR, 0, 0);
}
diff --git a/src/modules/protocols/protoopts.cpp b/src/modules/protocols/protoopts.cpp
index 2faccf8d24..c6c43f4169 100644
--- a/src/modules/protocols/protoopts.cpp
+++ b/src/modules/protocols/protoopts.cpp
@@ -192,7 +192,7 @@ static INT_PTR CALLBACK AccFormDlgProc(HWND hwndDlg, UINT message, WPARAM wParam
if (ActivateAccount(pa)) {
pa->ppro->OnEvent(EV_PROTO_ONLOAD, 0, 0);
- if ( !DBGetContactSettingByte(NULL, "CList", "MoveProtoMenus", TRUE))
+ if ( !db_get_b(NULL, "CList", "MoveProtoMenus", TRUE))
pa->ppro->OnEvent(EV_PROTO_ONMENU, 0, 0);
}
else pa->type = PROTOTYPE_DISPROTO;
@@ -776,7 +776,7 @@ INT_PTR CALLBACK AccMgrDlgProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM
if (pa->bIsEnabled) {
if (ActivateAccount(pa)) {
pa->ppro->OnEvent(EV_PROTO_ONLOAD, 0, 0);
- if ( !DBGetContactSettingByte(NULL, "CList", "MoveProtoMenus", TRUE))
+ if ( !db_get_b(NULL, "CList", "MoveProtoMenus", TRUE))
pa->ppro->OnEvent(EV_PROTO_ONMENU, 0, 0);
}
else pa->type = PROTOTYPE_DISPROTO; }
diff --git a/src/modules/skin/hotkey_opts.cpp b/src/modules/skin/hotkey_opts.cpp
index fb932ed7b7..9bf5bdc86e 100644
--- a/src/modules/skin/hotkey_opts.cpp
+++ b/src/modules/skin/hotkey_opts.cpp
@@ -346,7 +346,7 @@ static void sttOptionsSaveItem(THotkeyItem *item)
} }
mir_snprintf(buf, SIZEOF(buf), "%s$count", item->pszName);
- DBWriteContactSettingDword(NULL, DBMODULENAME, buf, item->nSubHotkeys);
+ db_set_dw(NULL, DBMODULENAME, buf, item->nSubHotkeys);
}
static void sttBuildHotkeyList(HWND hwndList)
@@ -506,7 +506,7 @@ static INT_PTR CALLBACK sttOptionsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam,
szSetting = mir_t2a(lvi.pszText);
ListView_SetCheckState(hwndHotkey, lvi.iItem,
- DBGetContactSettingByte(NULL, DBMODULENAME "UI", szSetting, TRUE));
+ db_get_b(NULL, DBMODULENAME "UI", szSetting, TRUE));
mir_free(szSetting);
}
diff --git a/src/modules/skin/hotkeys.cpp b/src/modules/skin/hotkeys.cpp
index b72a3ad3e2..1e72b380a1 100644
--- a/src/modules/skin/hotkeys.cpp
+++ b/src/modules/skin/hotkeys.cpp
@@ -166,14 +166,14 @@ static INT_PTR svcHotkeyRegister(WPARAM wParam, LPARAM lParam)
}
else {
item->pszName = mir_strdup(desc->pszName);
- item->Enabled = !DBGetContactSettingByte(NULL, DBMODULENAME "Off", item->pszName, 0);
+ item->Enabled = !db_get_b(NULL, DBMODULENAME "Off", item->pszName, 0);
}
item->pszService = desc->pszService ? mir_strdup(desc->pszService) : 0;
item->DefHotkey = desc->DefHotKey & ~HKF_MIRANDA_LOCAL;
item->Hotkey = DBGetContactSettingWord(NULL, DBMODULENAME, item->pszName, item->DefHotkey);
item->type = item->pszService ?
- (THotkeyType)DBGetContactSettingByte(NULL, DBMODULENAME "Types", item->pszName,
+ (THotkeyType)db_get_b(NULL, DBMODULENAME "Types", item->pszName,
(desc->DefHotKey & HKF_MIRANDA_LOCAL) ? HKT_LOCAL : HKT_GLOBAL) : HKT_MANUAL;
item->lParam = desc->lParam;
@@ -193,7 +193,7 @@ static INT_PTR svcHotkeyRegister(WPARAM wParam, LPARAM lParam)
/* try to load alternatives from db */
int count, i;
mir_snprintf(buf, SIZEOF(buf), "%s$count", item->pszName);
- count = (int)DBGetContactSettingDword(NULL, DBMODULENAME, buf, -1);
+ count = (int)db_get_dw(NULL, DBMODULENAME, buf, -1);
for (i=0; i < count; i++) {
mir_snprintf(buf, SIZEOF(buf), "%s$%d", item->pszName, i);
if ( !DBGetContactSettingWord(NULL, DBMODULENAME, buf, 0))
@@ -380,7 +380,7 @@ int LoadSkinHotkeys(void)
}
mir_snprintf(szSetting, SIZEOF(szSetting), "HKEn%s", oldSettings[i]);
- if ((key = DBGetContactSettingByte(NULL, "Clist", szSetting, 0))) {
+ if ((key = db_get_b(NULL, "Clist", szSetting, 0))) {
DBDeleteContactSetting(NULL, "Clist", szSetting);
DBWriteContactSettingByte(NULL, DBMODULENAME "Off", newSettings[i], (BYTE)(key == 0));
}
diff --git a/src/modules/skin/sounds.cpp b/src/modules/skin/sounds.cpp
index e9aa29ed9c..44b463eb96 100644
--- a/src/modules/skin/sounds.cpp
+++ b/src/modules/skin/sounds.cpp
@@ -106,7 +106,7 @@ static INT_PTR ServiceSkinAddNewSound(WPARAM wParam, LPARAM lParam)
static int SkinPlaySoundDefault(WPARAM wParam, LPARAM lParam)
{
TCHAR* pszFile = (TCHAR*) lParam;
- if (pszFile && (DBGetContactSettingByte(NULL, "Skin", "UseSound", 0) || (int)wParam == 1))
+ if (pszFile && (db_get_b(NULL, "Skin", "UseSound", 0) || (int)wParam == 1))
PlaySound(pszFile, NULL, SND_ASYNC | SND_FILENAME | SND_NOSTOP);
return 0;
@@ -123,7 +123,7 @@ static INT_PTR ServiceSkinPlaySound(WPARAM, LPARAM lParam)
if (idx == -1)
return 1;
- if ( DBGetContactSettingByte(NULL, "SkinSoundsOff", pszSoundName, 0) == 0) {
+ if ( db_get_b(NULL, "SkinSoundsOff", pszSoundName, 0) == 0) {
DBVARIANT dbv;
if ( DBGetContactSettingTString(NULL, "SkinSounds", pszSoundName, &dbv) == 0) {
TCHAR szFull[MAX_PATH];
@@ -151,7 +151,7 @@ INT_PTR CALLBACK DlgProcSoundOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
SendMessage(hwndDlg, DM_HIDEPANE, 0, 0);
SendMessage(hwndDlg, DM_REBUILD_STREE, 0, 0);
TreeView_SetItemState(hwndTree, 0, TVIS_SELECTED, TVIS_SELECTED);
- CheckDlgButton(hwndDlg, IDC_ENABLESOUNDS, DBGetContactSettingByte(NULL, "Skin", "UseSound", 0));
+ CheckDlgButton(hwndDlg, IDC_ENABLESOUNDS, db_get_b(NULL, "Skin", "UseSound", 0));
SendMessage(hwndDlg, DM_CHECKENABLED, 0, 0);
return TRUE;
@@ -178,7 +178,7 @@ INT_PTR CALLBACK DlgProcSoundOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
TreeView_SetItem(hwndTree, &tvis.item);
}
tvis.item.stateMask = TVIS_STATEIMAGEMASK;
- tvis.item.state = INDEXTOSTATEIMAGEMASK( !DBGetContactSettingByte(NULL, "SkinSoundsOff", arSounds[i].name, 0)?2:1);
+ tvis.item.state = INDEXTOSTATEIMAGEMASK( !db_get_b(NULL, "SkinSoundsOff", arSounds[i].name, 0)?2:1);
tvis.item.lParam = i;
tvis.item.pszText = arSounds[i].getDescr();
TreeView_InsertItem(hwndTree, &tvis);
@@ -278,7 +278,7 @@ INT_PTR CALLBACK DlgProcSoundOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
if (snd.ptszTempFile)
_tcsncpy(strFull, snd.ptszTempFile, SIZEOF(strFull));
else {
- if (DBGetContactSettingByte(NULL, "SkinSoundsOff", snd.name, 0) == 0) {
+ if (db_get_b(NULL, "SkinSoundsOff", snd.name, 0) == 0) {
DBVARIANT dbv;
if (DBGetContactSettingTString(NULL, "SkinSounds", snd.name, &dbv) == 0) {
PathToAbsoluteT(dbv.ptszVal, strdir, NULL);
diff --git a/src/modules/utils/path.cpp b/src/modules/utils/path.cpp
index 0ce1eae95a..9d2f543e4a 100644
--- a/src/modules/utils/path.cpp
+++ b/src/modules/utils/path.cpp
@@ -67,7 +67,7 @@ TCHAR *GetContactID(HANDLE hContact)
{
TCHAR *theValue = {0};
char *szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
- if (DBGetContactSettingByte(hContact, szProto, "ChatRoom", 0) == 1) {
+ if (db_get_b(hContact, szProto, "ChatRoom", 0) == 1) {
DBVARIANT dbv;
if ( !DBGetContactSettingTString(hContact, szProto, "ChatRoomID", &dbv)) {
theValue = (TCHAR *)mir_tstrdup(dbv.ptszVal);
diff --git a/src/modules/utils/timezones.cpp b/src/modules/utils/timezones.cpp
index f1440464f4..81c883dd13 100644
--- a/src/modules/utils/timezones.cpp
+++ b/src/modules/utils/timezones.cpp
@@ -194,7 +194,7 @@ static HANDLE timeapiGetInfoByContact(HANDLE hContact, DWORD dwFlags)
if (res) return res;
}
- signed char timezone = (signed char)DBGetContactSettingByte(hContact, "UserInfo", "Timezone", -1);
+ signed char timezone = (signed char)db_get_b(hContact, "UserInfo", "Timezone", -1);
if (timezone == -1)
{
char* szProto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
@@ -204,7 +204,7 @@ static HANDLE timeapiGetInfoByContact(HANDLE hContact, DWORD dwFlags)
DBFreeVariant(&dbv);
if (res) return res;
}
- timezone = (signed char)DBGetContactSettingByte(hContact, szProto, "Timezone", -1);
+ timezone = (signed char)db_get_b(hContact, szProto, "Timezone", -1);
}
if (timezone != -1)
diff --git a/src/modules/utils/utils.cpp b/src/modules/utils/utils.cpp
index c4d88915be..f0fa1045c9 100644
--- a/src/modules/utils/utils.cpp
+++ b/src/modules/utils/utils.cpp
@@ -326,13 +326,13 @@ static INT_PTR SaveWindowPosition(WPARAM, LPARAM lParam)
wp.length = sizeof(wp);
GetWindowPlacement(swp->hwnd, &wp);
mir_snprintf(szSettingName, SIZEOF(szSettingName), "%sx", swp->szNamePrefix);
- DBWriteContactSettingDword(swp->hContact, swp->szModule, szSettingName, wp.rcNormalPosition.left);
+ db_set_dw(swp->hContact, swp->szModule, szSettingName, wp.rcNormalPosition.left);
mir_snprintf(szSettingName, SIZEOF(szSettingName), "%sy", swp->szNamePrefix);
- DBWriteContactSettingDword(swp->hContact, swp->szModule, szSettingName, wp.rcNormalPosition.top);
+ db_set_dw(swp->hContact, swp->szModule, szSettingName, wp.rcNormalPosition.top);
mir_snprintf(szSettingName, SIZEOF(szSettingName), "%swidth", swp->szNamePrefix);
- DBWriteContactSettingDword(swp->hContact, swp->szModule, szSettingName, wp.rcNormalPosition.right-wp.rcNormalPosition.left);
+ db_set_dw(swp->hContact, swp->szModule, szSettingName, wp.rcNormalPosition.right-wp.rcNormalPosition.left);
mir_snprintf(szSettingName, SIZEOF(szSettingName), "%sheight", swp->szNamePrefix);
- DBWriteContactSettingDword(swp->hContact, swp->szModule, szSettingName, wp.rcNormalPosition.bottom-wp.rcNormalPosition.top);
+ db_set_dw(swp->hContact, swp->szModule, szSettingName, wp.rcNormalPosition.bottom-wp.rcNormalPosition.top);
return 0;
}
@@ -386,9 +386,9 @@ static INT_PTR RestoreWindowPosition(WPARAM wParam, LPARAM lParam)
wp.length = sizeof(wp);
GetWindowPlacement(swp->hwnd, &wp);
mir_snprintf(szSettingName, SIZEOF(szSettingName), "%sx", swp->szNamePrefix);
- x = DBGetContactSettingDword(swp->hContact, swp->szModule, szSettingName, -1);
+ x = db_get_dw(swp->hContact, swp->szModule, szSettingName, -1);
mir_snprintf(szSettingName, SIZEOF(szSettingName), "%sy", swp->szNamePrefix);
- y = (int)DBGetContactSettingDword(swp->hContact, swp->szModule, szSettingName, -1);
+ y = (int)db_get_dw(swp->hContact, swp->szModule, szSettingName, -1);
if (x == -1) return 1;
if (wParam&RWPF_NOSIZE) {
OffsetRect(&wp.rcNormalPosition, x-wp.rcNormalPosition.left, y-wp.rcNormalPosition.top);
@@ -397,9 +397,9 @@ static INT_PTR RestoreWindowPosition(WPARAM wParam, LPARAM lParam)
wp.rcNormalPosition.left = x;
wp.rcNormalPosition.top = y;
mir_snprintf(szSettingName, SIZEOF(szSettingName), "%swidth", swp->szNamePrefix);
- wp.rcNormalPosition.right = wp.rcNormalPosition.left+DBGetContactSettingDword(swp->hContact, swp->szModule, szSettingName, -1);
+ wp.rcNormalPosition.right = wp.rcNormalPosition.left+db_get_dw(swp->hContact, swp->szModule, szSettingName, -1);
mir_snprintf(szSettingName, SIZEOF(szSettingName), "%sheight", swp->szNamePrefix);
- wp.rcNormalPosition.bottom = wp.rcNormalPosition.top+DBGetContactSettingDword(swp->hContact, swp->szModule, szSettingName, -1);
+ wp.rcNormalPosition.bottom = wp.rcNormalPosition.top+db_get_dw(swp->hContact, swp->szModule, szSettingName, -1);
}
wp.flags = 0;
if (wParam & RWPF_HIDDEN)