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/Clist_nicer | |
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/Clist_nicer')
-rw-r--r-- | plugins/Clist_nicer/src/clcitems.cpp | 22 | ||||
-rw-r--r-- | plugins/Clist_nicer/src/clcopts.cpp | 2 | ||||
-rw-r--r-- | plugins/Clist_nicer/src/clui.cpp | 2 | ||||
-rw-r--r-- | plugins/Clist_nicer/src/extBackg.cpp | 8 | ||||
-rw-r--r-- | plugins/Clist_nicer/src/viewmodes.cpp | 4 |
5 files changed, 19 insertions, 19 deletions
diff --git a/plugins/Clist_nicer/src/clcitems.cpp b/plugins/Clist_nicer/src/clcitems.cpp index 095ba1e2eb..e877201fea 100644 --- a/plugins/Clist_nicer/src/clcitems.cpp +++ b/plugins/Clist_nicer/src/clcitems.cpp @@ -162,7 +162,7 @@ BYTE GetCachedStatusMsg(TExtraCache *p, char *szProto) DBVARIANT dbv = { 0 };
INT_PTR result = db_get_ws(hContact, "CList", "StatusMsg", &dbv);
- if (!result && mir_wstrlen(dbv.ptszVal) > 0)
+ if (!result && mir_wstrlen(dbv.pwszVal) > 0)
p->bStatusMsgValid = STATUSMSG_CLIST;
else {
if (!szProto)
@@ -170,11 +170,11 @@ BYTE GetCachedStatusMsg(TExtraCache *p, char *szProto) if (szProto) {
if (!result)
db_free(&dbv);
- if (!(result = db_get_ws(hContact, szProto, "YMsg", &dbv)) && mir_wstrlen(dbv.ptszVal) > 0)
+ if (!(result = db_get_ws(hContact, szProto, "YMsg", &dbv)) && mir_wstrlen(dbv.pwszVal) > 0)
p->bStatusMsgValid = STATUSMSG_YIM;
- else if (!(result = db_get_ws(hContact, szProto, "StatusDescr", &dbv)) && mir_wstrlen(dbv.ptszVal) > 0)
+ else if (!(result = db_get_ws(hContact, szProto, "StatusDescr", &dbv)) && mir_wstrlen(dbv.pwszVal) > 0)
p->bStatusMsgValid = STATUSMSG_GG;
- else if (!(result = db_get_ws(hContact, szProto, "XStatusMsg", &dbv)) && mir_wstrlen(dbv.ptszVal) > 0)
+ else if (!(result = db_get_ws(hContact, szProto, "XStatusMsg", &dbv)) && mir_wstrlen(dbv.pwszVal) > 0)
p->bStatusMsgValid = STATUSMSG_XSTATUS;
}
}
@@ -183,11 +183,11 @@ BYTE GetCachedStatusMsg(TExtraCache *p, char *szProto) if (!result)
db_free(&dbv);
result = db_get_ws(hContact, szProto, "XStatusName", &dbv);
- if (!result && mir_wstrlen(dbv.ptszVal) > 1) {
- size_t iLen = mir_wstrlen(dbv.ptszVal);
+ if (!result && mir_wstrlen(dbv.pwszVal) > 1) {
+ size_t iLen = mir_wstrlen(dbv.pwszVal);
p->bStatusMsgValid = STATUSMSG_XSTATUSNAME;
p->statusMsg = (wchar_t *)realloc(p->statusMsg, (iLen + 2) * sizeof(wchar_t));
- wcsncpy(p->statusMsg, dbv.ptszVal, iLen + 1);
+ wcsncpy(p->statusMsg, dbv.pwszVal, iLen + 1);
}
else {
int xStatus;
@@ -213,11 +213,11 @@ BYTE GetCachedStatusMsg(TExtraCache *p, char *szProto) if (p->bStatusMsgValid > STATUSMSG_XSTATUSNAME) {
int j = 0;
- p->statusMsg = (wchar_t *)realloc(p->statusMsg, (mir_wstrlen(dbv.ptszVal) + 2) * sizeof(wchar_t));
- for (int i = 0; dbv.ptszVal[i]; i++) {
- if (dbv.ptszVal[i] == (wchar_t)0x0d)
+ p->statusMsg = (wchar_t *)realloc(p->statusMsg, (mir_wstrlen(dbv.pwszVal) + 2) * sizeof(wchar_t));
+ for (int i = 0; dbv.pwszVal[i]; i++) {
+ if (dbv.pwszVal[i] == (wchar_t)0x0d)
continue;
- p->statusMsg[j] = dbv.ptszVal[i] == (wchar_t)0x0a ? (wchar_t)' ' : dbv.ptszVal[i];
+ p->statusMsg[j] = dbv.pwszVal[i] == (wchar_t)0x0a ? (wchar_t)' ' : dbv.pwszVal[i];
j++;
}
p->statusMsg[j] = 0;
diff --git a/plugins/Clist_nicer/src/clcopts.cpp b/plugins/Clist_nicer/src/clcopts.cpp index 87bba912aa..cfb7a37879 100644 --- a/plugins/Clist_nicer/src/clcopts.cpp +++ b/plugins/Clist_nicer/src/clcopts.cpp @@ -709,7 +709,7 @@ static INT_PTR CALLBACK DlgProcClcBkgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, DBVARIANT dbv;
if (!db_get_ws(NULL, "CLC", "BkBitmap", &dbv)) {
wchar_t szPath[MAX_PATH];
- if (PathToAbsoluteW(dbv.ptszVal, szPath))
+ if (PathToAbsoluteW(dbv.pwszVal, szPath))
SetDlgItemText(hwndDlg, IDC_FILENAME, szPath);
db_free(&dbv);
diff --git a/plugins/Clist_nicer/src/clui.cpp b/plugins/Clist_nicer/src/clui.cpp index 341a8134cc..f2ee3b3ae7 100644 --- a/plugins/Clist_nicer/src/clui.cpp +++ b/plugins/Clist_nicer/src/clui.cpp @@ -870,7 +870,7 @@ LRESULT CALLBACK ContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l if (db_get_b(NULL, "CList", "AutoApplyLastViewMode", 0)) { DBVARIANT dbv = { 0 }; - if (!db_get(NULL, "CList", "LastViewMode", &dbv)) { + if (!db_get_s(NULL, "CList", "LastViewMode", &dbv)) { if (mir_strlen(dbv.pszVal) > 2) { if (db_get_dw(NULL, CLVM_MODULE, dbv.pszVal, -1) != 0xffffffff) ApplyViewMode((char *)dbv.pszVal); diff --git a/plugins/Clist_nicer/src/extBackg.cpp b/plugins/Clist_nicer/src/extBackg.cpp index 6b7637a62d..964b91fc4b 100644 --- a/plugins/Clist_nicer/src/extBackg.cpp +++ b/plugins/Clist_nicer/src/extBackg.cpp @@ -1188,7 +1188,7 @@ void IMG_LoadItems() return;
wchar_t tszFileName[MAX_PATH];
- MY_pathToAbsolute(dbv.ptszVal, tszFileName);
+ MY_pathToAbsolute(dbv.pwszVal, tszFileName);
// TODO: rewrite the skin loading in wchar_t manner
char szFileName[MAX_PATH];
@@ -1461,7 +1461,7 @@ static void ApplyCLUISkin() wchar_t tszFinalName[MAX_PATH];
char szFinalName[MAX_PATH];
if (!db_get_ws(NULL, "CLC", "AdvancedSkin", &dbv)) {
- MY_pathToAbsolute(dbv.ptszVal, tszFinalName);
+ MY_pathToAbsolute(dbv.pwszVal, tszFinalName);
WideCharToMultiByte(CP_ACP, 0, tszFinalName, MAX_PATH, szFinalName, MAX_PATH, nullptr, nullptr);
@@ -1514,7 +1514,7 @@ static INT_PTR CALLBACK DlgProcSkinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L Utils::enableDlgControl(hwndDlg, IDC_RELOAD, FALSE);
CheckDlgButton(hwndDlg, IDC_USESKIN, db_get_b(NULL, "CLUI", "useskin", 0) ? BST_CHECKED : BST_UNCHECKED);
if (!db_get_ws(NULL, "CLC", "AdvancedSkin", &dbv)) {
- SetDlgItemText(hwndDlg, IDC_SKINFILENAME, dbv.ptszVal);
+ SetDlgItemText(hwndDlg, IDC_SKINFILENAME, dbv.pwszVal);
db_free(&dbv);
}
else
@@ -1565,7 +1565,7 @@ static INT_PTR CALLBACK DlgProcSkinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L DBVARIANT dbv = { 0 };
if (!db_get_ws(NULL, "CLC", "AdvancedSkin", &dbv)) {
- if (mir_wstrcmp(dbv.ptszVal, final_path))
+ if (mir_wstrcmp(dbv.pwszVal, final_path))
skinChanged = TRUE;
db_free(&dbv);
}
diff --git a/plugins/Clist_nicer/src/viewmodes.cpp b/plugins/Clist_nicer/src/viewmodes.cpp index bd46542ed9..2951f8d44f 100644 --- a/plugins/Clist_nicer/src/viewmodes.cpp +++ b/plugins/Clist_nicer/src/viewmodes.cpp @@ -430,7 +430,7 @@ void UpdateFilters() }
mir_snprintf(szSetting, "%c%s_PF", 246, szBuf);
- if (db_get(NULL, CLVM_MODULE, szSetting, &dbv_pf))
+ if (db_get_s(NULL, CLVM_MODULE, szSetting, &dbv_pf))
goto cleanup;
mir_snprintf(szSetting, "%c%s_GF", 246, szBuf);
@@ -485,7 +485,7 @@ void UpdateFilters() item.iItem = i;
SendMessage(hwndList, LVM_GETITEM, 0, (LPARAM)&item);
mir_snwprintf(szMask, L"%s|", szTemp);
- if (dbv_gf.ptszVal && wcsstr(dbv_gf.ptszVal, szMask)) {
+ if (dbv_gf.pwszVal && wcsstr(dbv_gf.pwszVal, szMask)) {
ListView_SetCheckState(hwndList, i, TRUE);
}
else {
|