{
eraseBlacklistRecordForItem();
if (!checkIfFileParentSyncIsNeeded()) {
- lockFile();
+ processLocalItem();
return;
}
if (item->_file == _relativePathToRemoteRoot) {
disconnect(&_folderForFile->syncEngine(), &SyncEngine::itemCompleted, this, &EditLocallyJob::slotItemCompleted);
disconnect(&_folderForFile->syncEngine(), &SyncEngine::itemDiscovered, this, &EditLocallyJob::slotItemDiscovered);
- lockFile();
+ processLocalItem();
}
}
});
}
+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);
void slotLsColJobFinishedWithError(QNetworkReply *reply);
void slotDirectoryListingIterated(const QString &name, const QMap<QString, QString> &properties);
+ void processLocalItem();
void openFile();
void lockFile();