PropagateDirectory: Remove dead code
authorChristian Kamm <mail@ckamm.de>
Fri, 29 Mar 2019 09:14:31 +0000 (10:14 +0100)
committerKevin Ottens <kevin.ottens@nextcloud.com>
Tue, 15 Dec 2020 09:58:46 +0000 (10:58 +0100)
1. The _firstJob is usually deleted by the time the PropagateDirectory
   finishes. (deleteLater() is called early)
2. The PropagateDirectory::_item and PropagateRemoteMkdir::_item point
   to the same SyncFileItem anyway. This code is a leftover from when
   each job had its own instance.

src/libsync/owncloudpropagator.cpp

index 7b6d7191df11f1ac6a7c07a455162e1281d26ec8..781ee30b7fb677c4bf6ccdb4d38b1c3e2ad3d7e1 100644 (file)
@@ -971,12 +971,6 @@ void PropagateDirectory::slotSubJobsFinished(SyncFileItem::Status status)
         if (_item->_instruction == CSYNC_INSTRUCTION_RENAME
             || _item->_instruction == CSYNC_INSTRUCTION_NEW
             || _item->_instruction == CSYNC_INSTRUCTION_UPDATE_METADATA) {
-            if (auto *mkdir = qobject_cast<PropagateRemoteMkdir *>(_firstJob.data())) {
-                // special case from MKDIR, get the fileId from the job there
-                if (_item->_fileId.isEmpty() && !mkdir->_item->_fileId.isEmpty()) {
-                    _item->_fileId = mkdir->_item->_fileId;
-                }
-            }
             if (!propagator()->updateMetadata(*_item)) {
                 status = _item->_status = SyncFileItem::FatalError;
                 _item->_errorString = tr("Error writing metadata to the database");