diff options
author | George Hazan <ghazan@miranda.im> | 2018-07-24 11:11:26 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-07-24 11:11:26 +0300 |
commit | d296f9f99daf102b9af5d56690e2bd00d61c1267 (patch) | |
tree | 39311caaf80abf0b47ecb78cf94dc8157b193575 /plugins/AVS | |
parent | ffc521e5d5e9bd66feb65afe0046b3fc7e073356 (diff) |
database:
- senseless fiels ptszVal removed from DBVARIANT, pwszVal is used instead;
- if you want db_get to return a string, you need to use db_get_s.
Diffstat (limited to 'plugins/AVS')
-rw-r--r-- | plugins/AVS/src/cache.cpp | 2 | ||||
-rw-r--r-- | plugins/AVS/src/options.cpp | 20 | ||||
-rw-r--r-- | plugins/AVS/src/utils.cpp | 2 |
3 files changed, 12 insertions, 12 deletions
diff --git a/plugins/AVS/src/cache.cpp b/plugins/AVS/src/cache.cpp index 1823bdef10..79ccc1ddbe 100644 --- a/plugins/AVS/src/cache.cpp +++ b/plugins/AVS/src/cache.cpp @@ -148,7 +148,7 @@ void NotifyMetaAware(MCONTACT hContact, CacheNode *node, AVATARCACHEENTRY *ace) DBVARIANT dbv = { 0 };
if (!db_get_s(hContact, szProto, "AvatarHash", &dbv)) {
if (dbv.type == DBVT_WCHAR)
- wcsncpy_s(cacn.hash, dbv.ptszVal, _TRUNCATE);
+ wcsncpy_s(cacn.hash, dbv.pwszVal, _TRUNCATE);
else if (dbv.type == DBVT_ASCIIZ)
wcsncpy_s(cacn.hash, _A2T(dbv.pszVal), _TRUNCATE);
else if (dbv.type == DBVT_BLOB) {
diff --git a/plugins/AVS/src/options.cpp b/plugins/AVS/src/options.cpp index ac7f841cf1..2558fe9626 100644 --- a/plugins/AVS/src/options.cpp +++ b/plugins/AVS/src/options.cpp @@ -387,12 +387,12 @@ static INT_PTR CALLBACK DlgProcOptionsProtos(HWND hwndDlg, UINT msg, WPARAM wPar if (g_selectedProto) { DBVARIANT dbv; if (!db_get_ws(NULL, PPICT_MODULE, g_selectedProto->szProtoname, &dbv)) { - if (!PathIsAbsoluteW(VARSW(dbv.ptszVal))) { + if (!PathIsAbsoluteW(VARSW(dbv.pwszVal))) { wchar_t szFinalPath[MAX_PATH]; - mir_snwprintf(szFinalPath, L"%%miranda_path%%\\%s", dbv.ptszVal); + mir_snwprintf(szFinalPath, L"%%miranda_path%%\\%s", dbv.pwszVal); SetDlgItemText(hwndDlg, IDC_PROTOAVATARNAME, szFinalPath); } - else SetDlgItemText(hwndDlg, IDC_PROTOAVATARNAME, dbv.ptszVal); + else SetDlgItemText(hwndDlg, IDC_PROTOAVATARNAME, dbv.pwszVal); InvalidateRect(GetDlgItem(hwndDlg, IDC_PROTOPIC), nullptr, TRUE); db_free(&dbv); @@ -578,7 +578,7 @@ INT_PTR CALLBACK DlgProcAvatarOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPA if (MessageBox(nullptr, TranslateT("Delete picture file from disk (may be necessary to force a reload, but will delete local pictures)?"), TranslateT("Reset contact picture"), MB_YESNO) == IDYES) { DBVARIANT dbv = { 0 }; if (!db_get_ws(hContact, "ContactPhoto", "File", &dbv)) { - DeleteFile(dbv.ptszVal); + DeleteFile(dbv.pwszVal); db_free(&dbv); } } @@ -603,7 +603,7 @@ INT_PTR CALLBACK DlgProcAvatarOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPA DBVARIANT dbv = { 0 }; ProtectAvatar(hContact, 0); if (!db_get_ws(hContact, "ContactPhoto", "File", &dbv)) { - DeleteFile(dbv.ptszVal); + DeleteFile(dbv.pwszVal); db_free(&dbv); } } @@ -667,15 +667,15 @@ INT_PTR CALLBACK DlgProcAvatarOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPA szFinalName[0] = 0; if (is_locked && !db_get_ws(hContact, "ContactPhoto", "Backup", &dbv)) { - MyPathToAbsolute(dbv.ptszVal, szFinalName); + MyPathToAbsolute(dbv.pwszVal, szFinalName); db_free(&dbv); } else if (!db_get_ws(hContact, "ContactPhoto", "RFile", &dbv)) { - MyPathToAbsolute(dbv.ptszVal, szFinalName); + MyPathToAbsolute(dbv.pwszVal, szFinalName); db_free(&dbv); } else if (!db_get_ws(hContact, "ContactPhoto", "File", &dbv)) { - MyPathToAbsolute(dbv.ptszVal, szFinalName); + MyPathToAbsolute(dbv.pwszVal, szFinalName); db_free(&dbv); } szFinalName[MAX_PATH - 1] = 0; @@ -822,7 +822,7 @@ static INT_PTR CALLBACK DlgProcAvatarUserInfo(HWND hwndDlg, UINT msg, WPARAM wPa if (MessageBox(nullptr, TranslateT("Delete picture file from disk (may be necessary to force a reload, but will delete local pictures)?"), TranslateT("Reset contact picture"), MB_YESNO) == IDYES) { DBVARIANT dbv = { 0 }; if (!db_get_ws(hContact, "ContactPhoto", "File", &dbv)) { - DeleteFile(dbv.ptszVal); + DeleteFile(dbv.pwszVal); db_free(&dbv); } } @@ -846,7 +846,7 @@ static INT_PTR CALLBACK DlgProcAvatarUserInfo(HWND hwndDlg, UINT msg, WPARAM wPa if (MessageBox(nullptr, TranslateT("Delete picture file from disk (may be necessary to force a reload, but will delete local pictures)?"), TranslateT("Reset contact picture"), MB_YESNO) == IDYES) { DBVARIANT dbv = { 0 }; if (!db_get_ws(hContact, "ContactPhoto", "File", &dbv)) { - DeleteFile(dbv.ptszVal); + DeleteFile(dbv.pwszVal); db_free(&dbv); } } diff --git a/plugins/AVS/src/utils.cpp b/plugins/AVS/src/utils.cpp index 9ecca88089..2c809a53d0 100644 --- a/plugins/AVS/src/utils.cpp +++ b/plugins/AVS/src/utils.cpp @@ -432,7 +432,7 @@ void DeleteGlobalUserAvatar() return;
wchar_t szFilename[MAX_PATH];
- MyPathToAbsolute(dbv.ptszVal, szFilename);
+ MyPathToAbsolute(dbv.pwszVal, szFilename);
db_free(&dbv);
DeleteFile(szFilename);
|