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/AutoShutdown | |
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/AutoShutdown')
-rw-r--r-- | plugins/AutoShutdown/src/settingsdlg.cpp | 4 | ||||
-rw-r--r-- | plugins/AutoShutdown/src/watcher.cpp | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/plugins/AutoShutdown/src/settingsdlg.cpp b/plugins/AutoShutdown/src/settingsdlg.cpp index 3e59a08882..3109286671 100644 --- a/plugins/AutoShutdown/src/settingsdlg.cpp +++ b/plugins/AutoShutdown/src/settingsdlg.cpp @@ -123,8 +123,8 @@ static INT_PTR CALLBACK SettingsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L {
DBVARIANT dbv;
if (!db_get_ws(NULL, MODULENAME, "Message", &dbv)) {
- SetDlgItemText(hwndDlg, IDC_EDIT_MESSAGE, dbv.ptszVal);
- mir_free(dbv.ptszVal);
+ SetDlgItemText(hwndDlg, IDC_EDIT_MESSAGE, dbv.pwszVal);
+ mir_free(dbv.pwszVal);
}
}
/* cpuusage threshold */
diff --git a/plugins/AutoShutdown/src/watcher.cpp b/plugins/AutoShutdown/src/watcher.cpp index fbd2987e8b..529954f758 100644 --- a/plugins/AutoShutdown/src/watcher.cpp +++ b/plugins/AutoShutdown/src/watcher.cpp @@ -100,11 +100,11 @@ static int MsgEventAdded(WPARAM, LPARAM hDbEvent) if (dbe.eventType == EVENTTYPE_MESSAGE && !(dbe.flags & DBEF_SENT)) {
DBVARIANT dbv;
if (!db_get_ws(NULL, MODULENAME, "Message", &dbv)) {
- TrimString(dbv.ptszVal);
+ TrimString(dbv.pwszVal);
wchar_t *pszMsg = GetMessageText(&dbe.pBlob, &dbe.cbBlob);
- if (pszMsg != nullptr && wcsstr(pszMsg, dbv.ptszVal) != nullptr)
+ if (pszMsg != nullptr && wcsstr(pszMsg, dbv.pwszVal) != nullptr)
ShutdownAndStopWatcher(); /* msg with specified text recvd */
- mir_free(dbv.ptszVal); /* does NULL check */
+ mir_free(dbv.pwszVal); /* does NULL check */
}
}
mir_free(dbe.pBlob);
|