summaryrefslogtreecommitdiff
path: root/src/core/stduserinfo
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/stduserinfo')
-rw-r--r--src/core/stduserinfo/contactinfo.cpp54
-rw-r--r--src/core/stduserinfo/stdinfo.cpp42
-rw-r--r--src/core/stduserinfo/userinfo.cpp4
3 files changed, 50 insertions, 50 deletions
diff --git a/src/core/stduserinfo/contactinfo.cpp b/src/core/stduserinfo/contactinfo.cpp
index 993d8de838..21fcb7a203 100644
--- a/src/core/stduserinfo/contactinfo.cpp
+++ b/src/core/stduserinfo/contactinfo.cpp
@@ -271,13 +271,13 @@ INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
lvi.iItem = 0;
for (i = -1;; i++) {
if (i == -1) {
- if (DBGetContactSettingTString(hContact, szProto, "e-mail", &dbv))
+ if (db_get_ts(hContact, szProto, "e-mail", &dbv))
continue;
lvi.pszText = TranslateT("Primary");
}
else {
mir_snprintf(idstr, SIZEOF(idstr), "e-mail%d", i);
- if (DBGetContactSettingTString(hContact, szProto, idstr, &dbv))
+ if (db_get_ts(hContact, szProto, idstr, &dbv))
break;
lvi.pszText = idstr2;
@@ -285,20 +285,20 @@ INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
}
ListView_InsertItem(GetDlgItem(hwndDlg, IDC_EMAILS), &lvi);
ListView_SetItemText(GetDlgItem(hwndDlg, IDC_EMAILS), lvi.iItem, 1, dbv.ptszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
lvi.iItem++;
}
lvi.iSubItem = 0;
for (i=0;;i++) {
lvi.lParam = i;
mir_snprintf(idstr, SIZEOF(idstr), "Mye-mail%d", i);
- if (DBGetContactSettingTString(hContact, "UserInfo", idstr, &dbv))
+ if (db_get_ts(hContact, "UserInfo", idstr, &dbv))
break;
lvi.pszText = idstr2;
mir_sntprintf(idstr2, SIZEOF(idstr2), TranslateT("Custom %d"), i+1);
ListView_InsertItem(GetDlgItem(hwndDlg, IDC_EMAILS), &lvi);
ListView_SetItemText(GetDlgItem(hwndDlg, IDC_EMAILS), lvi.iItem, 1, dbv.ptszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
lvi.iItem++;
}
lvi.mask = LVIF_PARAM;
@@ -310,21 +310,21 @@ INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
lvi.lParam = (LPARAM)(-1);
lvi.iSubItem = 0;
lvi.iItem = 0;
- if ( !DBGetContactSettingTString(hContact, szProto, "Phone", &dbv)) {
+ if ( !db_get_ts(hContact, szProto, "Phone", &dbv)) {
lvi.pszText = TranslateT("Primary");
ListView_InsertItem(GetDlgItem(hwndDlg, IDC_PHONES), &lvi);
ListView_SetItemText(GetDlgItem(hwndDlg, IDC_PHONES), lvi.iItem, 1, dbv.ptszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
lvi.iItem++;
}
- if ( !DBGetContactSettingTString(hContact, szProto, "Fax", &dbv)) {
+ if ( !db_get_ts(hContact, szProto, "Fax", &dbv)) {
lvi.pszText = TranslateT("Fax");
ListView_InsertItem(GetDlgItem(hwndDlg, IDC_PHONES), &lvi);
ListView_SetItemText(GetDlgItem(hwndDlg, IDC_PHONES), lvi.iItem, 1, dbv.ptszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
lvi.iItem++;
}
- if ( !DBGetContactSettingTString(hContact, szProto, "Cellular", &dbv)) {
+ if ( !db_get_ts(hContact, szProto, "Cellular", &dbv)) {
lvi.pszText = TranslateT("Mobile");
ListView_InsertItem(GetDlgItem(hwndDlg, IDC_PHONES), &lvi);
if (lstrlenA(dbv.pszVal)>4 && !lstrcmpA(dbv.pszVal+lstrlenA(dbv.pszVal)-4, " SMS")) {
@@ -332,28 +332,28 @@ INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
dbv.ptszVal[lstrlen(dbv.ptszVal)-4] = '\0';
}
ListView_SetItemText(GetDlgItem(hwndDlg, IDC_PHONES), lvi.iItem, 1, dbv.ptszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
lvi.iItem++;
}
- if ( !DBGetContactSettingTString(hContact, szProto, "CompanyPhone", &dbv)) {
+ if ( !db_get_ts(hContact, szProto, "CompanyPhone", &dbv)) {
lvi.pszText = TranslateT("Work Phone");
ListView_InsertItem(GetDlgItem(hwndDlg, IDC_PHONES), &lvi);
ListView_SetItemText(GetDlgItem(hwndDlg, IDC_PHONES), lvi.iItem, 1, dbv.ptszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
lvi.iItem++;
}
- if ( !DBGetContactSettingTString(hContact, szProto, "CompanyFax", &dbv)) {
+ if ( !db_get_ts(hContact, szProto, "CompanyFax", &dbv)) {
lvi.pszText = TranslateT("Work Fax");
ListView_InsertItem(GetDlgItem(hwndDlg, IDC_PHONES), &lvi);
ListView_SetItemText(GetDlgItem(hwndDlg, IDC_PHONES), lvi.iItem, 1, dbv.ptszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
lvi.iItem++;
}
lvi.iSubItem = 0;
for (i=0;; i++) {
lvi.lParam = i;
mir_snprintf(idstr, SIZEOF(idstr), "MyPhone%d", i);
- if (DBGetContactSettingTString(hContact, "UserInfo", idstr, &dbv))
+ if (db_get_ts(hContact, "UserInfo", idstr, &dbv))
break;
lvi.pszText = idstr2;
mir_sntprintf(idstr2, SIZEOF(idstr2), TranslateT("Custom %d"), i+1);
@@ -363,7 +363,7 @@ INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
dbv.ptszVal[lstrlen(dbv.ptszVal)-4] = '\0';
}
ListView_SetItemText(GetDlgItem(hwndDlg, IDC_PHONES), lvi.iItem, 1, dbv.ptszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
lvi.iItem++;
}
lvi.mask = LVIF_PARAM;
@@ -464,10 +464,10 @@ INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
break;
for (int i=0;; i++) {
mir_snprintf(idstr, SIZEOF(idstr), szIdTemplate, i);
- if (DBGetContactSettingString(hContact, "UserInfo", idstr, &dbv)) break;
- DBFreeVariant(&dbv);
+ if (db_get_s(hContact, "UserInfo", idstr, &dbv)) break;
+ db_free(&dbv);
}
- DBWriteContactSettingString(hContact, "UserInfo", idstr, szNewData);
+ db_set_s(hContact, "UserInfo", idstr, szNewData);
SendMessage(hwndDlg, M_REMAKELISTS, 0, 0);
}
}
@@ -477,13 +477,13 @@ INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
DBVARIANT dbv;
for (i = lvi.lParam;;i++) {
mir_snprintf(idstr, SIZEOF(idstr), szIdTemplate, i+1);
- if (DBGetContactSettingString(hContact, "UserInfo", idstr, &dbv)) break;
+ if (db_get_s(hContact, "UserInfo", idstr, &dbv)) break;
mir_snprintf(idstr, SIZEOF(idstr), szIdTemplate, i);
- DBWriteContactSettingString(hContact, "UserInfo", idstr, dbv.pszVal);
- DBFreeVariant(&dbv);
+ db_set_s(hContact, "UserInfo", idstr, dbv.pszVal);
+ db_free(&dbv);
}
mir_snprintf(idstr, SIZEOF(idstr), szIdTemplate, i);
- DBDeleteContactSetting(hContact, "UserInfo", idstr);
+ db_unset(hContact, "UserInfo", idstr);
SendMessage(hwndDlg, M_REMAKELISTS, 0, 0);
}
else if (hti.iSubItem-2 == (nm->hdr.idFrom == IDC_PHONES)) {
@@ -491,12 +491,12 @@ INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
char szText[256], idstr[33];
DBVARIANT dbv;
mir_snprintf(idstr, SIZEOF(idstr), szIdTemplate, lvi.lParam);
- if (DBGetContactSettingString(hContact, "UserInfo", idstr, &dbv)) break;
+ if (db_get_s(hContact, "UserInfo", idstr, &dbv)) break;
lstrcpynA(szText, dbv.pszVal, SIZEOF(szText));
- DBFreeVariant(&dbv);
+ db_free(&dbv);
if (IDOK != DialogBoxParam(hInst, MAKEINTRESOURCE(nm->hdr.idFrom == IDC_PHONES?IDD_ADDPHONE:IDD_ADDEMAIL), hwndDlg, nm->hdr.idFrom == IDC_PHONES?EditUserPhoneDlgProc:EditUserEmailDlgProc, (LPARAM)szText))
break;
- DBWriteContactSettingString(hContact, "UserInfo", idstr, szText);
+ db_set_s(hContact, "UserInfo", idstr, szText);
SendMessage(hwndDlg, M_REMAKELISTS, 0, 0);
}
}
diff --git a/src/core/stduserinfo/stdinfo.cpp b/src/core/stduserinfo/stdinfo.cpp
index 41f394cbba..033cb23cac 100644
--- a/src/core/stduserinfo/stdinfo.cpp
+++ b/src/core/stduserinfo/stdinfo.cpp
@@ -114,7 +114,7 @@ static void SetValue(HWND hwndDlg, int idCtrl, HANDLE hContact, char *szModule,
if (wSave == (WORD)-1) {
char szSettingName[100];
mir_snprintf(szSettingName, SIZEOF(szSettingName), "%sName", szSetting);
- if ( !DBGetContactSettingTString(hContact, szModule, szSettingName, &dbv)) {
+ if ( !db_get_ts(hContact, szModule, szSettingName, &dbv)) {
ptstr = dbv.ptszVal;
unspecified = false;
break;
@@ -179,7 +179,7 @@ LBL_Exit:
if (proto_service)
Proto_FreeInfoVariant(&dbv);
else
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
static INT_PTR CALLBACK SummaryDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
@@ -410,38 +410,38 @@ static INT_PTR CALLBACK BackgroundDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam,
for (i=0;;i++) {
mir_snprintf(idstr, SIZEOF(idstr), "Past%d", i);
if ((proto_service && Proto_GetContactInfoSetting(hContact, szProto, szProto, idstr, &dbv, DBVT_TCHAR)) ||
- ( !proto_service && DBGetContactSettingTString(hContact, szProto, idstr, &dbv)))
+ ( !proto_service && db_get_ts(hContact, szProto, idstr, &dbv)))
break;
mir_snprintf(idstr, SIZEOF(idstr), "Past%dText", i);
- if (DBGetContactSettingTString(hContact, szProto, idstr, &dbvText))
- {if (proto_service) Proto_FreeInfoVariant(&dbv); else DBFreeVariant(&dbv); break;}
+ if (db_get_ts(hContact, szProto, idstr, &dbvText))
+ {if (proto_service) Proto_FreeInfoVariant(&dbv); else db_free(&dbv); break;}
lvi.pszText = dbv.ptszVal;
ListView_InsertItem(GetDlgItem(hwndDlg, IDC_PAST), &lvi);
ListView_SetItemText(GetDlgItem(hwndDlg, IDC_PAST), lvi.iItem, 1, dbvText.ptszVal);
- DBFreeVariant(&dbvText);
+ db_free(&dbvText);
if (proto_service)
Proto_FreeInfoVariant(&dbv);
else
- DBFreeVariant(&dbv);
+ db_free(&dbv);
lvi.iItem++;
}
for (i=0;;i++) {
mir_snprintf(idstr, SIZEOF(idstr), "Affiliation%d", i);
if ((proto_service && Proto_GetContactInfoSetting(hContact, szProto, szProto, idstr, &dbv, DBVT_TCHAR)) ||
- ( !proto_service && DBGetContactSettingTString(hContact, szProto, idstr, &dbv)))
+ ( !proto_service && db_get_ts(hContact, szProto, idstr, &dbv)))
break;
mir_snprintf(idstr, SIZEOF(idstr), "Affiliation%dText", i);
- if (DBGetContactSettingTString(hContact, szProto, idstr, &dbvText))
- {if (proto_service) Proto_FreeInfoVariant(&dbv); else DBFreeVariant(&dbv); break;}
+ if (db_get_ts(hContact, szProto, idstr, &dbvText))
+ {if (proto_service) Proto_FreeInfoVariant(&dbv); else db_free(&dbv); break;}
lvi.pszText = dbv.ptszVal;
ListView_InsertItem(GetDlgItem(hwndDlg, IDC_PAST), &lvi);
ListView_SetItemText(GetDlgItem(hwndDlg, IDC_PAST), lvi.iItem, 1, dbvText.ptszVal);
- DBFreeVariant(&dbvText);
+ db_free(&dbvText);
if (proto_service)
Proto_FreeInfoVariant(&dbv);
else
- DBFreeVariant(&dbv);
+ db_free(&dbv);
lvi.iItem++;
}
@@ -455,19 +455,19 @@ static INT_PTR CALLBACK BackgroundDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam,
for (i=0;;i++) {
mir_snprintf(idstr, SIZEOF(idstr), "Interest%dCat", i);
if ((proto_service && Proto_GetContactInfoSetting(hContact, szProto, szProto, idstr, &dbv, DBVT_TCHAR)) ||
- ( !proto_service && DBGetContactSettingTString(hContact, szProto, idstr, &dbv)))
+ ( !proto_service && db_get_ts(hContact, szProto, idstr, &dbv)))
break;
mir_snprintf(idstr, SIZEOF(idstr), "Interest%dText", i);
- if (DBGetContactSettingTString(hContact, szProto, idstr, &dbvText))
- {if (proto_service) Proto_FreeInfoVariant(&dbv); else DBFreeVariant(&dbv); break;}
+ if (db_get_ts(hContact, szProto, idstr, &dbvText))
+ {if (proto_service) Proto_FreeInfoVariant(&dbv); else db_free(&dbv); break;}
lvi.pszText = dbv.ptszVal;
ListView_InsertItem(GetDlgItem(hwndDlg, IDC_INTERESTS), &lvi);
ListView_SetItemText(GetDlgItem(hwndDlg, IDC_INTERESTS), lvi.iItem, 1, dbvText.ptszVal);
- DBFreeVariant(&dbvText);
+ db_free(&dbvText);
if (proto_service)
Proto_FreeInfoVariant(&dbv);
else
- DBFreeVariant(&dbv);
+ db_free(&dbv);
lvi.iItem++;
}
ResizeColumns(GetDlgItem(hwndDlg, IDC_INTERESTS));
@@ -521,9 +521,9 @@ static INT_PTR CALLBACK NotesDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
hFont = CreateFontIndirect(&lf);
SendDlgItemMessage(hwndDlg, IDC_ABOUT, WM_SETFONT, (WPARAM) hFont, MAKELPARAM(TRUE, 0));
- if ( !DBGetContactSettingString((HANDLE)lParam, "UserInfo", "MyNotes", &dbv)) {
+ if ( !db_get_s((HANDLE)lParam, "UserInfo", "MyNotes", &dbv)) {
SetDlgItemTextA(hwndDlg, IDC_MYNOTES, dbv.pszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
SendDlgItemMessage(hwndDlg, IDC_MYNOTES, EM_LIMITTEXT, 2048, 0);
@@ -547,9 +547,9 @@ static INT_PTR CALLBACK NotesDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
if (GetWindowTextLength(GetDlgItem(hwndDlg, IDC_MYNOTES))) {
char text[2048];
GetDlgItemTextA(hwndDlg, IDC_MYNOTES, text, SIZEOF(text));
- DBWriteContactSettingString(hContact, "UserInfo", "MyNotes", text);
+ db_set_s(hContact, "UserInfo", "MyNotes", text);
}
- else DBDeleteContactSetting(hContact, "UserInfo", "MyNotes");
+ else db_unset(hContact, "UserInfo", "MyNotes");
break;
}
}
diff --git a/src/core/stduserinfo/userinfo.cpp b/src/core/stduserinfo/userinfo.cpp
index edee081064..d9bf4050b3 100644
--- a/src/core/stduserinfo/userinfo.cpp
+++ b/src/core/stduserinfo/userinfo.cpp
@@ -274,7 +274,7 @@ static INT_PTR CALLBACK DlgProcDetails(HWND hwndDlg, UINT msg, WPARAM wParam, LP
LPTSTR ptszLastTab;
DBVARIANT dbv;
- if ( !DBGetContactSettingTString(NULL, "UserInfo", "LastTab", &dbv)) {
+ if ( !db_get_ts(NULL, "UserInfo", "LastTab", &dbv)) {
ptszLastTab = NEWTSTR_ALLOCA(dbv.ptszVal);
db_free(&dbv);
}
@@ -594,7 +594,7 @@ static INT_PTR CALLBACK DlgProcDetails(HWND hwndDlg, UINT msg, WPARAM wParam, LP
tvi.pszText = name;
tvi.cchTextMax = SIZEOF(name);
TreeView_GetItem(GetDlgItem(hwndDlg, IDC_PAGETREE), &tvi);
- DBWriteContactSettingTString(NULL, "UserInfo", "LastTab", name);
+ db_set_ts(NULL, "UserInfo", "LastTab", name);
Window_FreeIcon_IcoLib(hwndDlg);
SendDlgItemMessage(hwndDlg, IDC_NAME, WM_SETFONT, SendDlgItemMessage(hwndDlg, IDC_WHITERECT, WM_GETFONT, 0, 0), 0);