[Pkg-owncloud-commits] [owncloud-client] 258/333: Remove obsolete code that removed the sync journal when the sync directory is deleted

Sandro Knauß hefee-guest at moszumanska.debian.org
Thu Apr 17 23:17:01 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 350283fe065b7764dd0bc482c6e36a8ea6e03bdb
Author: Olivier Goffart <ogoffart at woboq.com>
Date:   Fri Mar 28 10:23:09 2014 +0100

    Remove obsolete code that removed the sync journal when the sync directory is deleted
    
    Since the journal is now in the same directory, we don't need this
    security anymore
    
    When the directory is removed, the sync will error out saying that the
    journal cannot be loaded or created
---
 src/mirall/folder.cpp | 37 ++-----------------------------------
 src/mirall/folder.h   |  4 ----
 2 files changed, 2 insertions(+), 39 deletions(-)

diff --git a/src/mirall/folder.cpp b/src/mirall/folder.cpp
index dfb94bb..0e817f4 100644
--- a/src/mirall/folder.cpp
+++ b/src/mirall/folder.cpp
@@ -48,7 +48,6 @@ CSYNC_EXCLUDE_TYPE csync_excluded(CSYNC *ctx, const char *path, int filetype);
 #include <QDebug>
 #include <QTimer>
 #include <QUrl>
-#include <QFileSystemWatcher>
 #include <QDir>
 #include <QMessageBox>
 #include <QPushButton>
@@ -73,9 +72,6 @@ Folder::Folder(const QString &alias, const QString &path, const QString& secondP
 
     MirallConfigFile cfg;
 
-    // QObject::connect(_watcher, SIGNAL(folderChanged(const QStringList &)),
-    //                 SLOT(slotChanged(const QStringList &)));
-
     _syncResult.setStatus( SyncResult::NotYetStarted );
 
     // check if the local path exists
@@ -165,14 +161,6 @@ void Folder::checkLocalPath()
             _syncResult.setStatus( SyncResult::SetupError );
         }
     }
-
-    // if all is fine, connect a FileSystemWatcher
-    if( _syncResult.status() != SyncResult::SetupError ) {
-        _pathWatcher = new QFileSystemWatcher(this);
-        _pathWatcher->addPath( _path );
-        connect(_pathWatcher, SIGNAL(directoryChanged(QString)),
-                SLOT(slotLocalPathChanged(QString)));
-    }
 }
 
 QString Folder::alias() const
@@ -460,26 +448,6 @@ int Folder::slotWipeBlacklist()
     return _journal.wipeBlacklist();
 }
 
-void Folder::slotLocalPathChanged( const QString& dir )
-{
-    QDir notifiedDir(dir);
-    QDir localPath( path() );
-
-    if( notifiedDir.absolutePath() == localPath.absolutePath() ) {
-        if( !localPath.exists() ) {
-            qDebug() << "XXXXXXX The sync folder root was removed!!";
-            if( isBusy() ) {
-                qDebug() << "CSync currently running, set wipe flag!!";
-            } else {
-                qDebug() << "CSync not running, wipe it now!!";
-                wipe();
-            }
-
-            qDebug() << "ALARM: The local path was DELETED!";
-        }
-    }
-}
-
 void Folder::setConfigFile( const QString& file )
 {
     _configFile = file;
@@ -515,10 +483,9 @@ void Folder::slotTerminateSync(bool block)
     setSyncEnabled(false);
 }
 
-// This removes the csync File database if the sync folder definition is removed
-// permanentely. This is needed to provide a clean startup again in case another
+// This removes the csync File database
+// This is needed to provide a clean startup again in case another
 // local folder is synced to the same ownCloud.
-// See http://bugs.owncloud.org/thebuggenie/owncloud/issues/oc-788
 void Folder::wipe()
 {
     QString stateDbFile = path()+QLatin1String(".csync_journal.db");
diff --git a/src/mirall/folder.h b/src/mirall/folder.h
index 3432e86..1ff8e0b 100644
--- a/src/mirall/folder.h
+++ b/src/mirall/folder.h
@@ -181,10 +181,6 @@ private slots:
     void etagRetreived(const QString &);
     void slotNetworkUnavailable();
 
-    /**
-     * Triggered by a file system watcher on the local sync dir
-     */
-    void slotLocalPathChanged( const QString& );
     void slotThreadTreeWalkResult(const SyncFileItemVector& );
 
 private:

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