Skip to content

Commit

Permalink
Edit locally. Restart current folder sync immediately after file opened.
Browse files Browse the repository at this point in the history
Signed-off-by: alex-z <blackslayer4@gmail.com>
  • Loading branch information
allexzander committed Apr 7, 2023
1 parent b655fce commit d2acd80
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/gui/editlocallyjob.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,7 @@ void EditLocallyJob::startEditLocally()
});
_folderForFile->setSilenceErrorsUntilNextSync(true);
_folderForFile->slotTerminateSync();
_shouldScheduleFolderSyncAfterFileIsOpened = true;

return;
}
Expand Down Expand Up @@ -538,6 +539,8 @@ void EditLocallyJob::slotItemDiscovered(const OCC::SyncFileItemPtr &item)

void EditLocallyJob::openFile()
{
Q_ASSERT(_folderForFile);

if(_localFilePath.isEmpty()) {
qCWarning(lcEditLocallyJob) << "Could not edit locally. Invalid local file path.";
return;
Expand All @@ -553,6 +556,11 @@ void EditLocallyJob::openFile()
}

Systray::instance()->destroyEditFileLocallyLoadingDialog();

if (_shouldScheduleFolderSyncAfterFileIsOpened) {
_folderForFile->startSync();
}

emit finished();
});
}
Expand Down
2 changes: 2 additions & 0 deletions src/gui/editlocallyjob.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ private slots:

bool _tokenVerified = false;

bool _shouldScheduleFolderSyncAfterFileIsOpened = false;

AccountStatePtr _accountState;
QString _userId;
QString _relPath; // full remote path for a file (as on the server)
Expand Down

0 comments on commit d2acd80

Please sign in to comment.