diff --git a/src/mirall/ownsql.cpp b/src/mirall/ownsql.cpp index 567c3104b..da9d521f8 100644 --- a/src/mirall/ownsql.cpp +++ b/src/mirall/ownsql.cpp @@ -99,7 +99,7 @@ sqlite3* SqlDatabase::sqliteDb() /* =========================================================================================== */ -SqlQuery::SqlQuery( SqlDatabase db ) +SqlQuery::SqlQuery( SqlDatabase& db ) :_db(db.sqliteDb()), _stmt(0) { @@ -113,7 +113,7 @@ SqlQuery::~SqlQuery() } } -SqlQuery::SqlQuery(const QString& sql, SqlDatabase db) +SqlQuery::SqlQuery(const QString& sql, SqlDatabase& db) :_db(db.sqliteDb()), _stmt(0) { diff --git a/src/mirall/ownsql.h b/src/mirall/ownsql.h index 31864c182..055be3372 100644 --- a/src/mirall/ownsql.h +++ b/src/mirall/ownsql.h @@ -25,6 +25,7 @@ namespace Mirall { class OWNCLOUDSYNC_EXPORT SqlDatabase { + Q_DISABLE_COPY(SqlDatabase) public: explicit SqlDatabase(); @@ -48,8 +49,8 @@ class OWNCLOUDSYNC_EXPORT SqlQuery Q_DISABLE_COPY(SqlQuery) public: explicit SqlQuery(); - explicit SqlQuery(SqlDatabase db); - explicit SqlQuery(const QString& sql, SqlDatabase db); + explicit SqlQuery(SqlDatabase& db); + explicit SqlQuery(const QString& sql, SqlDatabase& db); ~SqlQuery(); QString error() const; diff --git a/src/mirall/syncjournaldb.cpp b/src/mirall/syncjournaldb.cpp index 51b0f1106..bd0856582 100644 --- a/src/mirall/syncjournaldb.cpp +++ b/src/mirall/syncjournaldb.cpp @@ -359,7 +359,6 @@ void SyncJournalDb::close() _possibleUpgradeFromMirall_1_5 = false; _db.close(); - _db = SqlDatabase(); // avoid the warning SqlDatabasePrivate::removeDatabase: connection [...] still in use _avoidReadFromDbOnNextSyncFilter.clear(); }