Skip to content

Commit

Permalink
Merge pull request #5592 from nextcloud/backport/5588/stable-3.8
Browse files Browse the repository at this point in the history
[stable-3.8] Edit locally. Restart current folder sync immediately after file opened.
  • Loading branch information
allexzander authored Apr 11, 2023
2 parents 22e15ba + 364f7b5 commit a9c2194
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 a9c2194

Please sign in to comment.