summaryrefslogtreecommitdiff
path: root/plugins/NewXstatusNotify/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/NewXstatusNotify/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/NewXstatusNotify/src')
-rw-r--r--plugins/NewXstatusNotify/src/indsnd.cpp4
-rw-r--r--plugins/NewXstatusNotify/src/main.cpp6
-rw-r--r--plugins/NewXstatusNotify/src/options.cpp4
-rw-r--r--plugins/NewXstatusNotify/src/utils.cpp2
-rw-r--r--plugins/NewXstatusNotify/src/xstatus.cpp6
5 files changed, 11 insertions, 11 deletions
diff --git a/plugins/NewXstatusNotify/src/indsnd.cpp b/plugins/NewXstatusNotify/src/indsnd.cpp
index db3911f2a2..8213441bc2 100644
--- a/plugins/NewXstatusNotify/src/indsnd.cpp
+++ b/plugins/NewXstatusNotify/src/indsnd.cpp
@@ -150,7 +150,7 @@ INT_PTR CALLBACK DlgProcSoundUIPage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
lvi.iItem = ListView_InsertItem(hList, &lvi);
if (!db_get_ws(hContact, MODULE, StatusList[Index(i)].lpzSkinSoundName, &dbv)) {
- mir_wstrcpy(buff, dbv.ptszVal);
+ mir_wstrcpy(buff, dbv.pwszVal);
db_free(&dbv);
}
else mir_wstrcpy(buff, TranslateW(DEFAULT_SOUND));
@@ -170,7 +170,7 @@ INT_PTR CALLBACK DlgProcSoundUIPage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
lvi.iItem = ListView_InsertItem(hList, &lvi);
if (!db_get_ws(hContact, MODULE, StatusList[i].lpzSkinSoundName, &dbv)) {
- wcsncpy(buff, dbv.ptszVal, _countof(buff)-1);
+ wcsncpy(buff, dbv.pwszVal, _countof(buff)-1);
db_free(&dbv);
}
else wcsncpy(buff, TranslateW(DEFAULT_SOUND), _countof(buff)-1);
diff --git a/plugins/NewXstatusNotify/src/main.cpp b/plugins/NewXstatusNotify/src/main.cpp
index 23d3587ab9..fb0ab7083d 100644
--- a/plugins/NewXstatusNotify/src/main.cpp
+++ b/plugins/NewXstatusNotify/src/main.cpp
@@ -339,7 +339,7 @@ void PlayChangeSound(MCONTACT hContact, const char *name)
DBVARIANT dbv;
wchar_t stzSoundFile[MAX_PATH] = { 0 };
if (!db_get_ws(hContact, MODULE, name, &dbv)) {
- wcsncpy(stzSoundFile, dbv.ptszVal, _countof(stzSoundFile) - 1);
+ wcsncpy(stzSoundFile, dbv.pwszVal, _countof(stzSoundFile) - 1);
db_free(&dbv);
}
@@ -710,7 +710,7 @@ int ProcessStatusMessage(DBCONTACTWRITESETTING *cws, MCONTACT hContact)
str = GetStr(&smi, DEFAULT_POPUP_SMSGREMOVED);
}
else {
- str = GetStr(&smi, dbVar.ptszVal);
+ str = GetStr(&smi, dbVar.pwszVal);
db_free(&dbVar);
}
}
@@ -722,7 +722,7 @@ int ProcessStatusMessage(DBCONTACTWRITESETTING *cws, MCONTACT hContact)
str = GetStr(&smi, DEFAULT_POPUP_SMSGCHANGED);
}
else {
- str = GetStr(&smi, dbVar.ptszVal);
+ str = GetStr(&smi, dbVar.pwszVal);
db_free(&dbVar);
}
}
diff --git a/plugins/NewXstatusNotify/src/options.cpp b/plugins/NewXstatusNotify/src/options.cpp
index c109c5fafd..7d1758572b 100644
--- a/plugins/NewXstatusNotify/src/options.cpp
+++ b/plugins/NewXstatusNotify/src/options.cpp
@@ -705,7 +705,7 @@ INT_PTR CALLBACK DlgProcSMPopupOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
if (db_get_ws(NULL, MODULE, protoname, &dbVar))
wcsncpy(prototemplate->ProtoTemplateMsg, DEFAULT_POPUP_SMSGCHANGED, _countof(prototemplate->ProtoTemplateMsg));
else {
- wcsncpy(prototemplate->ProtoTemplateMsg, dbVar.ptszVal, _countof(prototemplate->ProtoTemplateMsg));
+ wcsncpy(prototemplate->ProtoTemplateMsg, dbVar.pwszVal, _countof(prototemplate->ProtoTemplateMsg));
db_free(&dbVar);
}
@@ -713,7 +713,7 @@ INT_PTR CALLBACK DlgProcSMPopupOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
if (db_get_ws(NULL, MODULE, protoname, &dbVar))
wcsncpy(prototemplate->ProtoTemplateRemoved, DEFAULT_POPUP_SMSGREMOVED, _countof(prototemplate->ProtoTemplateRemoved));
else {
- wcsncpy(prototemplate->ProtoTemplateRemoved, dbVar.ptszVal, _countof(prototemplate->ProtoTemplateRemoved));
+ wcsncpy(prototemplate->ProtoTemplateRemoved, dbVar.pwszVal, _countof(prototemplate->ProtoTemplateRemoved));
db_free(&dbVar);
}
diff --git a/plugins/NewXstatusNotify/src/utils.cpp b/plugins/NewXstatusNotify/src/utils.cpp
index 120964b038..07c1539e2e 100644
--- a/plugins/NewXstatusNotify/src/utils.cpp
+++ b/plugins/NewXstatusNotify/src/utils.cpp
@@ -38,7 +38,7 @@ int DBGetStringDefault(MCONTACT hContact, const char *szModule, const char *szSe
{
DBVARIANT dbv;
if (!db_get_ws(hContact, szModule, szSetting, &dbv)) {
- wcsncpy(setting, dbv.ptszVal, size);
+ wcsncpy(setting, dbv.pwszVal, size);
db_free(&dbv);
return 0;
}
diff --git a/plugins/NewXstatusNotify/src/xstatus.cpp b/plugins/NewXstatusNotify/src/xstatus.cpp
index 697876bf22..906a4696de 100644
--- a/plugins/NewXstatusNotify/src/xstatus.cpp
+++ b/plugins/NewXstatusNotify/src/xstatus.cpp
@@ -429,10 +429,10 @@ wchar_t* GetIcqXStatus(MCONTACT hContact, char *szProto, char *szValue, wchar_t
int statusID = db_get_b(hContact, szProto, "XStatusId", -1);
if (statusID != -1) {
if (!db_get_ws(hContact, szProto, szValue, &dbv)) {
- if ((mir_strcmp(szValue, "XStatusName") == 0) && dbv.ptszVal[0] == 0)
+ if ((mir_strcmp(szValue, "XStatusName") == 0) && dbv.pwszVal[0] == 0)
GetDefaultXstatusName(statusID, szProto, buff, bufflen);
else
- wcsncpy(buff, dbv.ptszVal, bufflen);
+ wcsncpy(buff, dbv.pwszVal, bufflen);
buff[bufflen - 1] = 0;
db_free(&dbv);
@@ -450,7 +450,7 @@ wchar_t* GetJabberAdvStatusText(MCONTACT hContact, char *szProto, char *szSlot,
mir_snprintf(szSetting, "%s/%s/%s", szProto, szSlot, szValue);
if (!db_get_ws(hContact, "AdvStatus", szSetting, &dbv)) {
- wcsncpy(buff, dbv.ptszVal, bufflen);
+ wcsncpy(buff, dbv.pwszVal, bufflen);
buff[bufflen - 1] = 0;
db_free(&dbv);
}