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:
allexzander 2023-04-11 10:50:14 +02:00 committed by GitHub
commit 663b0d9c37
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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)