1
0
mirror of https://github.com/strawberrymusicplayer/strawberry synced 2025-01-16 19:00:42 +01:00

Add error handling for enabling FTS3

This commit is contained in:
Jonas Kvinge 2018-09-30 14:54:14 +02:00
parent b07ae3d34e
commit 3694765611

View File

@ -283,7 +283,11 @@ QSqlDatabase Database::Connect() {
QVariant v = db.driver()->handle(); QVariant v = db.driver()->handle();
if (v.isValid() && qstrcmp(v.typeName(), "sqlite3*") == 0) { if (v.isValid() && qstrcmp(v.typeName(), "sqlite3*") == 0) {
sqlite3 *handle = *static_cast<sqlite3**>(v.data()); sqlite3 *handle = *static_cast<sqlite3**>(v.data());
if (handle) sqlite3_db_config(handle, SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER, 1, NULL); if (handle) {
int result = sqlite3_db_config(handle, SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER, 1, NULL);
if (result != SQLITE_OK) qLog(Fatal) << "Unable to enable FTS3 tokenizer";
}
else qLog(Fatal) << "Unable to enable FTS3 tokenizer";
} }
#endif #endif
QSqlQuery set_fts_tokenizer(db); QSqlQuery set_fts_tokenizer(db);