SqlDatabase: Make it non-copyable.

This commit is contained in:
Christian Kamm 2014-10-23 15:34:07 +02:00
parent 6d81e5c87a
commit 5640cbf653
3 changed files with 5 additions and 5 deletions

View file

@ -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)
{

View file

@ -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;

View file

@ -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();
}