mirror of
https://github.com/nextcloud/desktop.git
synced 2024-10-24 21:35:47 +03:00
Start fs watching with a delay of 2 seconds to don't catch the journal changes.
This commit is contained in:
parent
a124dcd4e8
commit
8af257a4cd
4 changed files with 22 additions and 13 deletions
|
@ -217,11 +217,6 @@ cleanup:
|
|||
qDebug() << "CSync run took " << t.elapsed() << " Milliseconds";
|
||||
|
||||
qDebug() << "CSync Waiting a bit to let OS finish up IO";
|
||||
#ifdef Q_OS_WIN
|
||||
Sleep(2000);
|
||||
#else
|
||||
::sleep(2);
|
||||
#endif
|
||||
qDebug() << "CSync End Waiting";
|
||||
|
||||
emit(finished());
|
||||
|
|
|
@ -280,7 +280,7 @@ void Folder::slotSyncStarted()
|
|||
|
||||
void Folder::slotSyncFinished(const SyncResult &result)
|
||||
{
|
||||
_watcher->setEventsEnabled(true);
|
||||
_watcher->setEventsEnabledDelayed(2000);
|
||||
|
||||
qDebug() << "OO folder slotSyncFinished: result: " << int(result.status()) << " local: " << result.localRunOnly();
|
||||
emit syncStateChange();
|
||||
|
|
|
@ -102,6 +102,12 @@ bool FolderWatcher::eventsEnabled() const
|
|||
return _eventsEnabled;
|
||||
}
|
||||
|
||||
void FolderWatcher::setEventsEnabledDelayed( int delay_msec )
|
||||
{
|
||||
qDebug() << "Starting Event logging again in " << delay_msec << " milliseconds";
|
||||
QTimer::singleShot( delay_msec, this, SLOT(setEventsEnabled()));
|
||||
}
|
||||
|
||||
void FolderWatcher::setEventsEnabled(bool enabled)
|
||||
{
|
||||
qDebug() << " * event notification " << (enabled ? "enabled" : "disabled");
|
||||
|
|
|
@ -75,13 +75,6 @@ public:
|
|||
*/
|
||||
bool eventsEnabled() const;
|
||||
|
||||
/**
|
||||
* Enabled or disables folderChanged() events.
|
||||
* If disabled, events are accumulated and emptied
|
||||
* the next time a folderChanged() event happens.
|
||||
*/
|
||||
void setEventsEnabled(bool enabled);
|
||||
|
||||
/**
|
||||
* Clear all pending events
|
||||
*/
|
||||
|
@ -100,6 +93,21 @@ public:
|
|||
void setEventInterval(int seconds);
|
||||
|
||||
QStringList ignores() const;
|
||||
public slots:
|
||||
/**
|
||||
* Enabled or disables folderChanged() events.
|
||||
* If disabled, events are accumulated and emptied
|
||||
* the next time a folderChanged() event happens.
|
||||
*/
|
||||
void setEventsEnabled(bool enabled=true);
|
||||
|
||||
/**
|
||||
* @brief setEventsEnabledDelayed - start event logging after a while
|
||||
* @param delay - delay time in milliseconds
|
||||
* @param enabled - enable the events.
|
||||
*/
|
||||
void setEventsEnabledDelayed( int );
|
||||
|
||||
signals:
|
||||
/**
|
||||
* Emitted when one of the paths is changed
|
||||
|
|
Loading…
Reference in a new issue