diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/core/stdaway/src/sendmsg.cpp | 26 | ||||
-rw-r--r-- | src/core/stdfile/src/fileopts.cpp | 2 | ||||
-rw-r--r-- | src/core/stdfile/src/filerecvdlg.cpp | 4 | ||||
-rw-r--r-- | src/core/stdfile/src/filexferdlg.cpp | 8 | ||||
-rw-r--r-- | src/core/stdmsg/src/chat_options.cpp | 2 | ||||
-rw-r--r-- | src/core/stdmsg/src/msgdialog.cpp | 4 | ||||
-rw-r--r-- | src/core/stduserinfo/src/contactinfo.cpp | 22 | ||||
-rw-r--r-- | src/core/stduserinfo/src/stdinfo.cpp | 4 | ||||
-rw-r--r-- | src/core/stduserinfo/src/userinfo.cpp | 2 | ||||
-rw-r--r-- | src/mir_app/src/chat_opts.cpp | 2 | ||||
-rw-r--r-- | src/mir_app/src/clcitems.cpp | 8 | ||||
-rw-r--r-- | src/mir_app/src/clistsettings.cpp | 2 | ||||
-rw-r--r-- | src/mir_app/src/clui.cpp | 2 | ||||
-rw-r--r-- | src/mir_app/src/contacts.cpp | 6 | ||||
-rw-r--r-- | src/mir_app/src/meta_edit.cpp | 2 | ||||
-rw-r--r-- | src/mir_app/src/meta_services.cpp | 11 | ||||
-rw-r--r-- | src/mir_app/src/movetogroup.cpp | 6 | ||||
-rw-r--r-- | src/mir_app/src/sounds.cpp | 6 | ||||
-rw-r--r-- | src/mir_core/src/CDbLink.cpp | 2 | ||||
-rw-r--r-- | src/mir_core/src/timezones.cpp | 4 |
20 files changed, 61 insertions, 64 deletions
diff --git a/src/core/stdaway/src/sendmsg.cpp b/src/core/stdaway/src/sendmsg.cpp index 377f9e5200..b9a0a492e1 100644 --- a/src/core/stdaway/src/sendmsg.cpp +++ b/src/core/stdaway/src/sendmsg.cpp @@ -89,18 +89,18 @@ static wchar_t* GetAwayMessage(int statusMode, char *szProto) DBVARIANT dbv;
if (GetStatusModeByte(statusMode, "UsePrev")) {
if (db_get_ws(NULL, MODULENAME, StatusModeToDbSetting(statusMode, "Msg"), &dbv))
- dbv.ptszVal = mir_wstrdup(GetDefaultMessage(statusMode));
+ dbv.pwszVal = mir_wstrdup(GetDefaultMessage(statusMode));
}
else {
if (db_get_ws(NULL, MODULENAME, StatusModeToDbSetting(statusMode, "Default"), &dbv))
- dbv.ptszVal = mir_wstrdup(GetDefaultMessage(statusMode));
+ dbv.pwszVal = mir_wstrdup(GetDefaultMessage(statusMode));
- for (int i = 0; dbv.ptszVal[i]; i++) {
- if (dbv.ptszVal[i] != '%')
+ for (int i = 0; dbv.pwszVal[i]; i++) {
+ if (dbv.pwszVal[i] != '%')
continue;
wchar_t substituteStr[128];
- if (!wcsnicmp(dbv.ptszVal + i, L"%time%", 6)) {
+ if (!wcsnicmp(dbv.pwszVal + i, L"%time%", 6)) {
MIRANDA_IDLE_INFO mii;
Idle_GetInfo(mii);
@@ -116,17 +116,17 @@ static wchar_t* GetAwayMessage(int statusMode, char *szProto) }
else GetTimeFormat(LOCALE_USER_DEFAULT, TIME_NOSECONDS, NULL, NULL, substituteStr, _countof(substituteStr));
}
- else if (!wcsnicmp(dbv.ptszVal + i, L"%date%", 6))
+ else if (!wcsnicmp(dbv.pwszVal + i, L"%date%", 6))
GetDateFormat(LOCALE_USER_DEFAULT, DATE_SHORTDATE, NULL, NULL, substituteStr, _countof(substituteStr));
else continue;
if (mir_wstrlen(substituteStr) > 6)
- dbv.ptszVal = (wchar_t*)mir_realloc(dbv.ptszVal, (mir_wstrlen(dbv.ptszVal) + 1 + mir_wstrlen(substituteStr) - 6) * sizeof(wchar_t));
- memmove(dbv.ptszVal + i + mir_wstrlen(substituteStr), dbv.ptszVal + i + 6, (mir_wstrlen(dbv.ptszVal) - i - 5) * sizeof(wchar_t));
- memcpy(dbv.ptszVal + i, substituteStr, mir_wstrlen(substituteStr) * sizeof(wchar_t));
+ dbv.pwszVal = (wchar_t*)mir_realloc(dbv.pwszVal, (mir_wstrlen(dbv.pwszVal) + 1 + mir_wstrlen(substituteStr) - 6) * sizeof(wchar_t));
+ memmove(dbv.pwszVal + i + mir_wstrlen(substituteStr), dbv.pwszVal + i + 6, (mir_wstrlen(dbv.pwszVal) - i - 5) * sizeof(wchar_t));
+ memcpy(dbv.pwszVal + i, substituteStr, mir_wstrlen(substituteStr) * sizeof(wchar_t));
}
}
- return dbv.ptszVal;
+ return dbv.pwszVal;
}
static LRESULT CALLBACK MessageEditSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
@@ -390,9 +390,9 @@ static INT_PTR CALLBACK DlgProcAwayMsgOpts(HWND hwndDlg, UINT msg, WPARAM wParam DBVARIANT dbv;
if (db_get_ws(NULL, MODULENAME, StatusModeToDbSetting(it, "Default"), &dbv))
if (db_get_ws(NULL, MODULENAME, StatusModeToDbSetting(it, "Msg"), &dbv))
- dbv.ptszVal = mir_wstrdup(GetDefaultMessage(it));
- mir_wstrcpy(dat->info[j].msg, dbv.ptszVal);
- mir_free(dbv.ptszVal);
+ dbv.pwszVal = mir_wstrdup(GetDefaultMessage(it));
+ mir_wstrcpy(dat->info[j].msg, dbv.pwszVal);
+ mir_free(dbv.pwszVal);
}
if (hLst)
SendDlgItemMessage(hwndDlg, IDC_LST_STATUS, LB_SETCURSEL, 0, 0);
diff --git a/src/core/stdfile/src/fileopts.cpp b/src/core/stdfile/src/fileopts.cpp index 6e98fb682c..41d8717635 100644 --- a/src/core/stdfile/src/fileopts.cpp +++ b/src/core/stdfile/src/fileopts.cpp @@ -91,7 +91,7 @@ static INT_PTR CALLBACK DlgProcFileOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L DBVARIANT dbv;
if (db_get_ws(NULL, MODULENAME, "ScanCmdLine", &dbv) == 0) {
- SetDlgItemText(hwndDlg, IDC_SCANCMDLINE, dbv.ptszVal);
+ SetDlgItemText(hwndDlg, IDC_SCANCMDLINE, dbv.pwszVal);
db_free(&dbv);
}
else if (SendDlgItemMessage(hwndDlg, IDC_SCANCMDLINE, CB_GETCOUNT, 0, 0)) {
diff --git a/src/core/stdfile/src/filerecvdlg.cpp b/src/core/stdfile/src/filerecvdlg.cpp index 3db0e42786..e975d01fe8 100644 --- a/src/core/stdfile/src/filerecvdlg.cpp +++ b/src/core/stdfile/src/filerecvdlg.cpp @@ -216,7 +216,7 @@ INT_PTR CALLBACK DlgProcRecvFile(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l DBVARIANT dbv;
if (db_get_ws(NULL, MODULENAME, idstr, &dbv))
break;
- SendDlgItemMessage(hwndDlg, IDC_FILEDIR, CB_ADDSTRING, 0, (LPARAM)dbv.ptszVal);
+ SendDlgItemMessage(hwndDlg, IDC_FILEDIR, CB_ADDSTRING, 0, (LPARAM)dbv.pwszVal);
db_free(&dbv);
}
@@ -315,7 +315,7 @@ INT_PTR CALLBACK DlgProcRecvFile(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l mir_snprintf(idstr, "MruDir%d", i);
if (db_get_ws(NULL, MODULENAME, idstr, &dbv)) continue;
mir_snprintf(idstr, "MruDir%d", i+1);
- db_set_ws(NULL, MODULENAME, idstr, dbv.ptszVal);
+ db_set_ws(NULL, MODULENAME, idstr, dbv.pwszVal);
db_free(&dbv);
}
db_set_ws(NULL, MODULENAME, idstr, szRecvDir);
diff --git a/src/core/stdfile/src/filexferdlg.cpp b/src/core/stdfile/src/filexferdlg.cpp index 841d2d0c2c..35d6884ad0 100644 --- a/src/core/stdfile/src/filexferdlg.cpp +++ b/src/core/stdfile/src/filexferdlg.cpp @@ -95,18 +95,18 @@ static void __cdecl RunVirusScannerThread(struct virusscanthreadstartinfo *info) { DBVARIANT dbv; if (!db_get_ws(NULL, MODULENAME, "ScanCmdLine", &dbv)) { - if (dbv.ptszVal[0]) { + if (dbv.pwszVal[0]) { STARTUPINFO si = { 0 }; si.cb = sizeof(si); - wchar_t *pszReplace = wcsstr(dbv.ptszVal, L"%f"); + wchar_t *pszReplace = wcsstr(dbv.pwszVal, L"%f"); wchar_t szCmdLine[768]; if (pszReplace) { if (info->szFile[mir_wstrlen(info->szFile) - 1] == '\\') info->szFile[mir_wstrlen(info->szFile) - 1] = '\0'; *pszReplace = 0; - mir_snwprintf(szCmdLine, L"%s\"%s\"%s", dbv.ptszVal, info->szFile, pszReplace + 2); + mir_snwprintf(szCmdLine, L"%s\"%s\"%s", dbv.pwszVal, info->szFile, pszReplace + 2); } else - wcsncpy_s(szCmdLine, dbv.ptszVal, _TRUNCATE); + wcsncpy_s(szCmdLine, dbv.pwszVal, _TRUNCATE); PROCESS_INFORMATION pi; if (CreateProcess(nullptr, szCmdLine, nullptr, nullptr, FALSE, 0, nullptr, nullptr, &si, &pi)) { diff --git a/src/core/stdmsg/src/chat_options.cpp b/src/core/stdmsg/src/chat_options.cpp index fc7258ce76..932ca3f07b 100644 --- a/src/core/stdmsg/src/chat_options.cpp +++ b/src/core/stdmsg/src/chat_options.cpp @@ -204,7 +204,7 @@ static void InitSetting(wchar_t** ppPointer, char* pszSetting, wchar_t* pszDefau { DBVARIANT dbv; if (!db_get_ws(0, CHAT_MODULE, pszSetting, &dbv)) { - replaceStrW(*ppPointer, dbv.ptszVal); + replaceStrW(*ppPointer, dbv.pwszVal); db_free(&dbv); } else replaceStrW(*ppPointer, pszDefault); diff --git a/src/core/stdmsg/src/msgdialog.cpp b/src/core/stdmsg/src/msgdialog.cpp index cfb4c8d556..57711e2228 100644 --- a/src/core/stdmsg/src/msgdialog.cpp +++ b/src/core/stdmsg/src/msgdialog.cpp @@ -219,8 +219,8 @@ bool CSrmmWindow::OnInitDialog() if (m_hContact) {
DBVARIANT dbv;
if (!db_get_ws(m_hContact, SRMSGMOD, DBSAVEDMSG, &dbv)) {
- if (dbv.ptszVal[0]) {
- m_message.SetText(dbv.ptszVal);
+ if (dbv.pwszVal[0]) {
+ m_message.SetText(dbv.pwszVal);
m_btnOk.Enable(true);
UpdateReadChars();
PostMessage(m_message.GetHwnd(), EM_SETSEL, -1, -1);
diff --git a/src/core/stduserinfo/src/contactinfo.cpp b/src/core/stduserinfo/src/contactinfo.cpp index bd99b262d7..d6373e2fba 100644 --- a/src/core/stduserinfo/src/contactinfo.cpp +++ b/src/core/stduserinfo/src/contactinfo.cpp @@ -293,7 +293,7 @@ INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP mir_snwprintf(idstr2, L"%d", i + 2);
}
ListView_InsertItem(GetDlgItem(hwndDlg, IDC_EMAILS), &lvi);
- ListView_SetItemText(GetDlgItem(hwndDlg, IDC_EMAILS), lvi.iItem, 1, dbv.ptszVal);
+ ListView_SetItemText(GetDlgItem(hwndDlg, IDC_EMAILS), lvi.iItem, 1, dbv.pwszVal);
db_free(&dbv);
lvi.iItem++;
}
@@ -306,7 +306,7 @@ INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP lvi.pszText = idstr2;
mir_snwprintf(idstr2, TranslateT("Custom %d"), i + 1);
ListView_InsertItem(GetDlgItem(hwndDlg, IDC_EMAILS), &lvi);
- ListView_SetItemText(GetDlgItem(hwndDlg, IDC_EMAILS), lvi.iItem, 1, dbv.ptszVal);
+ ListView_SetItemText(GetDlgItem(hwndDlg, IDC_EMAILS), lvi.iItem, 1, dbv.pwszVal);
db_free(&dbv);
lvi.iItem++;
}
@@ -322,14 +322,14 @@ INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP if (!db_get_ws(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);
+ ListView_SetItemText(GetDlgItem(hwndDlg, IDC_PHONES), lvi.iItem, 1, dbv.pwszVal);
db_free(&dbv);
lvi.iItem++;
}
if (!db_get_ws(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);
+ ListView_SetItemText(GetDlgItem(hwndDlg, IDC_PHONES), lvi.iItem, 1, dbv.pwszVal);
db_free(&dbv);
lvi.iItem++;
}
@@ -338,23 +338,23 @@ INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP ListView_InsertItem(GetDlgItem(hwndDlg, IDC_PHONES), &lvi);
if (mir_strlen(dbv.pszVal) > 4 && !mir_strcmp(dbv.pszVal + mir_strlen(dbv.pszVal) - 4, " SMS")) {
ListView_SetItemText(GetDlgItem(hwndDlg, IDC_PHONES), lvi.iItem, 2, L"y");
- dbv.ptszVal[mir_wstrlen(dbv.ptszVal) - 4] = '\0';
+ dbv.pwszVal[mir_wstrlen(dbv.pwszVal) - 4] = '\0';
}
- ListView_SetItemText(GetDlgItem(hwndDlg, IDC_PHONES), lvi.iItem, 1, dbv.ptszVal);
+ ListView_SetItemText(GetDlgItem(hwndDlg, IDC_PHONES), lvi.iItem, 1, dbv.pwszVal);
db_free(&dbv);
lvi.iItem++;
}
if (!db_get_ws(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);
+ ListView_SetItemText(GetDlgItem(hwndDlg, IDC_PHONES), lvi.iItem, 1, dbv.pwszVal);
db_free(&dbv);
lvi.iItem++;
}
if (!db_get_ws(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);
+ ListView_SetItemText(GetDlgItem(hwndDlg, IDC_PHONES), lvi.iItem, 1, dbv.pwszVal);
db_free(&dbv);
lvi.iItem++;
}
@@ -367,11 +367,11 @@ INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP lvi.pszText = idstr2;
mir_snwprintf(idstr2, TranslateT("Custom %d"), i + 1);
ListView_InsertItem(GetDlgItem(hwndDlg, IDC_PHONES), &lvi);
- if (mir_wstrlen(dbv.ptszVal) > 4 && !mir_wstrcmp(dbv.ptszVal + mir_wstrlen(dbv.ptszVal) - 4, L" SMS")) {
+ if (mir_wstrlen(dbv.pwszVal) > 4 && !mir_wstrcmp(dbv.pwszVal + mir_wstrlen(dbv.pwszVal) - 4, L" SMS")) {
ListView_SetItemText(GetDlgItem(hwndDlg, IDC_PHONES), lvi.iItem, 2, L"y");
- dbv.ptszVal[mir_wstrlen(dbv.ptszVal) - 4] = '\0';
+ dbv.pwszVal[mir_wstrlen(dbv.pwszVal) - 4] = '\0';
}
- ListView_SetItemText(GetDlgItem(hwndDlg, IDC_PHONES), lvi.iItem, 1, dbv.ptszVal);
+ ListView_SetItemText(GetDlgItem(hwndDlg, IDC_PHONES), lvi.iItem, 1, dbv.pwszVal);
db_free(&dbv);
lvi.iItem++;
}
diff --git a/src/core/stduserinfo/src/stdinfo.cpp b/src/core/stduserinfo/src/stdinfo.cpp index 338007fb4f..7983a0f6ff 100644 --- a/src/core/stduserinfo/src/stdinfo.cpp +++ b/src/core/stduserinfo/src/stdinfo.cpp @@ -55,7 +55,7 @@ static wchar_t* Proto_GetContactInfoSettingStr(bool proto_service, MCONTACT hCon if (CallProtoService(szModule, PS_GETINFOSETTING, hContact, (LPARAM)&cgs))
return nullptr;
- return dbv.ptszVal;
+ return dbv.pwszVal;
}
static void SetValue(HWND hwndDlg, int idCtrl, MCONTACT hContact, char *szModule, char *szSetting, int special)
@@ -152,7 +152,7 @@ static void SetValue(HWND hwndDlg, int idCtrl, MCONTACT hContact, char *szModule char szSettingName[100];
mir_snprintf(szSettingName, "%sName", szSetting);
if (!db_get_ws(hContact, szModule, szSettingName, &dbv)) {
- ptstr = dbv.ptszVal;
+ ptstr = dbv.pwszVal;
unspecified = false;
break;
}
diff --git a/src/core/stduserinfo/src/userinfo.cpp b/src/core/stduserinfo/src/userinfo.cpp index 5f43ae35a7..4a1385545b 100644 --- a/src/core/stduserinfo/src/userinfo.cpp +++ b/src/core/stduserinfo/src/userinfo.cpp @@ -266,7 +266,7 @@ static INT_PTR CALLBACK DlgProcDetails(HWND hwndDlg, UINT msg, WPARAM wParam, LP LPTSTR ptszLastTab;
DBVARIANT dbv;
if (!db_get_ws(NULL, MODULENAME, "LastTab", &dbv)) {
- ptszLastTab = NEWWSTR_ALLOCA(dbv.ptszVal);
+ ptszLastTab = NEWWSTR_ALLOCA(dbv.pwszVal);
db_free(&dbv);
}
else ptszLastTab = nullptr;
diff --git a/src/mir_app/src/chat_opts.cpp b/src/mir_app/src/chat_opts.cpp index 1a6a242a01..6850899677 100644 --- a/src/mir_app/src/chat_opts.cpp +++ b/src/mir_app/src/chat_opts.cpp @@ -195,7 +195,7 @@ static void InitSetting(wchar_t** ppPointer, char* pszSetting, wchar_t* pszDefau {
DBVARIANT dbv;
if (!db_get_ws(0, CHAT_MODULE, pszSetting, &dbv)) {
- replaceStrW(*ppPointer, dbv.ptszVal);
+ replaceStrW(*ppPointer, dbv.pwszVal);
db_free(&dbv);
}
else replaceStrW(*ppPointer, pszDefault);
diff --git a/src/mir_app/src/clcitems.cpp b/src/mir_app/src/clcitems.cpp index 8c35188d75..851dfaf549 100644 --- a/src/mir_app/src/clcitems.cpp +++ b/src/mir_app/src/clcitems.cpp @@ -322,15 +322,15 @@ MIR_APP_DLL(void) Clist_DeleteItemFromTree(HWND hwnd, MCONTACT hItem) ClcContact *cc = group->cl[i]; if (cc->type == CLCIT_GROUP) { size_t len = mir_wstrlen(cc->szText); - if (!wcsncmp(cc->szText, dbv.ptszVal + nameOffset, len) && - (dbv.ptszVal[nameOffset + len] == '\\' || dbv.ptszVal[nameOffset + len] == '\0')) { + if (!wcsncmp(cc->szText, dbv.pwszVal + nameOffset, len) && + (dbv.pwszVal[nameOffset + len] == '\\' || dbv.pwszVal[nameOffset + len] == '\0')) { group->totalMembers--; - if (dbv.ptszVal[nameOffset + len] == '\0') + if (dbv.pwszVal[nameOffset + len] == '\0') break; } } } - mir_free(dbv.ptszVal); + mir_free(dbv.pwszVal); } else Clist_RemoveItemFromGroup(hwnd, group, contact, 1); } diff --git a/src/mir_app/src/clistsettings.cpp b/src/mir_app/src/clistsettings.cpp index cc8020975c..37fb40cd66 100644 --- a/src/mir_app/src/clistsettings.cpp +++ b/src/mir_app/src/clistsettings.cpp @@ -186,7 +186,7 @@ static void Dbwcs2tstr(DBCONTACTWRITESETTING *cws, wchar_t* &pStr) break;
case DBVT_WCHAR:
- pStr = mir_wstrdup(cws->value.ptszVal);
+ pStr = mir_wstrdup(cws->value.pwszVal);
break;
}
}
diff --git a/src/mir_app/src/clui.cpp b/src/mir_app/src/clui.cpp index 4079bdc675..740cd7004b 100644 --- a/src/mir_app/src/clui.cpp +++ b/src/mir_app/src/clui.cpp @@ -300,7 +300,7 @@ int LoadCLUIModule(void) if (db_get_ws(0, "CList", "TitleText", &dbv))
mir_wstrncpy(titleText, _T(MIRANDANAME), _countof(titleText));
else {
- mir_wstrncpy(titleText, dbv.ptszVal, _countof(titleText));
+ mir_wstrncpy(titleText, dbv.pwszVal, _countof(titleText));
db_free(&dbv);
}
diff --git a/src/mir_app/src/contacts.cpp b/src/mir_app/src/contacts.cpp index 0c13ddb594..1ce2f46b4b 100644 --- a/src/mir_app/src/contacts.cpp +++ b/src/mir_app/src/contacts.cpp @@ -63,7 +63,7 @@ static wchar_t* ProcessDatabaseValueDefault(MCONTACT hContact, const char *szPro if (!dbv.pszVal[0]) break;
case DBVT_WCHAR:
if (!dbv.pwszVal[0]) break;
- return dbv.ptszVal;
+ return dbv.pwszVal;
}
db_free(&dbv);
}
@@ -143,7 +143,7 @@ MIR_APP_DLL(wchar_t*) Contact_GetInfo(int type, MCONTACT hContact, const char *s case CNF_COUNTRY:
case CNF_COCOUNTRY:
if (!GetDatabaseString(hContact, szProto, type == CNF_COUNTRY ? "CountryName" : "CompanyCountryName", &dbv))
- return dbv.ptszVal;
+ return dbv.pwszVal;
if (!db_get(hContact, szProto, type == CNF_COUNTRY ? "Country" : "CompanyCountry", &dbv)) {
if (dbv.type == DBVT_WORD) {
@@ -237,7 +237,7 @@ MIR_APP_DLL(wchar_t*) Contact_GetInfo(int type, MCONTACT hContact, const char *s _ltow(value, buf, 10);
return mir_wstrdup(buf);
}
- return dbv.ptszVal;
+ return dbv.pwszVal;
}
}
break;
diff --git a/src/mir_app/src/meta_edit.cpp b/src/mir_app/src/meta_edit.cpp index 2b740d8b79..9d6b9f4799 100644 --- a/src/mir_app/src/meta_edit.cpp +++ b/src/mir_app/src/meta_edit.cpp @@ -74,7 +74,7 @@ static void FillContactList(HWND hList) wcsncpy_s(buff, _A2T(dbv.pszVal), _TRUNCATE);
break;
case DBVT_WCHAR:
- wcsncpy_s(buff, dbv.ptszVal, _TRUNCATE);
+ wcsncpy_s(buff, dbv.pwszVal, _TRUNCATE);
break;
case DBVT_BYTE:
_itow(dbv.bVal, buff, 10);
diff --git a/src/mir_app/src/meta_services.cpp b/src/mir_app/src/meta_services.cpp index 4a67acce15..d5da2e557c 100644 --- a/src/mir_app/src/meta_services.cpp +++ b/src/mir_app/src/meta_services.cpp @@ -285,17 +285,14 @@ int Meta_HandleACK(WPARAM, LPARAM lParam) // change the hContact in the avatar info struct, if it's the avatar we're using - else drop it
if (ack->type == ACKTYPE_AVATAR) {
if (ack->result == ACKRESULT_SUCCESS || ack->result == ACKRESULT_FAILED || ack->result == ACKRESULT_STATUS) {
- DBVARIANT dbv;
-
// change avatar if the most online supporting avatars changes, or if we don't have one
MCONTACT hMostOnline = Meta_GetMostOnlineSupporting(cc, PFLAGNUM_4, PF4_AVATARS);
if (ack->hContact == 0 || ack->hContact != hMostOnline)
return 0;
- if (!db_get(ack->hContact, "ContactPhoto", "File", &dbv)) {
- db_set_ws(cc->contactID, "ContactPhoto", "File", dbv.ptszVal);
- db_free(&dbv);
- }
+ ptrW wszFile(db_get_wsa(ack->hContact, "ContactPhoto", "File"));
+ if (wszFile)
+ db_set_ws(cc->contactID, "ContactPhoto", "File", wszFile);
if (ack->hProcess) {
PROTO_AVATAR_INFORMATION ai;
@@ -403,7 +400,7 @@ int Meta_SettingChanged(WPARAM hContact, LPARAM lParam) DBVARIANT dbv;
if (proto && !db_get_ws(hContact, proto, "Nick", &dbv)) {
- db_set_ws(ccMeta->contactID, META_PROTO, buffer, dbv.ptszVal);
+ db_set_ws(ccMeta->contactID, META_PROTO, buffer, dbv.pwszVal);
db_free(&dbv);
}
else db_unset(ccMeta->contactID, META_PROTO, buffer);
diff --git a/src/mir_app/src/movetogroup.cpp b/src/mir_app/src/movetogroup.cpp index 7e23871cfd..b0b6da5ef1 100644 --- a/src/mir_app/src/movetogroup.cpp +++ b/src/mir_app/src/movetogroup.cpp @@ -108,10 +108,10 @@ static int OnContactMenuBuild(WPARAM wParam, LPARAM) if (db_get_ws(0, "CListGroups", intname, &dbv))
break;
- if (dbv.ptszVal[0])
- groups.insert(new GroupItemSort(dbv.ptszVal + 1, i + 1));
+ if (dbv.pwszVal[0])
+ groups.insert(new GroupItemSort(dbv.pwszVal + 1, i + 1));
- mir_free(dbv.ptszVal);
+ mir_free(dbv.pwszVal);
}
for (auto &p : groups) {
diff --git a/src/mir_app/src/sounds.cpp b/src/mir_app/src/sounds.cpp index 607f8f1eb7..502a945cb5 100644 --- a/src/mir_app/src/sounds.cpp +++ b/src/mir_app/src/sounds.cpp @@ -259,7 +259,7 @@ INT_PTR CALLBACK DlgProcSoundOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM DBVARIANT dbv;
if (!db_get_ws(0, "SkinSounds", p->name, &dbv)) {
wchar_t szPathFull[MAX_PATH];
- PathToAbsoluteW(dbv.ptszVal, szPathFull);
+ PathToAbsoluteW(dbv.pwszVal, szPathFull);
NotifyEventHooks(hPlayEvent, 1, (LPARAM)szPathFull);
db_free(&dbv);
}
@@ -289,7 +289,7 @@ INT_PTR CALLBACK DlgProcSoundOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM if (db_get_b(0, "SkinSoundsOff", p->name, 0) == 0) {
DBVARIANT dbv;
if (db_get_ws(0, "SkinSounds", p->name, &dbv) == 0) {
- PathToAbsoluteW(dbv.ptszVal, strdir);
+ PathToAbsoluteW(dbv.pwszVal, strdir);
db_free(&dbv);
}
}
@@ -393,7 +393,7 @@ INT_PTR CALLBACK DlgProcSoundOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM else {
DBVARIANT dbv;
if (!db_get_ws(0, "SkinSounds", p->name, &dbv)) {
- SetDlgItemText(hwndDlg, IDC_LOCATION, dbv.ptszVal);
+ SetDlgItemText(hwndDlg, IDC_LOCATION, dbv.pwszVal);
db_free(&dbv);
}
else SetDlgItemText(hwndDlg, IDC_LOCATION, TranslateT("<not specified>"));
diff --git a/src/mir_core/src/CDbLink.cpp b/src/mir_core/src/CDbLink.cpp index f9ab9c7d34..a71d1f1398 100644 --- a/src/mir_core/src/CDbLink.cpp +++ b/src/mir_core/src/CDbLink.cpp @@ -77,7 +77,7 @@ wchar_t* CDbLink::LoadText() if (dbv.type != DBVT_DELETED) db_free(&dbv);
if (!db_get_ws(0, m_szModule, m_szSetting, &dbv)) {
if (dbv.type == DBVT_WCHAR)
- return dbv.ptszVal;
+ return dbv.pwszVal;
return m_szDefault;
}
diff --git a/src/mir_core/src/timezones.cpp b/src/mir_core/src/timezones.cpp index b47cc144b8..d005092352 100644 --- a/src/mir_core/src/timezones.cpp +++ b/src/mir_core/src/timezones.cpp @@ -241,7 +241,7 @@ MIR_CORE_DLL(HANDLE) TimeZone_CreateByContact(MCONTACT hContact, LPCSTR szModule DBVARIANT dbv;
if (!db_get_ws(hContact, szModule, "TzName", &dbv)) {
- HANDLE res = TimeZone_CreateByName(dbv.ptszVal, dwFlags);
+ HANDLE res = TimeZone_CreateByName(dbv.pwszVal, dwFlags);
db_free(&dbv);
if (res) return res;
}
@@ -250,7 +250,7 @@ MIR_CORE_DLL(HANDLE) TimeZone_CreateByContact(MCONTACT hContact, LPCSTR szModule if (timezone == -1) {
char *szProto = GetContactProto(hContact);
if (!db_get_ws(hContact, szProto, "TzName", &dbv)) {
- HANDLE res = TimeZone_CreateByName(dbv.ptszVal, dwFlags);
+ HANDLE res = TimeZone_CreateByName(dbv.pwszVal, dwFlags);
db_free(&dbv);
if (res) return res;
}
|