From 44f406ce95c340b24604ee6e61d9f8428b5c2cb4 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Wed, 25 Jan 2017 22:08:37 -0800 Subject: [PATCH] Stop using sqlite3_enable_shared_cache: deprecated on macOS qsql_sqlite.cpp:643:5: warning: 'sqlite3_enable_shared_cache' is deprecated: first deprecated in macOS 10.7 [-Wdeprecated-declarations] https://www.sqlite.org/c3ref/enable_shared_cache.html says to use the flag to sqlite3_open_v2() Change-Id: Ib499cebaa4c4489b90b9fffd149d3d5bf9434ae5 Reviewed-by: Konstantin Ritt Reviewed-by: Jake Petroules --- src/plugins/sqldrivers/sqlite/qsql_sqlite.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/plugins/sqldrivers/sqlite/qsql_sqlite.cpp b/src/plugins/sqldrivers/sqlite/qsql_sqlite.cpp index b42fd74b3e..c2feaeea56 100644 --- a/src/plugins/sqldrivers/sqlite/qsql_sqlite.cpp +++ b/src/plugins/sqldrivers/sqlite/qsql_sqlite.cpp @@ -696,11 +696,10 @@ bool QSQLiteDriver::open(const QString & db, const QString &, const QString &, c } int openMode = (openReadOnlyOption ? SQLITE_OPEN_READONLY : (SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE)); + openMode |= (sharedCache ? SQLITE_OPEN_SHAREDCACHE : SQLITE_OPEN_PRIVATECACHE); if (openUriOption) openMode |= SQLITE_OPEN_URI; - sqlite3_enable_shared_cache(sharedCache); - if (sqlite3_open_v2(db.toUtf8().constData(), &d->access, openMode, NULL) == SQLITE_OK) { sqlite3_busy_timeout(d->access, timeOut); setOpen(true);