All public function must lock the mutex. And therefore none of the journal
function may call public function because the mutex is already locked.
So have a public commit that lock the mutex, and a private commitInternal
that assume the mutex is locked
Such as:
Error opening the db: "Driver not loaded Driver not loaded"
or
QSqlDatabasePrivate::removeDatabase: connection '...' is still in use, all queries will cease to wor
We need to clear the QSqlDatabase _db handle before calling removeDatabase.
And we also need to give a different name to different folder database, just to be sure
In original csync, csync_get_status() returned the status variable from
the context, which indicated in which state the sync run currently is,
which is never used.
What we expected in our mirall code however is the CSYNC_STATUS as
detailed result of a certain operation. Changed the function to reflect
that, even if that is an evil API change.
Since we use a database with the non default name, we need to do that,
otherwise the query is initialized on the default db which is not open
in our case.
I got those warnings for the latter sync runs:
11-19 10:58:15:997 QSqlDatabasePrivate::removeDatabase: connection 'qt_sql_default_connection' is still in use, all queries will cease to work.
11-19 10:58:15:997 QSqlDatabasePrivate::addDatabase: duplicate connection name 'qt_sql_default_connection', old connection removed.
If the QSqlQuery class is called with a query in the constructor, the query
is executed immediately. In fact, we executed each query twice before.
Later on we might want to implement a wrapper clas around the query.
As the csync updater opens the database itself, it is cleaner to close
the db before and open it again after csync has finished.
Added a close method to the journal class.
QSettings automatically does escaping. When UTF-8 was set, I
got all kind of problems with the QByteArray for the geometry
and the umlaut in my name for the proxy user.