diff options
author | George Hazan <george.hazan@gmail.com> | 2013-04-05 22:27:16 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2013-04-05 22:27:16 +0000 |
commit | 007b4c7301f0d26a72f89f74e9929f42e24eb3e6 (patch) | |
tree | b1ee30b70c6e36d1a06aed6885cb80dc560a68ca /src/modules | |
parent | f4a1bbc6ba4b8137cb868639ac146aa97e97e9df (diff) |
- rest of menus cleared;
- old database macroses wiped out from all plugins (left in m_database.h for compatibility)
git-svn-id: http://svn.miranda-ng.org/main/trunk@4324 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/modules')
43 files changed, 127 insertions, 127 deletions
diff --git a/src/modules/addcontact/addcontact.cpp b/src/modules/addcontact/addcontact.cpp index 30875f70fc..b6ff5cb2c3 100644 --- a/src/modules/addcontact/addcontact.cpp +++ b/src/modules/addcontact/addcontact.cpp @@ -91,7 +91,7 @@ INT_PTR CALLBACK AddContactDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lp char idstr[4];
int id;
_itoa(groupId, idstr, 10);
- if (DBGetContactSettingTString(NULL, "CListGroups", idstr, &dbv)) break;
+ if (db_get_ts(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);
db_free(&dbv);
@@ -180,7 +180,7 @@ INT_PTR CALLBACK AddContactDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lp CallService(MS_CLIST_CONTACTCHANGEGROUP, (WPARAM)hContact, item);
}
- DBDeleteContactSetting(hContact, "CList", "NotOnList");
+ db_unset(hContact, "CList", "NotOnList");
if (IsDlgButtonChecked(hdlg, IDC_ADDED))
CallContactService(hContact, PSS_ADDED, 0, 0);
diff --git a/src/modules/clist/Docking.cpp b/src/modules/clist/Docking.cpp index 40e147ee1a..323ca4829d 100644 --- a/src/modules/clist/Docking.cpp +++ b/src/modules/clist/Docking.cpp @@ -156,9 +156,9 @@ int fnDocking_ProcessWindowMessage(WPARAM wParam, LPARAM lParam) }
else
{
- DBDeleteContactSetting(NULL, "CList", "Docked");
- DBDeleteContactSetting(NULL, "CList", "DockX");
- DBDeleteContactSetting(NULL, "CList", "DockY");
+ db_unset(NULL, "CList", "Docked");
+ db_unset(NULL, "CList", "DockX");
+ db_unset(NULL, "CList", "DockY");
}
}
diff --git a/src/modules/clist/clc.cpp b/src/modules/clist/clc.cpp index b81523c3af..33e0c49989 100644 --- a/src/modules/clist/clc.cpp +++ b/src/modules/clist/clc.cpp @@ -188,7 +188,7 @@ static int ClcIconsChanged(WPARAM, LPARAM) static INT_PTR SetInfoTipHoverTime(WPARAM wParam, LPARAM)
{
- DBWriteContactSettingWord(NULL, "CLC", "InfoTipHoverTime", (WORD) wParam);
+ db_set_w(NULL, "CLC", "InfoTipHoverTime", (WORD) wParam);
cli.pfnClcBroadcast(INTM_SETINFOTIPHOVERTIME, wParam, 0);
return 0;
}
diff --git a/src/modules/clist/clcitems.cpp b/src/modules/clist/clcitems.cpp index d4b8e83a4e..f2e6dac894 100644 --- a/src/modules/clist/clcitems.cpp +++ b/src/modules/clist/clcitems.cpp @@ -228,7 +228,7 @@ void fnAddContactToTree(HWND hwnd, struct ClcData *dat, HANDLE hContact, int upd if (szProto != NULL)
status = db_get_w(hContact, szProto, "Status", ID_STATUS_OFFLINE);
- if (DBGetContactSettingTString(hContact, "CList", "Group", &dbv))
+ if (db_get_ts(hContact, "CList", "Group", &dbv))
group = &dat->list;
else {
group = cli.pfnAddGroup(hwnd, dat, dbv.ptszVal, (DWORD) - 1, 0, 0);
@@ -322,7 +322,7 @@ void fnDeleteItemFromTree(HWND hwnd, HANDLE hItem) int i, nameOffset;
if ( !IsHContactContact(hItem))
return;
- if (DBGetContactSettingTString(hItem, "CList", "Group", &dbv))
+ if (db_get_ts(hItem, "CList", "Group", &dbv))
return;
//decrease member counts of all parent groups too
@@ -374,7 +374,7 @@ void fnRebuildEntireList(HWND hwnd, struct ClcData *dat) hContact = db_find_first();
while (hContact) {
if (style & CLS_SHOWHIDDEN || !db_get_b(hContact, "CList", "Hidden", 0)) {
- if (DBGetContactSettingTString(hContact, "CList", "Group", &dbv))
+ if (db_get_ts(hContact, "CList", "Group", &dbv))
group = &dat->list;
else {
group = cli.pfnAddGroup(hwnd, dat, dbv.ptszVal, (DWORD) - 1, 0, 0);
diff --git a/src/modules/clist/clcutils.cpp b/src/modules/clist/clcutils.cpp index b4873b9d03..4de2705787 100644 --- a/src/modules/clist/clcutils.cpp +++ b/src/modules/clist/clcutils.cpp @@ -428,7 +428,7 @@ void fnEndRename(HWND, struct ClcData *dat, int save) cli.pfnInvalidateDisplayNameCacheEntry(contact->hContact);
TCHAR* otherName = cli.pfnGetContactDisplayName(contact->hContact, GCDNF_NOMYHANDLE);
if ( !text[0] || !lstrcmp(otherName, text))
- DBDeleteContactSetting(contact->hContact, "CList", "MyHandle");
+ db_unset(contact->hContact, "CList", "MyHandle");
else
db_set_ts(contact->hContact, "CList", "MyHandle", text);
mir_free(otherName);
@@ -697,7 +697,7 @@ void fnGetFontSetting(int i, LOGFONT* lf, COLORREF* colour) cli.pfnGetDefaultFontSetting(i, lf, colour);
mir_snprintf(idstr, SIZEOF(idstr), "Font%dName", i);
- if ( !DBGetContactSettingTString(NULL, "CLC", idstr, &dbv)) {
+ if ( !db_get_ts(NULL, "CLC", idstr, &dbv)) {
lstrcpy(lf->lfFaceName, dbv.ptszVal);
mir_free(dbv.pszVal);
}
@@ -763,7 +763,7 @@ void fnLoadClcOptions(HWND hwnd, struct ClcData *dat) dat->hBmpBackground = NULL;
}
if (db_get_b(NULL, "CLC", "UseBitmap", CLCDEFAULT_USEBITMAP)) {
- if ( !DBGetContactSettingString(NULL, "CLC", "BkBitmap", &dbv)) {
+ if ( !db_get_s(NULL, "CLC", "BkBitmap", &dbv)) {
dat->hBmpBackground = (HBITMAP) CallService(MS_UTILS_LOADBITMAP, 0, (LPARAM) dbv.pszVal);
mir_free(dbv.pszVal);
}
diff --git a/src/modules/clist/clistmenus.cpp b/src/modules/clist/clistmenus.cpp index 2039e7ca7f..edabd41796 100644 --- a/src/modules/clist/clistmenus.cpp +++ b/src/modules/clist/clistmenus.cpp @@ -633,7 +633,7 @@ INT_PTR StatusMenuExecService(WPARAM wParam, LPARAM) Proto_SetStatus(pa->szModuleName, cli.currentDesiredStatusMode);
}
NotifyEventHooks(hStatusModeChangeEvent, cli.currentDesiredStatusMode, 0);
- DBWriteContactSettingWord(NULL, "CList", "Status", (WORD)cli.currentDesiredStatusMode);
+ db_set_w(NULL, "CList", "Status", (WORD)cli.currentDesiredStatusMode);
return 1;
}
}
@@ -830,7 +830,7 @@ int fnGetProtoIndexByPos(PROTOCOLDESCRIPTOR **proto, int protoCnt, int Pos) _itoa(Pos, buf, 10);
DBVARIANT dbv;
- if ( !DBGetContactSettingString(NULL, "Protocols", buf, &dbv)) {
+ if ( !db_get_s(NULL, "Protocols", buf, &dbv)) {
for (int p=0; p < protoCnt; p++) {
if (lstrcmpA(proto[p]->szName, dbv.pszVal) == 0) {
db_free(&dbv);
diff --git a/src/modules/clist/clistsettings.cpp b/src/modules/clist/clistsettings.cpp index 8a2188ce69..606d8e6864 100644 --- a/src/modules/clist/clistsettings.cpp +++ b/src/modules/clist/clistsettings.cpp @@ -68,7 +68,7 @@ void fnCheckCacheItem(ClcCacheEntry *p) {
DBVARIANT dbv;
if (p->tszGroup == NULL) {
- if ( !DBGetContactSettingTString(p->hContact, "CList", "Group", &dbv)) {
+ if ( !db_get_ts(p->hContact, "CList", "Group", &dbv)) {
p->tszGroup = mir_tstrdup(dbv.ptszVal);
mir_free(dbv.ptszVal);
}
@@ -237,7 +237,7 @@ int ContactSettingChanged(WPARAM wParam, LPARAM lParam) return 0;
dbv.pszVal = NULL;
- if ( !DBGetContactSetting(hContact, "Protocol", "p", &dbv)) {
+ if ( !db_get(hContact, "Protocol", "p", &dbv)) {
if ( !strcmp(cws->szModule, dbv.pszVal)) {
cli.pfnInvalidateDisplayNameCacheEntry(hContact);
if ( !strcmp(cws->szSetting, "UIN") || !strcmp(cws->szSetting, "Nick") || !strcmp(cws->szSetting, "FirstName")
diff --git a/src/modules/clist/clisttray.cpp b/src/modules/clist/clisttray.cpp index 6373b1a193..2bb5356a60 100644 --- a/src/modules/clist/clisttray.cpp +++ b/src/modules/clist/clisttray.cpp @@ -271,7 +271,7 @@ int fnTrayIconInit(HWND hwnd) if (trayIconSetting == SETTING_TRAYICON_SINGLE) {
DBVARIANT dbv = { DBVT_DELETED };
char *szProto;
- if ( !DBGetContactSettingString(NULL, "CList", "PrimaryStatus", &dbv)
+ if ( !db_get_s(NULL, "CList", "PrimaryStatus", &dbv)
&& (averageMode < 0 || db_get_b(NULL, "CList", "AlwaysPrimary", 0)))
szProto = dbv.pszVal;
else
@@ -535,7 +535,7 @@ void fnTrayIconUpdateBase(const char *szChangedProto) {
DBVARIANT dbv = { DBVT_DELETED };
char *szProto;
- if (DBGetContactSettingString(NULL, "CList", "PrimaryStatus", &dbv))
+ if (db_get_s(NULL, "CList", "PrimaryStatus", &dbv))
szProto = NULL;
else
szProto = dbv.pszVal;
diff --git a/src/modules/clist/clui.cpp b/src/modules/clist/clui.cpp index ab38b19c07..f99841a069 100644 --- a/src/modules/clist/clui.cpp +++ b/src/modules/clist/clui.cpp @@ -301,7 +301,7 @@ int LoadCLUIModule(void) wndclass.hIconSm = LoadSkinIcon(SKINICON_OTHER_MIRANDA);
RegisterClassEx(&wndclass);
- if (DBGetContactSettingTString(NULL, "CList", "TitleText", &dbv))
+ if (db_get_ts(NULL, "CList", "TitleText", &dbv))
lstrcpyn(titleText, _T(MIRANDANAME), SIZEOF(titleText));
else {
lstrcpyn(titleText, dbv.ptszVal, SIZEOF(titleText));
diff --git a/src/modules/clist/contact.cpp b/src/modules/clist/contact.cpp index 01e60c94fc..209f8fc052 100644 --- a/src/modules/clist/contact.cpp +++ b/src/modules/clist/contact.cpp @@ -163,7 +163,7 @@ INT_PTR ContactChangeGroup(WPARAM wParam, LPARAM lParam) CallService(MS_CLUI_CONTACTDELETED, wParam, 0);
if ((HANDLE) lParam == NULL)
- DBDeleteContactSetting((HANDLE)wParam, "CList", "Group");
+ db_unset((HANDLE)wParam, "CList", "Group");
else {
grpChg.pszNewName = cli.pfnGetGroupName(lParam, NULL);
db_set_ts((HANDLE)wParam, "CList", "Group", grpChg.pszNewName);
diff --git a/src/modules/clist/contacts.cpp b/src/modules/clist/contacts.cpp index bcc2b6091a..d15bbd5e6c 100644 --- a/src/modules/clist/contacts.cpp +++ b/src/modules/clist/contacts.cpp @@ -49,9 +49,9 @@ static int GetDatabaseString(CONTACTINFO *ci, const char* setting, DBVARIANT* db }
if (ci->dwFlag & CNF_UNICODE)
- return DBGetContactSettingWString(ci->hContact, ci->szProto, setting, dbv);
+ return db_get_ws(ci->hContact, ci->szProto, setting, dbv);
- return DBGetContactSettingString(ci->hContact, ci->szProto, setting, dbv);
+ return db_get_s(ci->hContact, ci->szProto, setting, dbv);
}
static int ProcessDatabaseValueDefault(CONTACTINFO *ci, const char* setting)
@@ -70,7 +70,7 @@ static int ProcessDatabaseValueDefault(CONTACTINFO *ci, const char* setting) db_free(&dbv);
}
- if (DBGetContactSetting(ci->hContact, ci->szProto, setting, &dbv))
+ if (db_get(ci->hContact, ci->szProto, setting, &dbv))
return 1;
switch (dbv.type) {
@@ -146,7 +146,7 @@ static INT_PTR GetContactInfo(WPARAM, LPARAM lParam) { if ( !GetDatabaseString(ci, (ci->dwFlag & 0x7F) == CNF_COUNTRY ? "CountryName" : "CompanyCountryName", &dbv))
return 0;
- if ( !DBGetContactSetting(ci->hContact, ci->szProto, (ci->dwFlag & 0x7F) == CNF_COUNTRY ? "Country" : "CompanyCountry", &dbv)) {
+ if ( !db_get(ci->hContact, ci->szProto, (ci->dwFlag & 0x7F) == CNF_COUNTRY ? "Country" : "CompanyCountry", &dbv)) {
if (dbv.type == DBVT_WORD) {
int i, countryCount;
struct CountryListEntry *countries;
@@ -513,7 +513,7 @@ int LoadContactsModule(void) nameOrder[i] = i;
DBVARIANT dbv;
- if ( !DBGetContactSetting(NULL, "Contact", "NameOrder", &dbv)) {
+ if ( !db_get(NULL, "Contact", "NameOrder", &dbv)) {
CopyMemory(nameOrder, dbv.pbVal, dbv.cpbVal);
db_free(&dbv);
}
diff --git a/src/modules/clist/genmenu.cpp b/src/modules/clist/genmenu.cpp index 1ccb2da031..b7df40afcb 100644 --- a/src/modules/clist/genmenu.cpp +++ b/src/modules/clist/genmenu.cpp @@ -930,7 +930,7 @@ HMENU BuildRecursiveMenu(HMENU hMenu, PMO_IntMenuItem pRootMenu, ListParam *para // mi.pszName
mir_snprintf(DBString, SIZEOF(DBString), "%s_name", menuItemName);
- if ( !DBGetContactSettingTString(NULL, MenuNameItems, DBString, &dbv)) {
+ if ( !db_get_ts(NULL, MenuNameItems, DBString, &dbv)) {
if (_tcslen(dbv.ptszVal) > 0)
replaceStrT(pmi->CustomName, dbv.ptszVal);
db_free(&dbv);
diff --git a/src/modules/clist/genmenuopt.cpp b/src/modules/clist/genmenuopt.cpp index 3922e42533..7aea8fe0c6 100644 --- a/src/modules/clist/genmenuopt.cpp +++ b/src/modules/clist/genmenuopt.cpp @@ -114,7 +114,7 @@ static int SaveTree(HWND hwndDlg) if (lstrcmp(iod->name, iod->defname) != 0)
db_set_ts(NULL, MenuNameItems, DBString, iod->name);
else
- DBDeleteContactSetting(NULL, MenuNameItems, DBString);
+ db_unset(NULL, MenuNameItems, DBString);
runtimepos += 100;
}
@@ -264,7 +264,7 @@ static int BuildTree(HWND hwndDlg, int MenuObjectId, BOOL bReread) DBVARIANT dbv;
mir_snprintf(buf, SIZEOF(buf), "%s_name", menuItemName);
- if ( !DBGetContactSettingTString(NULL, MenuNameItems, buf, &dbv)) {
+ if ( !db_get_ts(NULL, MenuNameItems, buf, &dbv)) {
PD->name = mir_tstrdup(dbv.ptszVal);
db_free(&dbv);
}
diff --git a/src/modules/clist/groups.cpp b/src/modules/clist/groups.cpp index 7a289603c2..eb221ae5c7 100644 --- a/src/modules/clist/groups.cpp +++ b/src/modules/clist/groups.cpp @@ -37,7 +37,7 @@ static int CountGroups(void) for (i=0;; i++) {
_itoa(i, str, 10);
- if (DBGetContactSetting(NULL, "CListGroups", str, &dbv))
+ if (db_get(NULL, "CListGroups", str, &dbv))
break;
db_free(&dbv);
}
@@ -54,7 +54,7 @@ static int GroupNameExists(const TCHAR *name, int skipGroup) if (i == skipGroup)
continue;
_itoa(i, idstr, 10);
- if (DBGetContactSettingTString(NULL, "CListGroups", idstr, &dbv))
+ if (db_get_ts(NULL, "CListGroups", idstr, &dbv))
break;
if ( !_tcscmp(dbv.ptszVal + 1, name)) {
db_free(&dbv);
@@ -76,7 +76,7 @@ static INT_PTR CreateGroup(WPARAM wParam, LPARAM lParam) const TCHAR* grpName = lParam ? (TCHAR*)lParam : TranslateT("New Group");
if (wParam) {
_itoa(wParam - 1, str, 10);
- if (DBGetContactSettingTString(NULL, "CListGroups", str, &dbv))
+ if (db_get_ts(NULL, "CListGroups", str, &dbv))
return 0;
mir_sntprintf(newBaseName, SIZEOF(newBaseName), _T("%s\\%s"), dbv.ptszVal + 1, grpName);
@@ -116,7 +116,7 @@ static INT_PTR GetGroupName2(WPARAM wParam, LPARAM lParam) static char name[128];
_itoa(wParam - 1, idstr, 10);
- if (DBGetContactSettingString(NULL, "CListGroups", idstr, &dbv))
+ if (db_get_s(NULL, "CListGroups", idstr, &dbv))
return (INT_PTR) (char *) NULL;
lstrcpynA(name, dbv.pszVal + 1, SIZEOF(name));
if ((DWORD *) lParam != NULL)
@@ -132,7 +132,7 @@ TCHAR* fnGetGroupName(int idx, DWORD* pdwFlags) static TCHAR name[128];
_itoa(idx-1, idstr, 10);
- if (DBGetContactSettingTString(NULL, "CListGroups", idstr, &dbv))
+ if (db_get_ts(NULL, "CListGroups", idstr, &dbv))
return NULL;
lstrcpyn(name, dbv.ptszVal + 1, SIZEOF(name));
@@ -161,7 +161,7 @@ static INT_PTR DeleteGroup(WPARAM wParam, LPARAM) //get the name
_itoa(wParam - 1, str, 10);
- if (DBGetContactSettingTString(NULL, "CListGroups", str, &dbv))
+ if (db_get_ts(NULL, "CListGroups", str, &dbv))
return 1;
lstrcpyn(name, dbv.ptszVal + 1, SIZEOF(name));
db_free(&dbv);
@@ -188,7 +188,7 @@ static INT_PTR DeleteGroup(WPARAM wParam, LPARAM) hContact;
hContact = db_find_next(hContact))
{
- if (DBGetContactSettingTString(hContact, "CList", "Group", &dbv))
+ if (db_get_ts(hContact, "CList", "Group", &dbv))
continue;
if (_tcscmp(dbv.ptszVal, name))
@@ -205,7 +205,7 @@ static INT_PTR DeleteGroup(WPARAM wParam, LPARAM) }
else
{
- DBDeleteContactSetting(hContact, "CList", "Group");
+ db_unset(hContact, "CList", "Group");
grpChg.pszNewName = NULL;
}
NotifyEventHooks(hGroupChangeEvent, (WPARAM)hContact, (LPARAM)&grpChg);
@@ -213,14 +213,14 @@ static INT_PTR DeleteGroup(WPARAM wParam, LPARAM) //shuffle list of groups up to fill gap
for (i = wParam - 1;; i++) {
_itoa(i + 1, str, 10);
- if (DBGetContactSettingStringUtf(NULL, "CListGroups", str, &dbv))
+ if (db_get_utf(NULL, "CListGroups", str, &dbv))
break;
_itoa(i, str, 10);
- DBWriteContactSettingStringUtf(NULL, "CListGroups", str, dbv.pszVal);
+ db_set_utf(NULL, "CListGroups", str, dbv.pszVal);
db_free(&dbv);
}
_itoa(i, str, 10);
- DBDeleteContactSetting(NULL, "CListGroups", str);
+ db_unset(NULL, "CListGroups", str);
//rename subgroups
{
TCHAR szNewName[256];
@@ -229,7 +229,7 @@ static INT_PTR DeleteGroup(WPARAM wParam, LPARAM) len = lstrlen(name);
for (i=0;; i++) {
_itoa(i, str, 10);
- if (DBGetContactSettingTString(NULL, "CListGroups", str, &dbv))
+ if (db_get_ts(NULL, "CListGroups", str, &dbv))
break;
if ( !_tcsncmp(dbv.ptszVal + 1, name, len) && dbv.pszVal[len + 1] == '\\' && _tcschr(dbv.ptszVal + len + 2, '\\') == NULL) {
if (szNewParent[0])
@@ -265,7 +265,7 @@ static int RenameGroupWithMove(int groupId, const TCHAR *szName, int move) //do the change
_itoa(groupId, idstr, 10);
- if (DBGetContactSettingTString(NULL, "CListGroups", idstr, &dbv))
+ if (db_get_ts(NULL, "CListGroups", idstr, &dbv))
return 1;
str[0] = dbv.pszVal[0] & 0x7F;
lstrcpyn(oldName, dbv.ptszVal + 1, SIZEOF(oldName));
@@ -295,7 +295,7 @@ static int RenameGroupWithMove(int groupId, const TCHAR *szName, int move) if (i == groupId)
continue;
_itoa(i, idstr, 10);
- if (DBGetContactSettingTString(NULL, "CListGroups", idstr, &dbv))
+ if (db_get_ts(NULL, "CListGroups", idstr, &dbv))
break;
if ( !_tcsncmp(dbv.ptszVal + 1, oldName, len) && dbv.ptszVal[len + 1] == '\\' && _tcschr(dbv.ptszVal + len + 2, '\\') == NULL) {
mir_sntprintf(szNewName, SIZEOF(szNewName), _T("%s\\%s"), szName, dbv.ptszVal + len + 2);
@@ -316,7 +316,7 @@ static int RenameGroupWithMove(int groupId, const TCHAR *szName, int move) *pszLastBackslash = '\0';
for (i=0;; i++) {
_itoa(i, idstr, 10);
- if (DBGetContactSettingTString(NULL, "CListGroups", idstr, &dbv))
+ if (db_get_ts(NULL, "CListGroups", idstr, &dbv))
break;
if ( !lstrcmp(dbv.ptszVal + 1, str)) {
if (i < groupId)
@@ -354,13 +354,13 @@ static INT_PTR SetGroupExpandedState(WPARAM wParam, LPARAM lParam) DBVARIANT dbv;
_itoa(wParam - 1, idstr, 10);
- if (DBGetContactSettingStringUtf(NULL, "CListGroups", idstr, &dbv))
+ if (db_get_utf(NULL, "CListGroups", idstr, &dbv))
return 1;
if (lParam)
dbv.pszVal[0] |= GROUPF_EXPANDED;
else
dbv.pszVal[0] = dbv.pszVal[0] & ~GROUPF_EXPANDED;
- DBWriteContactSettingStringUtf(NULL, "CListGroups", idstr, dbv.pszVal);
+ db_set_utf(NULL, "CListGroups", idstr, dbv.pszVal);
db_free(&dbv);
return 0;
}
@@ -372,12 +372,12 @@ static INT_PTR SetGroupFlags(WPARAM wParam, LPARAM lParam) int flags, oldval, newval;
_itoa(wParam - 1, idstr, 10);
- if (DBGetContactSettingStringUtf(NULL, "CListGroups", idstr, &dbv))
+ if (db_get_utf(NULL, "CListGroups", idstr, &dbv))
return 1;
flags = LOWORD(lParam) & HIWORD(lParam);
oldval = dbv.pszVal[0];
newval = dbv.pszVal[0] = ((oldval & ~HIWORD(lParam)) | flags) & 0x7f;
- DBWriteContactSettingStringUtf(NULL, "CListGroups", idstr, dbv.pszVal);
+ db_set_utf(NULL, "CListGroups", idstr, dbv.pszVal);
db_free(&dbv);
if ((oldval & GROUPF_HIDEOFFLINE) != (newval & GROUPF_HIDEOFFLINE))
cli.pfnLoadContactTree();
@@ -394,7 +394,7 @@ static INT_PTR MoveGroupBefore(WPARAM wParam, LPARAM lParam) if (wParam == 0 || (LPARAM) wParam == lParam)
return 0;
_itoa(wParam - 1, str, 10);
- if (DBGetContactSettingTString(NULL, "CListGroups", str, &dbv))
+ if (db_get_ts(NULL, "CListGroups", str, &dbv))
return 0;
szMoveName = dbv.ptszVal;
//shuffle list of groups up to fill gap
@@ -418,24 +418,24 @@ static INT_PTR MoveGroupBefore(WPARAM wParam, LPARAM lParam) if (shuffleDir == -1) {
for (i = shuffleFrom; i != shuffleTo; i++) {
_itoa(i + 1, str, 10);
- if (DBGetContactSettingStringUtf(NULL, "CListGroups", str, &dbv)) {
+ if (db_get_utf(NULL, "CListGroups", str, &dbv)) {
shuffleTo = i;
break;
}
_itoa(i, str, 10);
- DBWriteContactSettingStringUtf(NULL, "CListGroups", str, dbv.pszVal);
+ db_set_utf(NULL, "CListGroups", str, dbv.pszVal);
db_free(&dbv);
}
}
else {
for (i = shuffleFrom; i != shuffleTo; i--) {
_itoa(i - 1, str, 10);
- if (DBGetContactSettingStringUtf(NULL, "CListGroups", str, &dbv)) {
+ if (db_get_utf(NULL, "CListGroups", str, &dbv)) {
mir_free(szMoveName);
return 1;
} //never happens
_itoa(i, str, 10);
- DBWriteContactSettingStringUtf(NULL, "CListGroups", str, dbv.pszVal);
+ db_set_utf(NULL, "CListGroups", str, dbv.pszVal);
db_free(&dbv);
}
}
@@ -456,13 +456,13 @@ static INT_PTR BuildGroupMenu(WPARAM, LPARAM) int menuId, compareResult, menuItemCount;
MENUITEMINFO mii = { 0 };
- if (DBGetContactSettingStringUtf(NULL, "CListGroups", "0", &dbv))
+ if (db_get_utf(NULL, "CListGroups", "0", &dbv))
return (INT_PTR) (HMENU) NULL;
db_free(&dbv);
hRootMenu = CreateMenu();
for (groupId = 0;; groupId++) {
_itoa(groupId, idstr, 10);
- if (DBGetContactSettingTString(NULL, "CListGroups", idstr, &dbv))
+ if (db_get_ts(NULL, "CListGroups", idstr, &dbv))
break;
pNextField = dbv.ptszVal + 1;
@@ -547,12 +547,12 @@ int InitGroupServices(void) _itoa(i, str, 10);
DBVARIANT dbv;
- if (DBGetContactSettingStringUtf(NULL, "CListGroups", str, &dbv))
+ if (db_get_utf(NULL, "CListGroups", str, &dbv))
break;
if (dbv.pszVal[0] & 0x80)
{
dbv.pszVal[0] &= 0x7f;
- DBWriteContactSettingStringUtf(NULL, "CListGroups", str, dbv.pszVal);
+ db_set_utf(NULL, "CListGroups", str, dbv.pszVal);
}
db_free(&dbv);
}
diff --git a/src/modules/clist/keyboard.cpp b/src/modules/clist/keyboard.cpp index 2ac34532c1..93b9c1226e 100644 --- a/src/modules/clist/keyboard.cpp +++ b/src/modules/clist/keyboard.cpp @@ -34,7 +34,7 @@ static INT_PTR hkHideShow(WPARAM, LPARAM) INT_PTR hkSearch(WPARAM wParam, LPARAM lParam)
{
DBVARIANT dbv = {0};
- if ( !DBGetContactSettingString(NULL, "CList", "SearchUrl", &dbv)) {
+ if ( !db_get_s(NULL, "CList", "SearchUrl", &dbv)) {
CallService(MS_UTILS_OPENURL, db_get_b(NULL, "CList", "HKSearchNewWnd", 0), (LPARAM)dbv.pszVal);
db_free(&dbv);
}
diff --git a/src/modules/clist/movetogroup.cpp b/src/modules/clist/movetogroup.cpp index fe5b43e933..b661c90c55 100644 --- a/src/modules/clist/movetogroup.cpp +++ b/src/modules/clist/movetogroup.cpp @@ -114,7 +114,7 @@ static int OnContactMenuBuild(WPARAM wParam, LPARAM) _itoa(i, intname, 10);
DBVARIANT dbv;
- if (DBGetContactSettingTString(NULL, "CListGroups", intname, &dbv))
+ if (db_get_ts(NULL, "CListGroups", intname, &dbv))
break;
if (dbv.ptszVal[0])
diff --git a/src/modules/database/dbini.cpp b/src/modules/database/dbini.cpp index 442bd35567..a23726f133 100644 --- a/src/modules/database/dbini.cpp +++ b/src/modules/database/dbini.cpp @@ -322,7 +322,7 @@ static void ProcessIniFile(TCHAR* szIniPath, char *szSafeSections, char *szUnsaf break;
case 'w':
case 'W':
- DBWriteContactSettingWord(NULL, szSection, szName, (WORD)strtol(szValue+1, NULL, 0));
+ db_set_w(NULL, szSection, szName, (WORD)strtol(szValue+1, NULL, 0));
break;
case 'd':
case 'D':
@@ -330,7 +330,7 @@ static void ProcessIniFile(TCHAR* szIniPath, char *szSafeSections, char *szUnsaf break;
case 'l':
case 'L':
- DBDeleteContactSetting(NULL, szSection, szName);
+ db_unset(NULL, szSection, szName);
break;
case 'e':
case 'E':
@@ -357,7 +357,7 @@ static void ProcessIniFile(TCHAR* szIniPath, char *szSafeSections, char *szUnsaf }
case 'u':
case 'U':
- DBWriteContactSettingStringUtf(NULL, szSection, szName, szValue+1);
+ db_set_utf(NULL, szSection, szName, szValue+1);
break;
case 'n':
case 'h':
diff --git a/src/modules/database/dbutils.cpp b/src/modules/database/dbutils.cpp index 9f70e1abec..4e88e1fcce 100644 --- a/src/modules/database/dbutils.cpp +++ b/src/modules/database/dbutils.cpp @@ -229,7 +229,7 @@ static INT_PTR DbDeleteModule(WPARAM, LPARAM lParam) CallService(MS_DB_CONTACT_ENUMSETTINGS, NULL, (LPARAM)&dbces);
for (int i = vars.getCount()-1; i >= 0; i--) {
- DBDeleteContactSetting(NULL, (char*)lParam, vars[i]);
+ db_unset(NULL, (char*)lParam, vars[i]);
mir_free(vars[i]);
}
vars.destroy();
diff --git a/src/modules/extraicons/DefaultExtraIcons.cpp b/src/modules/extraicons/DefaultExtraIcons.cpp index e14ed64fc0..590d21c715 100644 --- a/src/modules/extraicons/DefaultExtraIcons.cpp +++ b/src/modules/extraicons/DefaultExtraIcons.cpp @@ -164,7 +164,7 @@ static void SetExtraIcons(HANDLE hContact) break;
DBVARIANT dbv;
- if (!DBGetContactSettingString(hContact, p.db[j] == NULL ? proto : p.db[j], p.db[j+1], &dbv)) {
+ if (!db_get_s(hContact, p.db[j] == NULL ? proto : p.db[j], p.db[j+1], &dbv)) {
if (!IsEmpty(dbv.pszVal)) {
p.SetIcon(hContact, &p, dbv.pszVal);
show = true;
@@ -241,7 +241,7 @@ static int DefaultOnClick(WPARAM wParam, LPARAM lParam, LPARAM param) break;
DBVARIANT dbv;
- if ( !DBGetContactSettingString(hContact, p->db[j] == NULL ? proto : p->db[j], p->db[j+1], &dbv)) {
+ if ( !db_get_s(hContact, p->db[j] == NULL ? proto : p->db[j], p->db[j+1], &dbv)) {
if (!IsEmpty(dbv.pszVal)) {
p->OnClick(p, dbv.pszVal);
found = true;
diff --git a/src/modules/extraicons/ExtraIconGroup.cpp b/src/modules/extraicons/ExtraIconGroup.cpp index 2c95e2820b..5da0f4f9b3 100644 --- a/src/modules/extraicons/ExtraIconGroup.cpp +++ b/src/modules/extraicons/ExtraIconGroup.cpp @@ -94,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)db_get_dw(hContact, MODULE_NAME, name.c_str(), 0);
if (id < 1)
return NULL;
diff --git a/src/modules/extraicons/IcolibExtraIcon.cpp b/src/modules/extraicons/IcolibExtraIcon.cpp index d361e2074b..dc20e94572 100644 --- a/src/modules/extraicons/IcolibExtraIcon.cpp +++ b/src/modules/extraicons/IcolibExtraIcon.cpp @@ -56,7 +56,7 @@ void IcolibExtraIcon::applyIcon(HANDLE hContact) HANDLE hImage = INVALID_HANDLE_VALUE;
DBVARIANT dbv;
- if ( !DBGetContactSettingString(hContact, MODULE_NAME, name.c_str(), &dbv)) {
+ if ( !db_get_s(hContact, MODULE_NAME, name.c_str(), &dbv)) {
if (!IsEmpty(dbv.pszVal))
hImage = GetIcon(dbv.pszVal);
@@ -76,7 +76,7 @@ int IcolibExtraIcon::setIcon(int id, HANDLE hContact, HANDLE hIcoLib) if ( isEnabled()) {
DBVARIANT dbv;
- if ( !DBGetContactSettingString(hContact, MODULE_NAME, name.c_str(), &dbv)) {
+ if ( !db_get_s(hContact, MODULE_NAME, name.c_str(), &dbv)) {
if (!IsEmpty(dbv.pszVal))
RemoveIcon(dbv.pszVal);
@@ -104,7 +104,7 @@ int IcolibExtraIcon::setIconByName(int id, HANDLE hContact, const char *icon) if ( isEnabled()) {
DBVARIANT dbv;
- if ( !DBGetContactSettingString(hContact, MODULE_NAME, name.c_str(), &dbv)) {
+ if ( !db_get_s(hContact, MODULE_NAME, name.c_str(), &dbv)) {
if (!IsEmpty(dbv.pszVal))
RemoveIcon(dbv.pszVal);
diff --git a/src/modules/extraicons/extraicons.cpp b/src/modules/extraicons/extraicons.cpp index 80187be9af..24cec55b7f 100644 --- a/src/modules/extraicons/extraicons.cpp +++ b/src/modules/extraicons/extraicons.cpp @@ -157,7 +157,7 @@ static void LoadGroups(vector<ExtraIconGroup *> &groups) mir_snprintf(setting, SIZEOF(setting), "%d_%d", i, j);
DBVARIANT dbv;
- if (!DBGetContactSettingString(NULL, MODULE_NAME "Groups", setting, &dbv)) {
+ if (!db_get_s(NULL, MODULE_NAME "Groups", setting, &dbv)) {
if (!IsEmpty(dbv.pszVal)) {
BaseExtraIcon *extra = GetExtraIconByName(dbv.pszVal);
if (extra != NULL) {
diff --git a/src/modules/extraicons/options_ei.cpp b/src/modules/extraicons/options_ei.cpp index 65866ae24b..99d5f8c91d 100644 --- a/src/modules/extraicons/options_ei.cpp +++ b/src/modules/extraicons/options_ei.cpp @@ -541,20 +541,20 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP char setting[512];
mir_snprintf(setting, SIZEOF(setting), "Position_%s", extra->getName());
- DBWriteContactSettingWord(NULL, MODULE_NAME, setting, extra->getPosition());
+ db_set_w(NULL, MODULE_NAME, setting, extra->getPosition());
mir_snprintf(setting, SIZEOF(setting), "Slot_%s", extra->getName());
- DBWriteContactSettingWord(NULL, MODULE_NAME, setting, extra->getSlot());
+ db_set_w(NULL, MODULE_NAME, setting, extra->getSlot());
}
CallService(MS_DB_MODULE_DELETE, 0, (LPARAM) MODULE_NAME "Groups");
- DBWriteContactSettingWord(NULL, MODULE_NAME "Groups", "Count", (WORD)groups.size());
+ db_set_w(NULL, MODULE_NAME "Groups", "Count", (WORD)groups.size());
for (i = 0; i < groups.size(); i++) {
ExtraIconGroup *group = groups[i];
char setting[512];
mir_snprintf(setting, SIZEOF(setting), "%d_count", i);
- DBWriteContactSettingWord(NULL, MODULE_NAME "Groups", setting, (WORD)group->items.size());
+ db_set_w(NULL, MODULE_NAME "Groups", setting, (WORD)group->items.size());
for (unsigned int j = 0; j < group->items.size(); j++) {
BaseExtraIcon *extra = group->items[j];
diff --git a/src/modules/findadd/findadd.cpp b/src/modules/findadd/findadd.cpp index 98197ddaf4..91a53c8ffd 100644 --- a/src/modules/findadd/findadd.cpp +++ b/src/modules/findadd/findadd.cpp @@ -343,7 +343,7 @@ static INT_PTR CALLBACK DlgProcFindAdd(HWND hwndDlg, UINT msg, WPARAM wParam, LP TCHAR *szProto = NULL;
DBVARIANT dbv;
- if ( !DBGetContactSettingTString(NULL, "FindAdd", "LastSearched", &dbv)){
+ if ( !db_get_ts(NULL, "FindAdd", "LastSearched", &dbv)){
szProto = NEWTSTR_ALLOCA(dbv.ptszVal);
db_free(&dbv); /* free string szProto was fetched with */
}
diff --git a/src/modules/findadd/searchresults.cpp b/src/modules/findadd/searchresults.cpp index e93d4d9048..1efff177d4 100644 --- a/src/modules/findadd/searchresults.cpp +++ b/src/modules/findadd/searchresults.cpp @@ -51,7 +51,7 @@ void SaveColumnSizes(HWND hwndResults) db_set_b(NULL, "FindAdd", szSetting, (BYTE)columnOrder[i]);
if (i>=columnCount) continue;
mir_snprintf(szSetting, SIZEOF(szSetting), "ColWidth%d", i);
- DBWriteContactSettingWord(NULL, "FindAdd", szSetting, (WORD)ListView_GetColumnWidth(hwndResults, i));
+ db_set_w(NULL, "FindAdd", szSetting, (WORD)ListView_GetColumnWidth(hwndResults, i));
}
db_set_b(NULL, "FindAdd", "SortColumn", (BYTE)dat->iLastColumnSortIndex);
db_set_b(NULL, "FindAdd", "SortAscending", (BYTE)dat->bSortAscending);
diff --git a/src/modules/fonts/FontOptions.cpp b/src/modules/fonts/FontOptions.cpp index 4e33c31cc1..beb9f5f3ee 100644 --- a/src/modules/fonts/FontOptions.cpp +++ b/src/modules/fonts/FontOptions.cpp @@ -567,10 +567,10 @@ static void sttSaveFontData(HWND hwndDlg, FontInternal &F) 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);
+ db_set_w(NULL, F.dbSettingsGroup, str, (WORD)0x00FF);
}
mir_snprintf(str, SIZEOF(str), "%sFlags", F.prefix);
- DBWriteContactSettingWord(NULL, F.dbSettingsGroup, str, (WORD)F.flags);
+ db_set_w(NULL, F.dbSettingsGroup, str, (WORD)F.flags);
}
static INT_PTR CALLBACK DlgProcLogOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
diff --git a/src/modules/fonts/services.cpp b/src/modules/fonts/services.cpp index d016317f25..d9cbd1a964 100644 --- a/src/modules/fonts/services.cpp +++ b/src/modules/fonts/services.cpp @@ -144,7 +144,7 @@ int GetFontSettingFromDB(char *settings_group, char *prefix, LOGFONT* lf, COLORR if (flags & FIDF_APPENDNAME) mir_snprintf(idstr, SIZEOF(idstr), "%sName", prefix);
else mir_snprintf(idstr, SIZEOF(idstr), "%s", prefix);
- if ( !DBGetContactSettingTString(NULL, settings_group, idstr, &dbv)) {
+ if ( !db_get_ts(NULL, settings_group, idstr, &dbv)) {
_tcscpy(lf->lfFaceName, dbv.ptszVal);
db_free(&dbv);
}
diff --git a/src/modules/icolib/skin2icons.cpp b/src/modules/icolib/skin2icons.cpp index 51b443197d..f5e7484df2 100644 --- a/src/modules/icolib/skin2icons.cpp +++ b/src/modules/icolib/skin2icons.cpp @@ -679,7 +679,7 @@ HICON IconItem_GetIcon(IcolibItem* item, bool big) big = big && !item->cx;
IconSourceItem* &source = big ? item->source_big : item->source_small;
- if ( !source && !DBGetContactSettingTString(NULL, "SkinIcons", item->name, &dbv)) {
+ if ( !source && !db_get_ts(NULL, "SkinIcons", item->name, &dbv)) {
TCHAR tszFullPath[MAX_PATH];
PathToAbsoluteT(dbv.ptszVal, tszFullPath);
int cx = item->cx ? item->cx : GetSystemMetrics(big ? SM_CXICON : SM_CXSMICON);
diff --git a/src/modules/icolib/skin2opts.cpp b/src/modules/icolib/skin2opts.cpp index 107149f087..94f024ba81 100644 --- a/src/modules/icolib/skin2opts.cpp +++ b/src/modules/icolib/skin2opts.cpp @@ -940,7 +940,7 @@ INT_PTR CALLBACK DlgProcIcoLibOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM for (int indx = 0; indx < iconList.getCount(); indx++) {
IcolibItem *item = iconList[indx];
if (item->temp_reset) {
- DBDeleteContactSetting(NULL, "SkinIcons", item->name);
+ db_unset(NULL, "SkinIcons", item->name);
if (item->source_small != item->default_icon) {
IconSourceItem_Release(&item->source_small);
}
diff --git a/src/modules/ignore/ignore.cpp b/src/modules/ignore/ignore.cpp index ba049b80c3..e77f0e6321 100644 --- a/src/modules/ignore/ignore.cpp +++ b/src/modules/ignore/ignore.cpp @@ -304,7 +304,7 @@ static INT_PTR CALLBACK DlgProcIgnoreOpts(HWND hwndDlg, UINT msg, WPARAM, LPARAM HANDLE hItem = (HANDLE)SendDlgItemMessage(hwndDlg, IDC_LIST, CLM_FINDCONTACT, (WPARAM)hContact, 0);
if (hItem) SaveItemMask( GetDlgItem(hwndDlg, IDC_LIST), hContact, hItem, "Mask1");
if (SendDlgItemMessage(hwndDlg, IDC_LIST, CLM_GETCHECKMARK, (WPARAM)hItem, 0))
- DBDeleteContactSetting(hContact, "CList", "Hidden");
+ db_unset(hContact, "CList", "Hidden");
else
db_set_b(hContact, "CList", "Hidden", 1);
}
diff --git a/src/modules/netlib/netlib.cpp b/src/modules/netlib/netlib.cpp index 5758824627..f3ba8e0e12 100644 --- a/src/modules/netlib/netlib.cpp +++ b/src/modules/netlib/netlib.cpp @@ -103,8 +103,8 @@ void NetlibLeaveNestedCS(struct NetlibNestedCriticalSection *nlncs) static INT_PTR GetNetlibUserSettingInt(const char *szUserModule, const char *szSetting, int defValue)
{
DBVARIANT dbv;
- if (DBGetContactSetting(NULL, szUserModule, szSetting, &dbv)
- && DBGetContactSetting(NULL, "Netlib", szSetting, &dbv))
+ if (db_get(NULL, szUserModule, szSetting, &dbv)
+ && db_get(NULL, "Netlib", szSetting, &dbv))
return defValue;
if (dbv.type == DBVT_BYTE) return dbv.bVal;
if (dbv.type == DBVT_WORD) return dbv.wVal;
@@ -114,8 +114,8 @@ static INT_PTR GetNetlibUserSettingInt(const char *szUserModule, const char *szS static char *GetNetlibUserSettingString(const char *szUserModule, const char *szSetting, int decode)
{
DBVARIANT dbv;
- if (DBGetContactSettingString(NULL, szUserModule, szSetting, &dbv)
- && DBGetContactSettingString(NULL, "Netlib", szSetting, &dbv)) {
+ if (db_get_s(NULL, szUserModule, szSetting, &dbv)
+ && db_get_s(NULL, "Netlib", szSetting, &dbv)) {
return NULL;
}
else {
diff --git a/src/modules/netlib/netliblog.cpp b/src/modules/netlib/netliblog.cpp index 76331b51e3..b8567a494f 100644 --- a/src/modules/netlib/netliblog.cpp +++ b/src/modules/netlib/netliblog.cpp @@ -90,7 +90,7 @@ static INT_PTR CALLBACK LogOptionsDlgProc(HWND hwndDlg, UINT message, WPARAM wPa CheckDlgButton(hwndDlg, IDC_SHOWTHISDLGATSTART, db_get_b(NULL, "Netlib", "ShowLogOptsAtStart", 0)?BST_CHECKED:BST_UNCHECKED);
{
DBVARIANT dbv;
- if ( !DBGetContactSettingString(NULL, "Netlib", "RunAtStart", &dbv)) {
+ if ( !db_get_s(NULL, "Netlib", "RunAtStart", &dbv)) {
SetDlgItemTextA(hwndDlg, IDC_RUNATSTART, dbv.pszVal);
db_free(&dbv);
}
@@ -563,7 +563,7 @@ void NetlibLogInit(void) logOptions.toFile = db_get_b(NULL, "Netlib", "ToFile", 0);
logOptions.toLog = db_get_dw(NULL, "Netlib", "NLlog", 1);
- if ( !DBGetContactSettingTString(NULL, "Netlib", "File", &dbv)) {
+ if ( !db_get_ts(NULL, "Netlib", "File", &dbv)) {
logOptions.szUserFile = mir_tstrdup(dbv.ptszVal);
TCHAR path[MAX_PATH];
@@ -587,7 +587,7 @@ void NetlibLogInit(void) if (db_get_b(NULL, "Netlib", "ShowLogOptsAtStart", 0))
NetlibLogShowOptions();
- if ( !DBGetContactSettingTString(NULL, "Netlib", "RunAtStart", &dbv)) {
+ if ( !db_get_ts(NULL, "Netlib", "RunAtStart", &dbv)) {
STARTUPINFO si = { 0 };
PROCESS_INFORMATION pi;
si.cb = sizeof(si);
diff --git a/src/modules/netlib/netlibopts.cpp b/src/modules/netlib/netlibopts.cpp index 49be304e5b..b165f55156 100644 --- a/src/modules/netlib/netlibopts.cpp +++ b/src/modules/netlib/netlibopts.cpp @@ -201,7 +201,7 @@ static void WriteSettingsStructToDb(const char *szSettingsModule, NETLIBUSERSETT db_set_b(NULL, szSettingsModule, "NLUseProxy", (BYTE)settings->useProxy);
db_set_b(NULL, szSettingsModule, "NLProxyType", (BYTE)settings->proxyType);
db_set_s(NULL, szSettingsModule, "NLProxyServer", settings->szProxyServer?settings->szProxyServer:"");
- DBWriteContactSettingWord(NULL, szSettingsModule, "NLProxyPort", (WORD)settings->wProxyPort);
+ db_set_w(NULL, szSettingsModule, "NLProxyPort", (WORD)settings->wProxyPort);
db_set_b(NULL, szSettingsModule, "NLUseProxyAuth", (BYTE)settings->useProxyAuth);
db_set_s(NULL, szSettingsModule, "NLProxyAuthUser", settings->szProxyAuthUser?settings->szProxyAuthUser:"");
lstrcpynA(szEncodedPassword, settings->szProxyAuthPassword?settings->szProxyAuthPassword:"", SIZEOF(szEncodedPassword));
diff --git a/src/modules/options/options.cpp b/src/modules/options/options.cpp index 7c49a8c973..881258106e 100644 --- a/src/modules/options/options.cpp +++ b/src/modules/options/options.cpp @@ -687,13 +687,13 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hdlg, UINT message, WPARAM wParam, L dat->currentPage = -1;
if (ood->pszPage == NULL) {
- if ( !DBGetContactSettingTString(NULL, "Options", "LastPage", &dbv)) {
+ if ( !db_get_ts(NULL, "Options", "LastPage", &dbv)) {
lastPage = mir_tstrdup(dbv.ptszVal);
db_free(&dbv);
}
if (ood->pszGroup == NULL) {
- if ( !DBGetContactSettingTString(NULL, "Options", "LastGroup", &dbv)) {
+ if ( !db_get_ts(NULL, "Options", "LastGroup", &dbv)) {
lastGroup = mir_tstrdup(dbv.ptszVal);
db_free(&dbv);
}
@@ -706,7 +706,7 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hdlg, UINT message, WPARAM wParam, L }
if (ood->pszTab == NULL) {
- if ( !DBGetContactSettingTString(NULL, "Options", "LastTab", &dbv)) {
+ if ( !db_get_ts(NULL, "Options", "LastTab", &dbv)) {
lastTab = mir_tstrdup(dbv.ptszVal);
db_free(&dbv);
}
@@ -1192,17 +1192,17 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hdlg, UINT message, WPARAM wParam, L if (opd->ptszTab)
db_set_ts(NULL, "Options", "LastTab", opd->ptszTab);
else
- DBDeleteContactSetting(NULL, "Options", "LastTab");
+ db_unset(NULL, "Options", "LastTab");
if (opd->ptszGroup)
db_set_ts(NULL, "Options", "LastGroup", opd->ptszGroup);
else
- DBDeleteContactSetting(NULL, "Options", "LastGroup");
+ db_unset(NULL, "Options", "LastGroup");
db_set_ts(NULL, "Options", "LastPage", opd->ptszTitle);
}
else {
- DBDeleteContactSetting(NULL, "Options", "LastTab");
- DBDeleteContactSetting(NULL, "Options", "LastGroup");
- DBDeleteContactSetting(NULL, "Options", "LastPage");
+ db_unset(NULL, "Options", "LastTab");
+ db_unset(NULL, "Options", "LastGroup");
+ db_unset(NULL, "Options", "LastPage");
}
Utils_SaveWindowPosition(hdlg, NULL, "Options", "");
diff --git a/src/modules/protocols/protoaccs.cpp b/src/modules/protocols/protoaccs.cpp index ae487ea866..72f78988c3 100644 --- a/src/modules/protocols/protoaccs.cpp +++ b/src/modules/protocols/protoaccs.cpp @@ -44,7 +44,7 @@ LIST<PROTOACCOUNT> accounts(10, CompareAccounts); static int EnumDbModules(const char *szModuleName, DWORD ofsModuleName, LPARAM lParam)
{
DBVARIANT dbv;
- if ( !DBGetContactSettingString(NULL, szModuleName, "AM_BaseProto", &dbv)) {
+ if ( !db_get_s(NULL, szModuleName, "AM_BaseProto", &dbv)) {
if ( !Proto_GetAccount(szModuleName)) {
PROTOACCOUNT* pa = (PROTOACCOUNT*)mir_calloc(sizeof(PROTOACCOUNT));
pa->cbSize = sizeof(*pa);
@@ -70,7 +70,7 @@ void LoadDbAccounts(void) for (i=0; i < count; i++) {
char buf[10];
_itoa(i, buf, 10);
- if (DBGetContactSettingString(NULL, "Protocols", buf, &dbv))
+ if (db_get_s(NULL, "Protocols", buf, &dbv))
continue;
PROTOACCOUNT* pa = (PROTOACCOUNT*)mir_calloc(sizeof(PROTOACCOUNT));
@@ -91,7 +91,7 @@ void LoadDbAccounts(void) if (ver >= 4) {
db_free(&dbv);
_itoa(OFFSET_NAME+i, buf, 10);
- if ( !DBGetContactSettingTString(NULL, "Protocols", buf, &dbv)) {
+ if ( !db_get_ts(NULL, "Protocols", buf, &dbv)) {
pa->tszAccountName = mir_tstrdup(dbv.ptszVal);
db_free(&dbv);
}
@@ -99,7 +99,7 @@ void LoadDbAccounts(void) _itoa(OFFSET_ENABLED+i, buf, 10);
pa->bIsEnabled = db_get_dw(NULL, "Protocols", buf, 1);
- if ( !DBGetContactSettingString(NULL, pa->szModuleName, "AM_BaseProto", &dbv)) {
+ if ( !db_get_s(NULL, pa->szModuleName, "AM_BaseProto", &dbv)) {
pa->szProtoName = mir_strdup(dbv.pszVal);
db_free(&dbv);
}
@@ -163,7 +163,7 @@ void WriteDbAccounts() if (param.arrlen) {
int i;
for (i=0; i < param.arrlen; i++) {
- DBDeleteContactSetting(0, "Protocols", param.pszSettingName[i]);
+ db_unset(0, "Protocols", param.pszSettingName[i]);
mir_free(param.pszSettingName[i]);
}
mir_free(param.pszSettingName);
@@ -190,7 +190,7 @@ void WriteDbAccounts() db_set_ts(NULL, "Protocols", buf, pa->tszAccountName);
}
- DBDeleteContactSetting(0, "Protocols", "ProtoCount");
+ db_unset(0, "Protocols", "ProtoCount");
db_set_dw(0, "Protocols", "ProtoCount", accounts.getCount());
db_set_dw(0, "Protocols", "PrVer", 4);
}
diff --git a/src/modules/protocols/protoopts.cpp b/src/modules/protocols/protoopts.cpp index 4eec5c28b1..90e9ac6df6 100644 --- a/src/modules/protocols/protoopts.cpp +++ b/src/modules/protocols/protoopts.cpp @@ -174,7 +174,7 @@ static INT_PTR CALLBACK AccFormDlgProc(HWND hwndDlg, UINT message, WPARAM wParam for (;;) {
DBVARIANT dbv;
mir_snprintf(buf, SIZEOF(buf), "%s_%d", pa->szProtoName, count++);
- if (DBGetContactSettingString(NULL, buf, "AM_BaseProto", &dbv))
+ if (db_get_s(NULL, buf, "AM_BaseProto", &dbv))
break;
db_free(&dbv);
}
diff --git a/src/modules/skin/hotkey_opts.cpp b/src/modules/skin/hotkey_opts.cpp index ed6a4bd40b..07c31fdc91 100644 --- a/src/modules/skin/hotkey_opts.cpp +++ b/src/modules/skin/hotkey_opts.cpp @@ -319,7 +319,7 @@ static void sttOptionsSaveItem(THotkeyItem *item) item->type = item->OptType;
item->Enabled = item->OptEnabled;
- DBWriteContactSettingWord(NULL, DBMODULENAME, item->pszName, item->Hotkey);
+ db_set_w(NULL, DBMODULENAME, item->pszName, item->Hotkey);
db_set_b(NULL, DBMODULENAME "Off", item->pszName, (BYTE)!item->Enabled);
if (item->type != HKT_MANUAL)
db_set_b(NULL, DBMODULENAME "Types", item->pszName, (BYTE)item->type);
@@ -332,7 +332,7 @@ static void sttOptionsSaveItem(THotkeyItem *item) subItem->type = subItem->OptType;
mir_snprintf(buf, SIZEOF(buf), "%s$%d", item->pszName, item->nSubHotkeys);
- DBWriteContactSettingWord(NULL, DBMODULENAME, buf, subItem->Hotkey);
+ db_set_w(NULL, DBMODULENAME, buf, subItem->Hotkey);
if (subItem->type != HKT_MANUAL)
db_set_b(NULL, DBMODULENAME "Types", buf, (BYTE)subItem->type);
diff --git a/src/modules/skin/hotkeys.cpp b/src/modules/skin/hotkeys.cpp index d7635de2d5..4da60bfbb8 100644 --- a/src/modules/skin/hotkeys.cpp +++ b/src/modules/skin/hotkeys.cpp @@ -375,13 +375,13 @@ int LoadSkinHotkeys(void) WORD key;
if ((key = db_get_w(NULL, "Clist", szSetting, 0))) {
- DBDeleteContactSetting(NULL, "Clist", szSetting);
- DBWriteContactSettingWord(NULL, DBMODULENAME, newSettings[i], key);
+ db_unset(NULL, "Clist", szSetting);
+ db_set_w(NULL, DBMODULENAME, newSettings[i], key);
}
mir_snprintf(szSetting, SIZEOF(szSetting), "HKEn%s", oldSettings[i]);
if ((key = db_get_b(NULL, "Clist", szSetting, 0))) {
- DBDeleteContactSetting(NULL, "Clist", szSetting);
+ db_unset(NULL, "Clist", szSetting);
db_set_b(NULL, DBMODULENAME "Off", newSettings[i], (BYTE)(key == 0));
}
}
diff --git a/src/modules/skin/skinicons.cpp b/src/modules/skin/skinicons.cpp index cd959b877a..d2f602be45 100644 --- a/src/modules/skin/skinicons.cpp +++ b/src/modules/skin/skinicons.cpp @@ -380,13 +380,13 @@ static void convertOneProtocol(char *moduleName, char *iconName) _itoa(statusIcons[i].id, pm, 10);
DBVARIANT dbv;
- if ( !DBGetContactSettingTString(NULL, "Icons", moduleName, &dbv)) {
+ if ( !db_get_ts(NULL, "Icons", moduleName, &dbv)) {
_itoa(i, pi, 10);
db_set_ts(NULL, "SkinIcons", iconName, dbv.ptszVal);
db_free(&dbv);
- DBDeleteContactSetting(NULL, "Icons", moduleName);
+ db_unset(NULL, "Icons", moduleName);
} } }
static INT_PTR sttLoadSkinIcon(WPARAM wParam, LPARAM lParam)
@@ -422,7 +422,7 @@ int LoadSkinIcons(void) for (i=0; i < SIZEOF(mainIcons); i++) {
_itoa(mainIcons[i].id, moduleName, 10);
- if (DBGetContactSettingTString(NULL, "Icons", moduleName, &dbv))
+ if (db_get_ts(NULL, "Icons", moduleName, &dbv))
break;
mir_snprintf(iconName, SIZEOF(iconName), "%s%d", mainIconsFmt, i);
@@ -430,7 +430,7 @@ int LoadSkinIcons(void) db_set_ts(NULL, "SkinIcons", iconName, dbv.ptszVal);
db_free(&dbv);
- DBDeleteContactSetting(NULL, "Icons", moduleName);
+ db_unset(NULL, "Icons", moduleName);
}
for (;;) {
@@ -438,10 +438,10 @@ int LoadSkinIcons(void) moduleName[0] = 'p';
moduleName[1] = 0;
_itoa(j++, moduleName+1, 100);
- if (DBGetContactSettingTString(NULL, "Icons", moduleName, &dbv))
+ if (db_get_ts(NULL, "Icons", moduleName, &dbv))
break;
- DBDeleteContactSetting(NULL, "Icons", moduleName);
+ db_unset(NULL, "Icons", moduleName);
// make old skinicons' prefix
mir_snprintf(moduleName, SIZEOF(moduleName), "%S", dbv.ptszVal);
diff --git a/src/modules/skin/sounds.cpp b/src/modules/skin/sounds.cpp index 614c99f1f4..aba9154f15 100644 --- a/src/modules/skin/sounds.cpp +++ b/src/modules/skin/sounds.cpp @@ -93,7 +93,7 @@ static INT_PTR ServiceSkinAddNewSound(WPARAM wParam, LPARAM lParam) if (ptszDefaultFile) {
DBVARIANT dbv;
- if (DBGetContactSettingString(NULL, "SkinSounds", item->name, &dbv))
+ if (db_get_s(NULL, "SkinSounds", item->name, &dbv))
db_set_ts(NULL, "SkinSounds", item->name, ptszDefaultFile);
else
db_free(&dbv);
@@ -139,7 +139,7 @@ static INT_PTR ServiceSkinPlaySound(WPARAM, LPARAM lParam) return 1;
DBVARIANT dbv;
- if ( DBGetContactSettingTString(NULL, "SkinSounds", pszSoundName, &dbv) == 0) {
+ if ( db_get_ts(NULL, "SkinSounds", pszSoundName, &dbv) == 0) {
ServiceSkinPlaySoundFile(0, (LPARAM)dbv.ptszVal);
db_free(&dbv);
return 0;
@@ -261,7 +261,7 @@ INT_PTR CALLBACK DlgProcSoundOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM NotifyEventHooks(hPlayEvent, 1, (LPARAM)arSounds[tvi.lParam].ptszTempFile);
else {
DBVARIANT dbv;
- if ( !DBGetContactSettingTString(NULL, "SkinSounds", arSounds[tvi.lParam].name, &dbv)) {
+ if ( !db_get_ts(NULL, "SkinSounds", arSounds[tvi.lParam].name, &dbv)) {
TCHAR szPathFull[MAX_PATH];
PathToAbsoluteT(dbv.ptszVal, szPathFull);
NotifyEventHooks(hPlayEvent, 1, (LPARAM)szPathFull);
@@ -292,7 +292,7 @@ INT_PTR CALLBACK DlgProcSoundOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM else {
if (db_get_b(NULL, "SkinSoundsOff", snd.name, 0) == 0) {
DBVARIANT dbv;
- if (DBGetContactSettingTString(NULL, "SkinSounds", snd.name, &dbv) == 0) {
+ if (db_get_ts(NULL, "SkinSounds", snd.name, &dbv) == 0) {
PathToAbsoluteT(dbv.ptszVal, strdir);
db_free(&dbv);
} } }
@@ -394,7 +394,7 @@ INT_PTR CALLBACK DlgProcSoundOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM SetDlgItemText(hwndDlg, IDC_LOCATION, arSounds[tvi.lParam].ptszTempFile);
else {
DBVARIANT dbv;
- if ( !DBGetContactSettingTString(NULL, "SkinSounds", arSounds[tvi.lParam].name, &dbv)) {
+ if ( !db_get_ts(NULL, "SkinSounds", arSounds[tvi.lParam].name, &dbv)) {
SetDlgItemText(hwndDlg, IDC_LOCATION, dbv.ptszVal);
db_free(&dbv);
}
diff --git a/src/modules/utils/openurl.cpp b/src/modules/utils/openurl.cpp index 764169f268..70590c8ebf 100644 --- a/src/modules/utils/openurl.cpp +++ b/src/modules/utils/openurl.cpp @@ -56,7 +56,7 @@ static void OpenURLThread(void *arg) // check user defined browser for opening urls
DBVARIANT dbv;
- if (!DBGetContactSettingTString(NULL, "Miranda", "OpenUrlBrowser", &dbv)) {
+ if (!db_get_ts(NULL, "Miranda", "OpenUrlBrowser", &dbv)) {
ShellExecute(NULL, _T("open"), dbv.ptszVal, szResult, NULL, (hUrlInfo->newWindow) ? SW_NORMAL : SW_SHOWDEFAULT);
db_free(&dbv);
}
diff --git a/src/modules/utils/path.cpp b/src/modules/utils/path.cpp index 75fad634e8..40c591a1e4 100644 --- a/src/modules/utils/path.cpp +++ b/src/modules/utils/path.cpp @@ -70,7 +70,7 @@ TCHAR *GetContactID(HANDLE hContact) char *szProto = GetContactProto(hContact);
if (db_get_b(hContact, szProto, "ChatRoom", 0) == 1) {
DBVARIANT dbv;
- if ( !DBGetContactSettingTString(hContact, szProto, "ChatRoomID", &dbv)) {
+ if ( !db_get_ts(hContact, szProto, "ChatRoomID", &dbv)) {
theValue = (TCHAR *)mir_tstrdup(dbv.ptszVal);
db_free(&dbv);
return theValue;
diff --git a/src/modules/utils/timezones.cpp b/src/modules/utils/timezones.cpp index a22dd4ef26..8bcd80f4ac 100644 --- a/src/modules/utils/timezones.cpp +++ b/src/modules/utils/timezones.cpp @@ -199,7 +199,7 @@ static HANDLE timeapiGetInfoByContact(HANDLE hContact, DWORD dwFlags) return (dwFlags & (TZF_DIFONLY | TZF_KNOWNONLY)) ? NULL : &myInfo.myTZ;
DBVARIANT dbv;
- if ( !DBGetContactSettingTString(hContact, "UserInfo", "TzName", &dbv))
+ if ( !db_get_ts(hContact, "UserInfo", "TzName", &dbv))
{
HANDLE res = timeapiGetInfoByName(dbv.ptszVal, dwFlags);
db_free(&dbv);
@@ -210,7 +210,7 @@ static HANDLE timeapiGetInfoByContact(HANDLE hContact, DWORD dwFlags) if (timezone == -1)
{
char* szProto = GetContactProto(hContact);
- if ( !DBGetContactSettingTString(hContact, szProto, "TzName", &dbv))
+ if ( !db_get_ts(hContact, szProto, "TzName", &dbv))
{
HANDLE res = timeapiGetInfoByName(dbv.ptszVal, dwFlags);
db_free(&dbv);
@@ -265,8 +265,8 @@ static void timeapiSetInfoByContact(HANDLE hContact, HANDLE hTZ) }
else
{
- DBDeleteContactSetting(hContact, "UserInfo", "TzName");
- DBDeleteContactSetting(hContact, "UserInfo", "Timezone");
+ db_unset(hContact, "UserInfo", "TzName");
+ db_unset(hContact, "UserInfo", "Timezone");
}
}
@@ -391,7 +391,7 @@ static int timeapiSelectListItem(HANDLE hContact, HWND hWnd, DWORD dwFlags) if (hContact)
{
DBVARIANT dbv;
- if ( !DBGetContactSettingTString(hContact, "UserInfo", "TzName", &dbv))
+ if ( !db_get_ts(hContact, "UserInfo", "TzName", &dbv))
{
unsigned hash = mir_hashstrT(dbv.ptszVal);
for (int i=0; i < g_timezonesBias.getCount(); i++)
|