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
This commit is contained in:
Olivier Goffart 2014-03-28 10:23:09 +01:00
parent 2ba62b79b4
commit 350283fe06
2 changed files with 2 additions and 39 deletions

View file

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

View file

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