// The user already accepted the selective sync dialog. everything is in the white list
f->journalDb()->setSelectiveSyncList(SyncJournalDb::SelectiveSyncWhiteList,
QStringList() << QLatin1String("/"));
- folderMan->slotScheduleAllFolders();
+ folderMan->scheduleAllFolders();
emit folderChanged();
}
}
return;
}
- folderMan->slotRemoveFolder( folderMan->folder(alias) );
+ folderMan->removeFolder( folderMan->folder(alias) );
_model->removeRow(row);
// single folder fix to show add-button and hide remove-button
QString alias = _model->data( selected, FolderStatusDelegate::FolderAliasRole ).toString();
FolderMan *folderMan = FolderMan::instance();
- folderMan->slotScheduleSync(folderMan->folder(alias));
+ folderMan->scheduleFolder(folderMan->folder(alias));
}
void AccountSettings::slotOpenOC()
if (FolderDefinition::load(*settings, folderAlias, &folderDefinition)) {
Folder* f = addFolderInternal(std::move(folderDefinition), account.data());
if (f) {
- slotScheduleSync(f);
+ scheduleFolder(f);
emit folderSyncStateChange(f);
}
}
foreach ( const QString& alias, list ) {
Folder *f = setupFolderFromOldConfigFile( alias, accountState );
if( f ) {
- slotScheduleSync(f);
+ scheduleFolder(f);
emit folderSyncStateChange(f);
}
}
if (!paused) {
_disabledFolders.remove(f);
- slotScheduleSync(f);
+ scheduleFolder(f);
} else {
_disabledFolders.insert(f);
}
return 0;
}
-void FolderMan::slotScheduleAllFolders()
+void FolderMan::scheduleAllFolders()
{
foreach( Folder *f, _folderMap.values() ) {
if (f && f->canSync()) {
- slotScheduleSync( f );
+ scheduleFolder( f );
}
}
}
* 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.
*/
-void FolderMan::slotScheduleSync( Folder *f )
+void FolderMan::scheduleFolder( Folder *f )
{
if( !f ) {
qWarning() << "slotScheduleSync called with null folder";
if (f
&& f->canSync()
&& f->accountState() == accountState) {
- slotScheduleSync(f);
+ scheduleFolder(f);
}
}
} else {
}
foreach (const auto &f, foldersToRemove) {
- slotRemoveFolder(f);
+ removeFolder(f);
}
}
<< "because it has been" << msecsSinceSync << "ms "
<< "since the last sync";
- slotScheduleSync(f);
+ scheduleFolder(f);
continue;
}
<< f->syncResult().statusString()
<< "time since last sync:" << msecsSinceSync;
- slotScheduleSync(f);
+ scheduleFolder(f);
continue;
}
return re;
}
-void FolderMan::slotRemoveFolder( Folder *f )
+void FolderMan::removeFolder( Folder *f )
{
if( !f ) {
qWarning() << "!! Can not remove null folder";
*/
Folder* addFolder(AccountState* accountState, const FolderDefinition& folderDefinition);
+ /** Removes a folder */
+ void removeFolder( Folder* );
+
/** Returns the folder which the file or directory stored in path is in */
Folder* folderForPath(const QString& path);
*/
Folder* currentSyncFolder() const;
+ /** Removes all folders */
+ int unloadAndDeleteAllFolders();
+
+ /**
+ * If enabled is set to false, no new folders will start to sync.
+ * The current one will finish.
+ */
+ void setSyncEnabled( bool );
+
+ /** Queues a folder for syncing. */
+ void scheduleFolder(Folder*);
+
+ /** Queues all folders for syncing. */
+ void scheduleAllFolders();
+
+ void setDirtyProxy(bool value = true);
+ void setDirtyNetworkLimits();
+
signals:
/**
* signal to indicate a folder has changed its sync state.
*/
void scheduleQueueChanged();
- void folderListChanged(const Folder::Map &);
-
-public slots:
- void slotRemoveFolder( Folder* );
- void slotFolderSyncPaused(Folder *, bool paused);
- void slotFolderCanSyncChanged();
-
- void slotFolderSyncStarted();
- void slotFolderSyncFinished( const SyncResult& );
-
/**
- * Terminates the current folder sync.
- *
- * It does not switch the folder to paused state.
+ * Emitted whenever the list of configured folders changes.
*/
- void terminateSyncProcess();
-
- /* delete all folder objects */
- int unloadAndDeleteAllFolders();
-
- // if enabled is set to false, no new folders will start to sync.
- // the current one will finish.
- void setSyncEnabled( bool );
-
- void slotScheduleAllFolders();
-
- void setDirtyProxy(bool value = true);
- void setDirtyNetworkLimits();
+ void folderListChanged(const Folder::Map &);
- // slot to add a folder to the syncing queue
- void slotScheduleSync(Folder*);
- // slot to schedule an ETag job
- void slotScheduleETagJob ( const QString &alias, RequestEtagJob *job);
- void slotEtagJobDestroyed (QObject*);
- void slotRunOneEtagJob();
+public slots:
/**
* Schedules folders of newly connected accounts, terminates and
*/
void slotSyncOnceFileUnlocks(const QString& path);
+ // slot to schedule an ETag job (from Folder only)
+ void slotScheduleETagJob ( const QString &alias, RequestEtagJob *job);
+
private slots:
+ void slotFolderSyncPaused(Folder *, bool paused);
+ void slotFolderCanSyncChanged();
+ void slotFolderSyncStarted();
+ void slotFolderSyncFinished( const SyncResult& );
+
+ void slotRunOneEtagJob();
+ void slotEtagJobDestroyed (QObject*);
+
// slot to take the next folder from queue and start syncing.
void slotStartScheduledFolderSync();
void slotEtagPollTimerTimeout();
void slotScheduleFolderByTime();
private:
+ /**
+ * Terminates the current folder sync.
+ *
+ * It does not switch the folder to paused state.
+ */
+ void terminateSyncProcess();
+
/** Adds a new folder, does not add it to the account settings and
* does not set an account on the new folder.
*/