|
@@ -22,6 +22,7 @@
|
|
|
#include "accountstate.h"
|
|
#include "accountstate.h"
|
|
|
#include "accountmanager.h"
|
|
#include "accountmanager.h"
|
|
|
#include "filesystem.h"
|
|
#include "filesystem.h"
|
|
|
|
|
+#include "lockwatcher.h"
|
|
|
#include <syncengine.h>
|
|
#include <syncengine.h>
|
|
|
|
|
|
|
|
#ifdef Q_OS_MAC
|
|
#ifdef Q_OS_MAC
|
|
@@ -44,6 +45,7 @@ FolderMan::FolderMan(QObject *parent) :
|
|
|
QObject(parent),
|
|
QObject(parent),
|
|
|
_currentSyncFolder(0),
|
|
_currentSyncFolder(0),
|
|
|
_syncEnabled( true ),
|
|
_syncEnabled( true ),
|
|
|
|
|
+ _lockWatcher(new LockWatcher),
|
|
|
_appRestartRequired(false)
|
|
_appRestartRequired(false)
|
|
|
{
|
|
{
|
|
|
Q_ASSERT(!_instance);
|
|
Q_ASSERT(!_instance);
|
|
@@ -64,6 +66,9 @@ FolderMan::FolderMan(QObject *parent) :
|
|
|
|
|
|
|
|
connect(AccountManager::instance(), SIGNAL(accountRemoved(AccountState*)),
|
|
connect(AccountManager::instance(), SIGNAL(accountRemoved(AccountState*)),
|
|
|
SLOT(slotRemoveFoldersForAccount(AccountState*)));
|
|
SLOT(slotRemoveFoldersForAccount(AccountState*)));
|
|
|
|
|
+
|
|
|
|
|
+ connect(_lockWatcher.data(), SIGNAL(fileUnlocked(QString)),
|
|
|
|
|
+ SLOT(slotScheduleFolderOwningFile(QString)));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
FolderMan *FolderMan::instance()
|
|
FolderMan *FolderMan::instance()
|
|
@@ -460,6 +465,11 @@ void FolderMan::slotScheduleAppRestart()
|
|
|
qDebug() << "## Application restart requested!";
|
|
qDebug() << "## Application restart requested!";
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+void FolderMan::slotSyncOnceFileUnlocks(const QString& path)
|
|
|
|
|
+{
|
|
|
|
|
+ _lockWatcher->addFile(path);
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
/*
|
|
/*
|
|
|
* if a folder wants to be synced, it calls this slot and is added
|
|
* if a folder wants to be synced, it calls this slot and is added
|
|
|
* to the queue. The slot to actually start a sync is called afterwards.
|
|
* to the queue. The slot to actually start a sync is called afterwards.
|
|
@@ -744,6 +754,13 @@ void FolderMan::slotServerVersionChanged(Account *account)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+void FolderMan::slotScheduleFolderOwningFile(const QString& path)
|
|
|
|
|
+{
|
|
|
|
|
+ if (Folder* f = folderForPath(path)) {
|
|
|
|
|
+ slotScheduleSync(f);
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
void FolderMan::slotFolderSyncStarted( )
|
|
void FolderMan::slotFolderSyncStarted( )
|
|
|
{
|
|
{
|
|
|
qDebug() << ">===================================== sync started for " << _currentSyncFolder->remoteUrl().toString();
|
|
qDebug() << ">===================================== sync started for " << _currentSyncFolder->remoteUrl().toString();
|