diff --git a/src/gui/editlocallyjob.cpp b/src/gui/editlocallyjob.cpp index d20a9bb699c5..167cf99c33cb 100644 --- a/src/gui/editlocallyjob.cpp +++ b/src/gui/editlocallyjob.cpp @@ -206,7 +206,7 @@ void EditLocallyJob::fetchRemoteFileParentInfo() return; } - const auto job = new LsColJob(_accountState->account(), QDir::cleanPath(_folderForFile->remotePathTrailingSlash() + _relPathParent), this); + const auto job = new LsColJob(_accountState->account(), QDir::cleanPath(_folderForFile->remotePathTrailingSlash() + _relPathParent)); const QList props{QByteArrayLiteral("resourcetype"), QByteArrayLiteral("getlastmodified"), QByteArrayLiteral("getetag"), diff --git a/src/gui/folderstatusmodel.cpp b/src/gui/folderstatusmodel.cpp index 5bc886809e8e..9eb505be36ee 100644 --- a/src/gui/folderstatusmodel.cpp +++ b/src/gui/folderstatusmodel.cpp @@ -614,7 +614,7 @@ void FolderStatusModel::fetchMore(const QModelIndex &parent) path += infoPath; } - auto *job = new LsColJob(_accountState->account(), path, this); + auto *job = new LsColJob(_accountState->account(), path); info->_fetchingJob = job; auto props = QList() << "resourcetype" << "http://owncloud.org/ns:size" diff --git a/src/gui/folderwizard.cpp b/src/gui/folderwizard.cpp index 84fa76d0489e..87bf4e5e4851 100644 --- a/src/gui/folderwizard.cpp +++ b/src/gui/folderwizard.cpp @@ -464,7 +464,7 @@ void FolderWizardRemotePath::slotTypedPathFound(const QStringList &subpaths) LsColJob *FolderWizardRemotePath::runLsColJob(const QString &path) { - auto *job = new LsColJob(_account, path, this); + auto *job = new LsColJob(_account, path); auto props = QList() << "resourcetype"; if (_account->capabilities().clientSideEncryptionAvailable()) { props << "http://nextcloud.org/ns:is-encrypted"; diff --git a/src/gui/selectivesyncdialog.cpp b/src/gui/selectivesyncdialog.cpp index 1250a595e48b..595fde87c2c7 100644 --- a/src/gui/selectivesyncdialog.cpp +++ b/src/gui/selectivesyncdialog.cpp @@ -107,7 +107,7 @@ void SelectiveSyncWidget::refreshFolders() { _encryptedPaths.clear(); - auto *job = new LsColJob(_account, _folderPath, this); + auto *job = new LsColJob(_account, _folderPath); auto props = QList() << "resourcetype" << "http://owncloud.org/ns:size"; if (_account->capabilities().clientSideEncryptionAvailable()) { @@ -336,7 +336,7 @@ void SelectiveSyncWidget::slotItemExpanded(QTreeWidgetItem *item) if (!_folderPath.isEmpty()) { prefix = _folderPath + QLatin1Char('/'); } - auto *job = new LsColJob(_account, prefix + dir, this); + auto *job = new LsColJob(_account, prefix + dir); job->setProperties(QList() << "resourcetype" << "http://owncloud.org/ns:size"); connect(job, &LsColJob::directoryListingSubfolders, diff --git a/src/gui/shellextensionsserver.cpp b/src/gui/shellextensionsserver.cpp index b015831166a8..88c5571b8b12 100644 --- a/src/gui/shellextensionsserver.cpp +++ b/src/gui/shellextensionsserver.cpp @@ -168,7 +168,7 @@ void ShellExtensionsServer::processCustomStateRequest(QLocalSocket *socket, cons closeSession(socket); })); - auto *const lsColJob = new LsColJob(folder->accountState()->account(), QDir::cleanPath(folder->remotePath() + lsColJobPath), this); + auto *const lsColJob = new LsColJob(folder->accountState()->account(), QDir::cleanPath(folder->remotePath() + lsColJobPath)); lsColJob->setProperties({QByteArrayLiteral("http://owncloud.org/ns:share-types"), QByteArrayLiteral("http://owncloud.org/ns:permissions")}); const auto folderAlias = customStateRequestInfo.folderAlias; diff --git a/src/libsync/discoveryphase.cpp b/src/libsync/discoveryphase.cpp index 68e91bdd26f7..7ae202284180 100644 --- a/src/libsync/discoveryphase.cpp +++ b/src/libsync/discoveryphase.cpp @@ -378,7 +378,7 @@ DiscoverySingleDirectoryJob::DiscoverySingleDirectoryJob(const AccountPtr &accou void DiscoverySingleDirectoryJob::start() { // Start the actual HTTP job - auto *lsColJob = new LsColJob(_account, _subPath, this); + auto *lsColJob = new LsColJob(_account, _subPath); QList props; props << "resourcetype" diff --git a/src/libsync/encryptedfoldermetadatahandler.cpp b/src/libsync/encryptedfoldermetadatahandler.cpp index 63de59f900ea..6771b6170eb5 100644 --- a/src/libsync/encryptedfoldermetadatahandler.cpp +++ b/src/libsync/encryptedfoldermetadatahandler.cpp @@ -99,7 +99,7 @@ void EncryptedFolderMetadataHandler::startFetchMetadata() void EncryptedFolderMetadataHandler::fetchFolderEncryptedId() { qCDebug(lcFetchAndUploadE2eeFolderMetadataJob) << "Folder is encrypted, let's get the Id from it."; - const auto job = new LsColJob(_account, _folderPath, this); + const auto job = new LsColJob(_account, _folderPath); job->setProperties({"resourcetype", "http://owncloud.org/ns:fileid"}); connect(job, &LsColJob::directoryListingSubfolders, this, &EncryptedFolderMetadataHandler::slotFolderEncryptedIdReceived); connect(job, &LsColJob::finishedWithError, this, &EncryptedFolderMetadataHandler::slotFolderEncryptedIdError); diff --git a/src/libsync/networkjobs.cpp b/src/libsync/networkjobs.cpp index 93e220c478b5..bfef32160b16 100644 --- a/src/libsync/networkjobs.cpp +++ b/src/libsync/networkjobs.cpp @@ -317,13 +317,13 @@ bool LsColXMLParser::parse(const QByteArray &xml, QHashrequest().url().path(); // something like "/owncloud/remote.php/dav/folder" if (!parser.parse(reply()->readAll(), &_folderInfos, expectedPath)) { // XML parse error @@ -414,6 +421,8 @@ bool LsColJob::finished() emit finishedWithError(reply()); } + this->deleteLater(); + return true; } diff --git a/src/libsync/networkjobs.h b/src/libsync/networkjobs.h index c1337f1cc400..f62334502123 100644 --- a/src/libsync/networkjobs.h +++ b/src/libsync/networkjobs.h @@ -140,8 +140,8 @@ class OWNCLOUDSYNC_EXPORT LsColJob : public AbstractNetworkJob { Q_OBJECT public: - explicit LsColJob(AccountPtr account, const QString &path, QObject *parent = nullptr); - explicit LsColJob(AccountPtr account, const QUrl &url, QObject *parent = nullptr); + explicit LsColJob(AccountPtr account, const QString &path); + explicit LsColJob(AccountPtr account, const QUrl &url); void start() override; QHash _folderInfos; diff --git a/src/libsync/propagateuploadng.cpp b/src/libsync/propagateuploadng.cpp index f751c58253fb..f778f79ef6c9 100644 --- a/src/libsync/propagateuploadng.cpp +++ b/src/libsync/propagateuploadng.cpp @@ -105,7 +105,7 @@ void PropagateUploadFileNG::doStartUpload() if (progressInfo._valid && progressInfo.isChunked() && progressInfo._modtime == _item->_modtime && progressInfo._size == _item->_size) { _transferId = progressInfo._transferid; - const auto job = new LsColJob(propagator()->account(), chunkUploadFolderUrl(), this); + const auto job = new LsColJob(propagator()->account(), chunkUploadFolderUrl()); _jobs.append(job); job->setProperties(QList() << "resourcetype" << "getcontentlength");