Edit locally. Restart current folder sync immediately after file opened.

Signed-off-by: alex-z <blackslayer4@gmail.com>
This commit is contained in:
alex-z 2023-04-07 17:37:50 +02:00 committed by allexzander
parent d4f5081f91
commit 54c13a560d
2 changed files with 10 additions and 0 deletions

View file

@ -452,6 +452,7 @@ void EditLocallyJob::startEditLocally()
});
_folderForFile->setSilenceErrorsUntilNextSync(true);
_folderForFile->slotTerminateSync();
_shouldScheduleFolderSyncAfterFileIsOpened = true;
return;
}
@ -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;
@ -553,6 +556,11 @@ void EditLocallyJob::openFile()
}
Systray::instance()->destroyEditFileLocallyLoadingDialog();
if (_shouldScheduleFolderSyncAfterFileIsOpened) {
_folderForFile->startSync();
}
emit finished();
});
}

View file

@ -92,6 +92,8 @@ private:
bool _tokenVerified = false;
bool _shouldScheduleFolderSyncAfterFileIsOpened = false;
AccountStatePtr _accountState;
QString _userId;
QString _relPath; // full remote path for a file (as on the server)