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->setSilenceErrorsUntilNextSync(true);
_folderForFile->slotTerminateSync(); _folderForFile->slotTerminateSync();
_shouldScheduleFolderSyncAfterFileIsOpened = true;
return; return;
} }
@ -538,6 +539,8 @@ void EditLocallyJob::slotItemDiscovered(const OCC::SyncFileItemPtr &item)
void EditLocallyJob::openFile() void EditLocallyJob::openFile()
{ {
Q_ASSERT(_folderForFile);
if(_localFilePath.isEmpty()) { if(_localFilePath.isEmpty()) {
qCWarning(lcEditLocallyJob) << "Could not edit locally. Invalid local file path."; qCWarning(lcEditLocallyJob) << "Could not edit locally. Invalid local file path.";
return; return;
@ -553,6 +556,11 @@ void EditLocallyJob::openFile()
} }
Systray::instance()->destroyEditFileLocallyLoadingDialog(); Systray::instance()->destroyEditFileLocallyLoadingDialog();
if (_shouldScheduleFolderSyncAfterFileIsOpened) {
_folderForFile->startSync();
}
emit finished(); emit finished();
}); });
} }

View file

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