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/Msg_Export | |
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/Msg_Export')
-rwxr-xr-x | plugins/Msg_Export/src/utils.cpp | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/plugins/Msg_Export/src/utils.cpp b/plugins/Msg_Export/src/utils.cpp index 1ab91a64c9..2dbfbdec7b 100755 --- a/plugins/Msg_Export/src/utils.cpp +++ b/plugins/Msg_Export/src/utils.cpp @@ -224,17 +224,12 @@ tstring _DBGetStringW(MCONTACT hContact, const char *szModule, const char *szSet {
tstring ret;
DBVARIANT dbv = { 0 };
- //db_get
if (!db_get_ws(hContact, szModule, szSetting, &dbv)) {
- if (dbv.type != DBVT_WCHAR) {
- MessageBox(nullptr, TranslateT("Database: Attempt to get wrong type of value, string"), MSG_BOX_TITEL, MB_OK);
- ret = pszError;
- }
- else ret = (wchar_t*)dbv.pszVal;
+ ret = (wchar_t*)dbv.pszVal;
+ db_free(&dbv);
}
else ret = pszError;
- db_free(&dbv);
return ret;
}
@@ -242,16 +237,12 @@ string _DBGetStringA(MCONTACT hContact, const char *szModule, const char *szSett {
string ret;
DBVARIANT dbv = { 0 };
- if (!db_get(hContact, szModule, szSetting, &dbv)) {
- if (dbv.type != DBVT_ASCIIZ) {
- MessageBox(nullptr, TranslateT("Database: Attempt to get wrong type of value, string"), MSG_BOX_TITEL, MB_OK);
- ret = pszError;
- }
- else ret = dbv.pszVal;
+ if (!db_get_s(hContact, szModule, szSetting, &dbv)) {
+ ret = dbv.pszVal;
+ db_free(&dbv);
}
else ret = pszError;
- db_free(&dbv);
return ret;
}
|