diff options
author | George Hazan <george.hazan@gmail.com> | 2023-07-22 21:48:46 +0300 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2023-07-22 21:48:46 +0300 |
commit | 7fae2fb35b194f96198e1e0789ba034736b9b9cb (patch) | |
tree | 7e976c26ddf51f6868b1d66186c127b019f1c31c /plugins/Dbx_sqlite/src/dbevents.cpp | |
parent | f51a93d218c3e3184be365be1c078086493c6fed (diff) |
offline files to be stored inside usual folder for incoming files, not inside %profile_data%\\dlFiles
Diffstat (limited to 'plugins/Dbx_sqlite/src/dbevents.cpp')
-rw-r--r-- | plugins/Dbx_sqlite/src/dbevents.cpp | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/plugins/Dbx_sqlite/src/dbevents.cpp b/plugins/Dbx_sqlite/src/dbevents.cpp index c8185fc815..70f3a6e740 100644 --- a/plugins/Dbx_sqlite/src/dbevents.cpp +++ b/plugins/Dbx_sqlite/src/dbevents.cpp @@ -287,6 +287,13 @@ BOOL CDbxSQLite::EditEvent(MEVENT hDbEvent, const DBEVENTINFO *dbei) return 0;
}
+/////////////////////////////////////////////////////////////////////////////////////////
+
+static void str2json(CMStringA &str)
+{
+ str.Replace("\\", "\\\\");
+}
+
int CDbxSQLite::SetEventJson(MEVENT hDbEvent, const char *szSetting, DBVARIANT *dbv)
{
if (hDbEvent == 0)
@@ -310,7 +317,18 @@ int CDbxSQLite::SetEventJson(MEVENT hDbEvent, const char *szSetting, DBVARIANT * break;
case DBVT_ASCIIZ:
case DBVT_UTF8:
- sqlite3_bind_text(stmt, 2, dbv->pszVal, (int)mir_strlen(dbv->pszVal), nullptr);
+ {
+ tmp = dbv->pszVal;
+ str2json(tmp);
+ sqlite3_bind_text(stmt, 2, tmp, tmp.GetLength(), nullptr);
+ }
+ break;
+ case DBVT_WCHAR:
+ {
+ tmp = T2Utf(dbv->pwszVal).get();
+ str2json(tmp);
+ sqlite3_bind_text(stmt, 2, tmp, tmp.GetLength(), nullptr);
+ }
break;
default:
return 2;
|