mirror of
https://github.com/nextcloud/desktop.git
synced 2025-10-26 11:17:43 +00:00
Merge pull request #5588 from nextcloud/feature/restart-folder-sync
Edit locally. Restart current folder sync immediately after file opened.
This commit is contained in:
commit
663b0d9c37
@ -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();
|
||||
});
|
||||
}
|
||||
|
||||
@ -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)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user