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
This commit is contained in:
Ivan Čukić 2014-10-17 09:15:06 +02:00
parent adf92d4573
commit e346b50cd8

View File

@ -420,14 +420,8 @@ void ContainmentInterface::clearDataForMimeJob(KIO::Job *job)
void ContainmentInterface::dropJobResult(KJob *job) void ContainmentInterface::dropJobResult(KJob *job)
{ {
#ifndef PLASMA_NO_KIO #ifndef PLASMA_NO_KIO
KIO::TransferJob *tjob = dynamic_cast<KIO::TransferJob *>(job);
if (!tjob) {
qDebug() << "job is not a KIO::TransferJob, won't handle the drop...";
clearDataForMimeJob(tjob);
return;
}
if (job->error()) { if (job->error()) {
qDebug() << "ERROR" << tjob->error() << ' ' << tjob->errorString(); qDebug() << "ERROR" << job->error() << ' ' << job->errorString();
} }
// We call mimetypeRetrieved since there might be other mechanisms // We call mimetypeRetrieved since there might be other mechanisms
// for finding suitable applets. Cleanup happens there as well. // for finding suitable applets. Cleanup happens there as well.
@ -656,7 +650,7 @@ QList<QObject *> ContainmentInterface::actions() const
} }
i = 0; 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()) { if (a->objectName() == QStringLiteral("lock widgets") || a->menu()) {
//It is up to the Containment to decide if the user is allowed or not //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 //to lock/unluck the widgets, so corona should not add one when there is none