Skip to content

Commit d2acd80

Browse files
committed
Edit locally. Restart current folder sync immediately after file opened.
Signed-off-by: alex-z <blackslayer4@gmail.com>
1 parent b655fce commit d2acd80

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

src/gui/editlocallyjob.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -452,6 +452,7 @@ void EditLocallyJob::startEditLocally()
452452
});
453453
_folderForFile->setSilenceErrorsUntilNextSync(true);
454454
_folderForFile->slotTerminateSync();
455+
_shouldScheduleFolderSyncAfterFileIsOpened = true;
455456

456457
return;
457458
}
@@ -538,6 +539,8 @@ void EditLocallyJob::slotItemDiscovered(const OCC::SyncFileItemPtr &item)
538539

539540
void EditLocallyJob::openFile()
540541
{
542+
Q_ASSERT(_folderForFile);
543+
541544
if(_localFilePath.isEmpty()) {
542545
qCWarning(lcEditLocallyJob) << "Could not edit locally. Invalid local file path.";
543546
return;
@@ -553,6 +556,11 @@ void EditLocallyJob::openFile()
553556
}
554557

555558
Systray::instance()->destroyEditFileLocallyLoadingDialog();
559+
560+
if (_shouldScheduleFolderSyncAfterFileIsOpened) {
561+
_folderForFile->startSync();
562+
}
563+
556564
emit finished();
557565
});
558566
}

src/gui/editlocallyjob.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,8 @@ private slots:
9292

9393
bool _tokenVerified = false;
9494

95+
bool _shouldScheduleFolderSyncAfterFileIsOpened = false;
96+
9597
AccountStatePtr _accountState;
9698
QString _userId;
9799
QString _relPath; // full remote path for a file (as on the server)

0 commit comments

Comments
 (0)