Remove PLASMA_NO_KIO option

It is a remnant of the Plasma Active days and didn't even compile.
This patch only removes those ifdefs, it doesn't fix any issues I found during (e.g. double lookups or the fact
that KRun::autoDelete is the default now)

Differential Revision: https://phabricator.kde.org/D16295
This commit is contained in:
Kai Uwe Broulik 2018-10-18 16:43:43 +02:00
parent 21cd448c38
commit e92ed94d9d
8 changed files with 3 additions and 50 deletions

View File

@ -14,7 +14,6 @@ find_package(Qt5Widgets REQUIRED)
# add_definitions( -DKDESRCDIR=${CMAKE_CURRENT_SOURCE_DIR} )
if(KDE_PLATFORM_FEATURE_BINARY_COMPATIBLE_FEATURE_REDUCTION)
set(PLASMA_NO_KIO TRUE)
set(PLASMA_NO_PACKAGEKIT TRUE)
set(PLASMA_NO_PACKAGE_EXTRADATA TRUE)
endif()

View File

@ -8,7 +8,6 @@ add_subdirectory(packagestructure)
set(CMAKE_AUTOMOC_RELAXED_MODE ON)
if(KDE_PLATFORM_FEATURE_BINARY_COMPATIBLE_FEATURE_REDUCTION)
set(PLASMA_NO_KIO TRUE)
set(PLASMA_NO_PACKAGEKIT TRUE)
set(PLASMA_NO_PACKAGE_EXTRADATA TRUE)
endif()

View File

@ -1,5 +1,4 @@
#cmakedefine01 PLASMA_NO_KDEWEBKIT
#cmakedefine01 PLASMA_NO_KIO
#cmakedefine01 PLASMA_NO_KUTILS
#cmakedefine01 HAVE_X11
#cmakedefine01 HAVE_GLX

View File

@ -40,12 +40,6 @@
#include <KConfigSkeleton>
#include <KConfigLoader>
#if !PLASMA_NO_KIO
#include "kio/jobclasses.h" // for KIO::JobFlags
#include "kio/job.h"
#include "kio/scheduler.h"
#endif
#include "containmentactions.h"
#include "corona.h"
#include "pluginloader.h"

View File

@ -31,10 +31,6 @@
#include "config-plasma.h"
#if !PLASMA_NO_KIO
#include <kio/job.h>
#endif
#include "applet.h"
#include "containment.h"
#include "containmentactions.h"

View File

@ -34,12 +34,7 @@
#include <kactioncollection.h>
#include <KMimeTypeTrader>
#if !PLASMA_NO_KIO
#include <krun.h>
#else
#include <QProcess>
#include <QDesktopServices>
#endif
#include <KRun>
#include "plasma/applet.h"
@ -197,29 +192,13 @@ QList<QUrl> AssociatedApplicationManager::urls(const Plasma::Applet *applet) con
void AssociatedApplicationManager::run(Plasma::Applet *applet)
{
if (d->applicationNames.contains(applet)) {
#if !PLASMA_NO_KIO
bool success = KRun::run(d->applicationNames.value(applet), d->urlLists.value(applet), nullptr);
if (!success) {
qCWarning(LOG_PLASMA) << "couldn't run" << d->applicationNames.value(applet) << d->urlLists.value(applet);
}
#else
QString execCommand = d->applicationNames.value(applet);
// Clean-up the %u and friends from the exec command (KRun expect them, not QProcess)
execCommand = execCommand.replace(QRegExp("%[a-z]"), QString());
execCommand = execCommand.trimmed();
QStringList parameters = d->urlLists.value(applet).toStringList();
QProcess::startDetached(execCommand, parameters);
#endif
} else if (d->urlLists.contains(applet)) {
#if !PLASMA_NO_KIO
KRun *krun = new KRun(d->urlLists.value(applet).first(), nullptr);
krun->setAutoDelete(true);
#else
QDesktopServices::openUrl(d->urlLists.value(applet).first());
#endif
}
}

View File

@ -3,7 +3,6 @@
if(KDE_PLATFORM_FEATURE_BINARY_COMPATIBLE_FEATURE_REDUCTION)
set(PLASMA_NO_KDEWEBKIT TRUE)
set(PLASMA_NO_SOLID TRUE)
set(PLASMA_NO_KIO TRUE)
endif()
#DECLARATIVE APPLET

View File

@ -38,12 +38,9 @@
#include <QMimeDatabase>
#include <KNotification>
#ifndef PLASMA_NO_KIO
#include "kio/jobclasses.h" // for KIO::JobFlags
#include "kio/job.h"
#include "kio/scheduler.h"
#include <KIO/DropJob>
#endif
#include <KIO/MimetypeJob>
#include <KIO/TransferJob>
#include <plasma.h>
#include <Plasma/ContainmentActions>
@ -469,8 +466,6 @@ void ContainmentInterface::processMimeData(QMimeData *mimeData, int x, int y, KI
// to create widgets out of the matching URLs, if any
const QList<QUrl> urls = KUrlMimeData::urlsFromMimeData(mimeData);
foreach (const QUrl &url, urls) {
#ifndef PLASMA_NO_KIO
QMimeDatabase db;
const QMimeType &mime = db.mimeTypeForUrl(url);
QString mimeName = mime.name();
@ -499,7 +494,6 @@ void ContainmentInterface::processMimeData(QMimeData *mimeData, int x, int y, KI
m_dropMenus[job] = choices;
}
#endif
}
} else {
@ -576,27 +570,22 @@ void ContainmentInterface::processMimeData(QMimeData *mimeData, int x, int y, KI
void ContainmentInterface::clearDataForMimeJob(KIO::Job *job)
{
#ifndef PLASMA_NO_KIO
QObject::disconnect(job, nullptr, this, nullptr);
m_dropPoints.remove(job);
QMenu *choices = m_dropMenus.take(job);
m_dropJobs.remove(job);
job->kill();
#endif // PLASMA_NO_KIO
}
void ContainmentInterface::dropJobResult(KJob *job)
{
#ifndef PLASMA_NO_KIO
if (job->error()) {
qDebug() << "ERROR" << job->error() << ' ' << job->errorString();
}
#endif // PLASMA_NO_KIO
}
void ContainmentInterface::mimeTypeRetrieved(KIO::Job *job, const QString &mimetype)
{
#ifndef PLASMA_NO_KIO
qDebug() << "Mimetype Job returns." << mimetype;
KIO::TransferJob *tjob = dynamic_cast<KIO::TransferJob *>(job);
@ -818,7 +807,6 @@ void ContainmentInterface::mimeTypeRetrieved(KIO::Job *job, const QString &mimet
clearDataForMimeJob(tjob);
}
#endif // PLASMA_NO_KIO
}
void ContainmentInterface::appletAddedForward(Plasma::Applet *applet)