Skip to content

Commit

Permalink
Only create a FolderWatcher if the path exists
Browse files Browse the repository at this point in the history
Also retry creating it before each sync.

See owncloud#5317
  • Loading branch information
ckamm committed Dec 13, 2016
1 parent a627ad6 commit 9953c06
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/gui/folderman.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ int FolderMan::unloadAndDeleteAllFolders()
void FolderMan::registerFolderMonitor( Folder *folder )
{
if( !folder ) return;
if( !QDir(folder->path()).exists() ) return;

if( !_folderWatchers.contains(folder->alias() ) ) {
FolderWatcher *fw = new FolderWatcher(folder->path(), folder);
Expand Down Expand Up @@ -730,6 +731,10 @@ void FolderMan::slotStartScheduledFolderSync()

// Start syncing this folder!
if( folder ) {
// Safe to call several times, and necessary to try again if
// the folder path didn't exist previously.
registerFolderMonitor(folder);

_currentSyncFolder = folder;
folder->startSync( QStringList() );
}
Expand Down

0 comments on commit 9953c06

Please sign in to comment.