Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/owncloud/client.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKlaas Freitag <freitag@owncloud.com>2013-02-19 20:24:10 +0400
committerKlaas Freitag <freitag@owncloud.com>2013-02-19 20:24:10 +0400
commit817039ddf39e3535c043234c8ce29e3e5123f52c (patch)
tree930c09fba2fcdd29859af274682298a7fcb93f20 /src/mirall
parent6d6deaf6c46a5c1bed810b933963be36507ea3d2 (diff)
Simplify and fix startup: Steer starting of sync from folderman.
Diffstat (limited to 'src/mirall')
-rw-r--r--src/mirall/application.cpp4
-rw-r--r--src/mirall/folderman.cpp7
-rw-r--r--src/mirall/folderman.h2
-rw-r--r--src/mirall/folderwatcher.cpp6
-rw-r--r--src/mirall/folderwatcher.h3
5 files changed, 15 insertions, 7 deletions
diff --git a/src/mirall/application.cpp b/src/mirall/application.cpp
index 9cf26fc3e..7c238a42c 100644
--- a/src/mirall/application.cpp
+++ b/src/mirall/application.cpp
@@ -373,6 +373,10 @@ void Application::slotAuthCheck( const QString& ,QNetworkReply *reply )
if( _tray )
_tray->showMessage(tr("%1 Sync Started").arg(_theme->appName()),
tr("Sync started for %1 configured sync folder(s).").arg(cnt));
+
+ // queue up the sync for all folders.
+ _folderMan->slotScheduleAllFolders();
+
computeOverallSyncStatus();
_actionAddFolder->setEnabled( true );
diff --git a/src/mirall/folderman.cpp b/src/mirall/folderman.cpp
index 3687d2999..6923027fe 100644
--- a/src/mirall/folderman.cpp
+++ b/src/mirall/folderman.cpp
@@ -352,6 +352,13 @@ SyncResult FolderMan::syncResult( const QString& alias )
return res;
}
+void FolderMan::slotScheduleAllFolders()
+{
+ foreach( Folder *f, _folderMap.values() ) {
+ slotScheduleSync( f->alias() );
+ }
+}
+
/*
* 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.
diff --git a/src/mirall/folderman.h b/src/mirall/folderman.h
index 0826d844c..d0110e277 100644
--- a/src/mirall/folderman.h
+++ b/src/mirall/folderman.h
@@ -98,6 +98,8 @@ public slots:
// the current one will finish.
void setSyncEnabled( bool );
+ void slotScheduleAllFolders();
+
private slots:
// slot to add a folder to the syncing queue
void slotScheduleSync( const QString & );
diff --git a/src/mirall/folderwatcher.cpp b/src/mirall/folderwatcher.cpp
index 73c170918..55634be33 100644
--- a/src/mirall/folderwatcher.cpp
+++ b/src/mirall/folderwatcher.cpp
@@ -47,8 +47,7 @@ FolderWatcher::FolderWatcher(const QString &root, QObject *parent)
_eventsEnabled(true),
_eventInterval(DEFAULT_EVENT_INTERVAL_MSEC),
_root(root),
- _processTimer(new QTimer(this)),
- _initialSyncDone(false)
+ _processTimer(new QTimer(this))
{
_d = new FolderWatcherPrivate(this);
@@ -147,13 +146,12 @@ void FolderWatcher::slotProcessTimerTimeout()
{
qDebug() << "* Processing of event queue for" << root();
- if (!_pendingPathes.empty() || !_initialSyncDone) {
+ if (!_pendingPathes.empty() ) {
QStringList notifyPaths = _pendingPathes.keys();
_pendingPathes.clear();
//qDebug() << lastEventTime << eventTime;
qDebug() << " * Notify" << notifyPaths.size() << "change items for" << root();
emit folderChanged(notifyPaths);
- _initialSyncDone = true;
}
}
diff --git a/src/mirall/folderwatcher.h b/src/mirall/folderwatcher.h
index 40fa0c00f..f920ffab4 100644
--- a/src/mirall/folderwatcher.h
+++ b/src/mirall/folderwatcher.h
@@ -134,9 +134,6 @@ private:
// QStringList _pendingPaths;
QTimer *_processTimer;
QStringList _ignores;
- // for the initial synchronization, without
- // any file changed
- bool _initialSyncDone;
friend class FolderWatcherPrivate;
};