[Pkg-owncloud-commits] [owncloud-client] 225/333: SyncEngine: Sanity bail out if DB does not exist suddenly

Sandro Knauß hefee-guest at moszumanska.debian.org
Thu Apr 17 23:16:56 UTC 2014


This is an automated email from the git hooks/post-receive script.

hefee-guest pushed a commit to branch master
in repository owncloud-client.

commit d5659442b2d13850528d0bb3a9eb981e9a4faf0d
Author: Markus Goetz <markus at woboq.com>
Date:   Wed Mar 26 16:57:50 2014 +0100

    SyncEngine: Sanity bail out if DB does not exist suddenly
    
    The update/reconcile worked for me, but the Propagate step had an invalid DB
    path but still went on (and then messed things up)
---
 src/mirall/syncengine.cpp  | 7 +++++++
 src/mirall/syncjournaldb.h | 4 +++-
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/src/mirall/syncengine.cpp b/src/mirall/syncengine.cpp
index b0745b7..8ae199e 100644
--- a/src/mirall/syncengine.cpp
+++ b/src/mirall/syncengine.cpp
@@ -524,6 +524,13 @@ void SyncEngine::slotUpdateFinished(int updateResult)
         it->_file = adjustRenamedPath(it->_file);
     }
 
+    // Sanity check
+    if (!_journal->checkConnect()) {
+        qDebug() << "Bailing out, DB failure";
+        QMetaObject::invokeMethod(this, "finished", Qt::QueuedConnection); // signal
+        return;
+    }
+
     // To announce the beginning of the sync
     emit transmissionProgress(_progressInfo);
 
diff --git a/src/mirall/syncjournaldb.h b/src/mirall/syncjournaldb.h
index ae49937..f6f80bf 100644
--- a/src/mirall/syncjournaldb.h
+++ b/src/mirall/syncjournaldb.h
@@ -75,6 +75,9 @@ public:
 
     void close();
 
+    bool checkConnect();
+
+
 
 signals:
 
@@ -89,7 +92,6 @@ private:
     void commitTransaction();
     QStringList tableColumns( const QString& table );
 
-    bool checkConnect();
     QSqlDatabase _db;
     QString _dbFile;
     QMutex _mutex; // Public functions are protected with the mutex.

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud-client.git



More information about the Pkg-owncloud-commits mailing list