summaryrefslogtreecommitdiff
path: root/plugins/UserInfoEx/src
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-07-24 11:11:26 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-07-24 11:11:26 +0300
commitd296f9f99daf102b9af5d56690e2bd00d61c1267 (patch)
tree39311caaf80abf0b47ecb78cf94dc8157b193575 /plugins/UserInfoEx/src
parentffc521e5d5e9bd66feb65afe0046b3fc7e073356 (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/UserInfoEx/src')
-rw-r--r--plugins/UserInfoEx/src/classMAnnivDate.cpp2
-rw-r--r--plugins/UserInfoEx/src/classPsTreeItem.cpp2
-rw-r--r--plugins/UserInfoEx/src/ctrl_combo.cpp2
-rw-r--r--plugins/UserInfoEx/src/ctrl_contact.cpp12
-rw-r--r--plugins/UserInfoEx/src/ctrl_edit.cpp8
-rw-r--r--plugins/UserInfoEx/src/dlg_propsheet.cpp2
-rw-r--r--plugins/UserInfoEx/src/psp_profile.cpp2
7 files changed, 15 insertions, 15 deletions
diff --git a/plugins/UserInfoEx/src/classMAnnivDate.cpp b/plugins/UserInfoEx/src/classMAnnivDate.cpp
index e4396b265e..c057cf202c 100644
--- a/plugins/UserInfoEx/src/classMAnnivDate.cpp
+++ b/plugins/UserInfoEx/src/classMAnnivDate.cpp
@@ -637,7 +637,7 @@ int MAnnivDate::DBGetAnniversaryDate(MCONTACT hContact, WORD iIndex)
mir_snprintf(szStamp, "Anniv%dDesc", iIndex);
DBVARIANT dbv;
if (!DB::Setting::GetTString(hContact, USERINFO, szStamp, &dbv)) {
- _strDesc = dbv.ptszVal;
+ _strDesc = dbv.pwszVal;
db_free(&dbv);
}
}
diff --git a/plugins/UserInfoEx/src/classPsTreeItem.cpp b/plugins/UserInfoEx/src/classPsTreeItem.cpp
index ff72aa2933..18463b0f99 100644
--- a/plugins/UserInfoEx/src/classPsTreeItem.cpp
+++ b/plugins/UserInfoEx/src/classPsTreeItem.cpp
@@ -245,7 +245,7 @@ int CPsTreeItem::ItemLabel(const BYTE bReadDBValue)
mir_free(_ptszLabel);
// try to get custom label from database
- if (!bReadDBValue || DB::Setting::GetTString(NULL, MODULENAME, GlobalPropertyKey(SET_ITEM_LABEL), &dbv) || (_ptszLabel = dbv.ptszVal) == nullptr) {
+ if (!bReadDBValue || DB::Setting::GetTString(NULL, MODULENAME, GlobalPropertyKey(SET_ITEM_LABEL), &dbv) || (_ptszLabel = dbv.pwszVal) == nullptr) {
// extract the name
LPSTR pszName = mir_strrchr(_pszName, '\\');
if (pszName && pszName[1])
diff --git a/plugins/UserInfoEx/src/ctrl_combo.cpp b/plugins/UserInfoEx/src/ctrl_combo.cpp
index cf4a7b6366..2afbbdc00b 100644
--- a/plugins/UserInfoEx/src/ctrl_combo.cpp
+++ b/plugins/UserInfoEx/src/ctrl_combo.cpp
@@ -158,7 +158,7 @@ BOOL CCombo::OnInfoChanged(MCONTACT hContact, LPCSTR pszProto)
case DBVT_WORD: iVal = Find((int)dbv.wVal); break;
case DBVT_DWORD: iVal = Find((int)dbv.dVal); break;
case DBVT_WCHAR:
- iVal = Find(TranslateW(dbv.ptszVal));
+ iVal = Find(TranslateW(dbv.pwszVal));
if (iVal == CB_ERR) {
// other
iVal = Find(_pList[_nList - 1].nID);
diff --git a/plugins/UserInfoEx/src/ctrl_contact.cpp b/plugins/UserInfoEx/src/ctrl_contact.cpp
index 1254d743c1..84de9f555f 100644
--- a/plugins/UserInfoEx/src/ctrl_contact.cpp
+++ b/plugins/UserInfoEx/src/ctrl_contact.cpp
@@ -1297,7 +1297,7 @@ int CtrlContactAddItemFromDB(
if (cbi.wFlags == CBEXIF_CATREADONLY)
cbi.pszVal = nullptr;
else { // check the database value
- cbi.pszVal = dbv.ptszVal;
+ cbi.pszVal = dbv.pwszVal;
if (LPTSTR sms = wcsstr(cbi.pszVal, L" SMS")) {
cbi.wFlags |= CBEXIF_SMS;
*sms = 0;
@@ -1356,9 +1356,9 @@ int CtrlContactAddMyItemsFromDB(
{
// read value
cbi.dwID = hashSetting(pszSetting);
- cbi.pszVal = dbv.ptszVal;
+ cbi.pszVal = dbv.pwszVal;
dbv.type = DBVT_DELETED;
- dbv.ptszVal = nullptr;
+ dbv.pwszVal = nullptr;
// read category
if (SUCCEEDED(mir_snprintf(pszSetting, szFormatCat, i))) {
@@ -1372,10 +1372,10 @@ int CtrlContactAddMyItemsFromDB(
dbv.type = DBVT_DELETED;
}
- if (dbv.type > DBVT_DELETED && dbv.ptszVal && *dbv.ptszVal) {
- cbi.pszCat = dbv.ptszVal;
+ if (dbv.type > DBVT_DELETED && dbv.pwszVal && *dbv.pwszVal) {
+ cbi.pszCat = dbv.pwszVal;
dbv.type = DBVT_DELETED;
- dbv.ptszVal = nullptr;
+ dbv.pwszVal = nullptr;
}
}
if (sms = wcsstr(cbi.pszVal, L" SMS")) {
diff --git a/plugins/UserInfoEx/src/ctrl_edit.cpp b/plugins/UserInfoEx/src/ctrl_edit.cpp
index 6fb2c20d43..51a1a19607 100644
--- a/plugins/UserInfoEx/src/ctrl_edit.cpp
+++ b/plugins/UserInfoEx/src/ctrl_edit.cpp
@@ -137,9 +137,9 @@ BOOL CEditCtrl::OnInfoChanged(MCONTACT hContact, LPCSTR pszProto)
break;
case DBVT_WCHAR:
- if (dbv.ptszVal) {
- SetWindowText(_hwnd, dbv.ptszVal);
- _pszValue = dbv.ptszVal;
+ if (dbv.pwszVal) {
+ SetWindowText(_hwnd, dbv.pwszVal);
+ _pszValue = dbv.pwszVal;
break;
}
@@ -191,7 +191,7 @@ void CEditCtrl::OnApply(MCONTACT hContact, LPCSTR pszProto)
break;
case DBVT_WCHAR:
- dbv.ptszVal = val;
+ dbv.pwszVal = val;
break;
default:
diff --git a/plugins/UserInfoEx/src/dlg_propsheet.cpp b/plugins/UserInfoEx/src/dlg_propsheet.cpp
index 55a471a088..397b781284 100644
--- a/plugins/UserInfoEx/src/dlg_propsheet.cpp
+++ b/plugins/UserInfoEx/src/dlg_propsheet.cpp
@@ -1049,7 +1049,7 @@ static INT_PTR CALLBACK DlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lPar
if (!pPs->hContact)
pszName = TranslateT("Owner");
else if (pdbcws && pdbcws->value.type == DBVT_WCHAR)
- pszName = pdbcws->value.ptszVal;
+ pszName = pdbcws->value.pwszVal;
else
pszName = Clist_GetContactDisplayName(pPs->hContact);
diff --git a/plugins/UserInfoEx/src/psp_profile.cpp b/plugins/UserInfoEx/src/psp_profile.cpp
index 85e34efec7..1123c8ad51 100644
--- a/plugins/UserInfoEx/src/psp_profile.cpp
+++ b/plugins/UserInfoEx/src/psp_profile.cpp
@@ -506,7 +506,7 @@ static int ProfileList_AddItemlistFromDB(
pItem->idstrListCount = nList;
pItem->iListItem = 0;
pItem->pszText[0] = nullptr;
- pItem->pszText[1] = dbvVal.ptszVal;
+ pItem->pszText[1] = dbvVal.pwszVal;
pItem->wFlags = wFlags;
lvi.lParam = (LPARAM)pItem;