From e346b50cd8df86b11c82fc88fe3b928b805c0ec3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ivan=20=C4=8Cuki=C4=87?= Date: Fri, 17 Oct 2014 09:15:06 +0200 Subject: [PATCH] Removed the call of clearDataForMimeJob on a null pointer tjob pointer is checked for being null (result of the dynamic_cast) and then passed to clearDataForMimeJob. The issue can be solved by replacing tjob with job in the problematic line, but since the mimeTypeRetrieved method called later already processes jobs that are not KIO::TransferJob, there is no purpose in doing it here as well. Change-Id: I863ac41ad66ac3cbceca82adeab85498315a5e42 --- .../qml/plasmoid/containmentinterface.cpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/scriptengines/qml/plasmoid/containmentinterface.cpp b/src/scriptengines/qml/plasmoid/containmentinterface.cpp index 4d30f7471..fae64c69a 100644 --- a/src/scriptengines/qml/plasmoid/containmentinterface.cpp +++ b/src/scriptengines/qml/plasmoid/containmentinterface.cpp @@ -420,14 +420,8 @@ void ContainmentInterface::clearDataForMimeJob(KIO::Job *job) void ContainmentInterface::dropJobResult(KJob *job) { #ifndef PLASMA_NO_KIO - KIO::TransferJob *tjob = dynamic_cast(job); - if (!tjob) { - qDebug() << "job is not a KIO::TransferJob, won't handle the drop..."; - clearDataForMimeJob(tjob); - return; - } if (job->error()) { - qDebug() << "ERROR" << tjob->error() << ' ' << tjob->errorString(); + qDebug() << "ERROR" << job->error() << ' ' << job->errorString(); } // We call mimetypeRetrieved since there might be other mechanisms // for finding suitable applets. Cleanup happens there as well. @@ -656,7 +650,7 @@ QList ContainmentInterface::actions() const } i = 0; - foreach (QAction *a, m_containment->corona()->actions()->actions()) { + foreach (QAction *a, m_containment->corona()->actions()->actions()) { if (a->objectName() == QStringLiteral("lock widgets") || a->menu()) { //It is up to the Containment to decide if the user is allowed or not //to lock/unluck the widgets, so corona should not add one when there is none