mirror of https://github.com/nextcloud/desktop
Merge pull request #5317 from nextcloud/bugfix/edit-locally-folder-lock
Don't try to lock folders when editing locally
This commit is contained in:
commit
d69583ba12
|
@ -253,7 +253,7 @@ void EditLocallyJob::startSyncBeforeOpening()
|
|||
{
|
||||
eraseBlacklistRecordForItem();
|
||||
if (!checkIfFileParentSyncIsNeeded()) {
|
||||
lockFile();
|
||||
processLocalItem();
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -467,7 +467,7 @@ void EditLocallyJob::slotItemCompleted(const OCC::SyncFileItemPtr &item)
|
|||
if (item->_file == _relativePathToRemoteRoot) {
|
||||
disconnect(&_folderForFile->syncEngine(), &SyncEngine::itemCompleted, this, &EditLocallyJob::slotItemCompleted);
|
||||
disconnect(&_folderForFile->syncEngine(), &SyncEngine::itemDiscovered, this, &EditLocallyJob::slotItemDiscovered);
|
||||
lockFile();
|
||||
processLocalItem();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -557,6 +557,21 @@ void EditLocallyJob::openFile()
|
|||
});
|
||||
}
|
||||
|
||||
void EditLocallyJob::processLocalItem()
|
||||
{
|
||||
Q_ASSERT(_folderForFile);
|
||||
|
||||
SyncJournalFileRecord rec;
|
||||
const auto ok = _folderForFile->journalDb()->getFileRecord(_relativePathToRemoteRoot, &rec);
|
||||
Q_ASSERT(ok);
|
||||
|
||||
if (rec.isDirectory()) { // Directories not lock-able
|
||||
openFile();
|
||||
} else {
|
||||
lockFile();
|
||||
}
|
||||
}
|
||||
|
||||
void EditLocallyJob::lockFile()
|
||||
{
|
||||
Q_ASSERT(_accountState);
|
||||
|
|
|
@ -71,6 +71,7 @@ private slots:
|
|||
void slotLsColJobFinishedWithError(QNetworkReply *reply);
|
||||
void slotDirectoryListingIterated(const QString &name, const QMap<QString, QString> &properties);
|
||||
|
||||
void processLocalItem();
|
||||
void openFile();
|
||||
void lockFile();
|
||||
|
||||
|
|
Loading…
Reference in New Issue