From 350283fe065b7764dd0bc482c6e36a8ea6e03bdb Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Fri, 28 Mar 2014 10:23:09 +0100 Subject: [PATCH] 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 dfb94bb5d..0e817f43e 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 #include #include -#include #include #include #include @@ -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 3432e863a..1ff8e0b65 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: