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:
parent
21cd448c38
commit
e92ed94d9d
@ -14,7 +14,6 @@ find_package(Qt5Widgets REQUIRED)
|
|||||||
# add_definitions( -DKDESRCDIR=${CMAKE_CURRENT_SOURCE_DIR} )
|
# add_definitions( -DKDESRCDIR=${CMAKE_CURRENT_SOURCE_DIR} )
|
||||||
|
|
||||||
if(KDE_PLATFORM_FEATURE_BINARY_COMPATIBLE_FEATURE_REDUCTION)
|
if(KDE_PLATFORM_FEATURE_BINARY_COMPATIBLE_FEATURE_REDUCTION)
|
||||||
set(PLASMA_NO_KIO TRUE)
|
|
||||||
set(PLASMA_NO_PACKAGEKIT TRUE)
|
set(PLASMA_NO_PACKAGEKIT TRUE)
|
||||||
set(PLASMA_NO_PACKAGE_EXTRADATA TRUE)
|
set(PLASMA_NO_PACKAGE_EXTRADATA TRUE)
|
||||||
endif()
|
endif()
|
||||||
|
@ -8,7 +8,6 @@ add_subdirectory(packagestructure)
|
|||||||
set(CMAKE_AUTOMOC_RELAXED_MODE ON)
|
set(CMAKE_AUTOMOC_RELAXED_MODE ON)
|
||||||
|
|
||||||
if(KDE_PLATFORM_FEATURE_BINARY_COMPATIBLE_FEATURE_REDUCTION)
|
if(KDE_PLATFORM_FEATURE_BINARY_COMPATIBLE_FEATURE_REDUCTION)
|
||||||
set(PLASMA_NO_KIO TRUE)
|
|
||||||
set(PLASMA_NO_PACKAGEKIT TRUE)
|
set(PLASMA_NO_PACKAGEKIT TRUE)
|
||||||
set(PLASMA_NO_PACKAGE_EXTRADATA TRUE)
|
set(PLASMA_NO_PACKAGE_EXTRADATA TRUE)
|
||||||
endif()
|
endif()
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
#cmakedefine01 PLASMA_NO_KDEWEBKIT
|
#cmakedefine01 PLASMA_NO_KDEWEBKIT
|
||||||
#cmakedefine01 PLASMA_NO_KIO
|
|
||||||
#cmakedefine01 PLASMA_NO_KUTILS
|
#cmakedefine01 PLASMA_NO_KUTILS
|
||||||
#cmakedefine01 HAVE_X11
|
#cmakedefine01 HAVE_X11
|
||||||
#cmakedefine01 HAVE_GLX
|
#cmakedefine01 HAVE_GLX
|
||||||
|
@ -40,12 +40,6 @@
|
|||||||
#include <KConfigSkeleton>
|
#include <KConfigSkeleton>
|
||||||
#include <KConfigLoader>
|
#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 "containmentactions.h"
|
||||||
#include "corona.h"
|
#include "corona.h"
|
||||||
#include "pluginloader.h"
|
#include "pluginloader.h"
|
||||||
|
@ -31,10 +31,6 @@
|
|||||||
|
|
||||||
#include "config-plasma.h"
|
#include "config-plasma.h"
|
||||||
|
|
||||||
#if !PLASMA_NO_KIO
|
|
||||||
#include <kio/job.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "applet.h"
|
#include "applet.h"
|
||||||
#include "containment.h"
|
#include "containment.h"
|
||||||
#include "containmentactions.h"
|
#include "containmentactions.h"
|
||||||
|
@ -34,12 +34,7 @@
|
|||||||
#include <kactioncollection.h>
|
#include <kactioncollection.h>
|
||||||
#include <KMimeTypeTrader>
|
#include <KMimeTypeTrader>
|
||||||
|
|
||||||
#if !PLASMA_NO_KIO
|
#include <KRun>
|
||||||
#include <krun.h>
|
|
||||||
#else
|
|
||||||
#include <QProcess>
|
|
||||||
#include <QDesktopServices>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "plasma/applet.h"
|
#include "plasma/applet.h"
|
||||||
|
|
||||||
@ -197,29 +192,13 @@ QList<QUrl> AssociatedApplicationManager::urls(const Plasma::Applet *applet) con
|
|||||||
void AssociatedApplicationManager::run(Plasma::Applet *applet)
|
void AssociatedApplicationManager::run(Plasma::Applet *applet)
|
||||||
{
|
{
|
||||||
if (d->applicationNames.contains(applet)) {
|
if (d->applicationNames.contains(applet)) {
|
||||||
#if !PLASMA_NO_KIO
|
|
||||||
bool success = KRun::run(d->applicationNames.value(applet), d->urlLists.value(applet), nullptr);
|
bool success = KRun::run(d->applicationNames.value(applet), d->urlLists.value(applet), nullptr);
|
||||||
if (!success) {
|
if (!success) {
|
||||||
qCWarning(LOG_PLASMA) << "couldn't run" << d->applicationNames.value(applet) << d->urlLists.value(applet);
|
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)) {
|
} else if (d->urlLists.contains(applet)) {
|
||||||
#if !PLASMA_NO_KIO
|
|
||||||
KRun *krun = new KRun(d->urlLists.value(applet).first(), nullptr);
|
KRun *krun = new KRun(d->urlLists.value(applet).first(), nullptr);
|
||||||
krun->setAutoDelete(true);
|
krun->setAutoDelete(true);
|
||||||
#else
|
|
||||||
QDesktopServices::openUrl(d->urlLists.value(applet).first());
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,7 +3,6 @@
|
|||||||
if(KDE_PLATFORM_FEATURE_BINARY_COMPATIBLE_FEATURE_REDUCTION)
|
if(KDE_PLATFORM_FEATURE_BINARY_COMPATIBLE_FEATURE_REDUCTION)
|
||||||
set(PLASMA_NO_KDEWEBKIT TRUE)
|
set(PLASMA_NO_KDEWEBKIT TRUE)
|
||||||
set(PLASMA_NO_SOLID TRUE)
|
set(PLASMA_NO_SOLID TRUE)
|
||||||
set(PLASMA_NO_KIO TRUE)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
#DECLARATIVE APPLET
|
#DECLARATIVE APPLET
|
||||||
|
@ -38,12 +38,9 @@
|
|||||||
#include <QMimeDatabase>
|
#include <QMimeDatabase>
|
||||||
#include <KNotification>
|
#include <KNotification>
|
||||||
|
|
||||||
#ifndef PLASMA_NO_KIO
|
|
||||||
#include "kio/jobclasses.h" // for KIO::JobFlags
|
|
||||||
#include "kio/job.h"
|
|
||||||
#include "kio/scheduler.h"
|
|
||||||
#include <KIO/DropJob>
|
#include <KIO/DropJob>
|
||||||
#endif
|
#include <KIO/MimetypeJob>
|
||||||
|
#include <KIO/TransferJob>
|
||||||
|
|
||||||
#include <plasma.h>
|
#include <plasma.h>
|
||||||
#include <Plasma/ContainmentActions>
|
#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
|
// to create widgets out of the matching URLs, if any
|
||||||
const QList<QUrl> urls = KUrlMimeData::urlsFromMimeData(mimeData);
|
const QList<QUrl> urls = KUrlMimeData::urlsFromMimeData(mimeData);
|
||||||
foreach (const QUrl &url, urls) {
|
foreach (const QUrl &url, urls) {
|
||||||
|
|
||||||
#ifndef PLASMA_NO_KIO
|
|
||||||
QMimeDatabase db;
|
QMimeDatabase db;
|
||||||
const QMimeType &mime = db.mimeTypeForUrl(url);
|
const QMimeType &mime = db.mimeTypeForUrl(url);
|
||||||
QString mimeName = mime.name();
|
QString mimeName = mime.name();
|
||||||
@ -499,7 +494,6 @@ void ContainmentInterface::processMimeData(QMimeData *mimeData, int x, int y, KI
|
|||||||
|
|
||||||
m_dropMenus[job] = choices;
|
m_dropMenus[job] = choices;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
@ -576,27 +570,22 @@ void ContainmentInterface::processMimeData(QMimeData *mimeData, int x, int y, KI
|
|||||||
|
|
||||||
void ContainmentInterface::clearDataForMimeJob(KIO::Job *job)
|
void ContainmentInterface::clearDataForMimeJob(KIO::Job *job)
|
||||||
{
|
{
|
||||||
#ifndef PLASMA_NO_KIO
|
|
||||||
QObject::disconnect(job, nullptr, this, nullptr);
|
QObject::disconnect(job, nullptr, this, nullptr);
|
||||||
m_dropPoints.remove(job);
|
m_dropPoints.remove(job);
|
||||||
QMenu *choices = m_dropMenus.take(job);
|
QMenu *choices = m_dropMenus.take(job);
|
||||||
m_dropJobs.remove(job);
|
m_dropJobs.remove(job);
|
||||||
job->kill();
|
job->kill();
|
||||||
#endif // PLASMA_NO_KIO
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ContainmentInterface::dropJobResult(KJob *job)
|
void ContainmentInterface::dropJobResult(KJob *job)
|
||||||
{
|
{
|
||||||
#ifndef PLASMA_NO_KIO
|
|
||||||
if (job->error()) {
|
if (job->error()) {
|
||||||
qDebug() << "ERROR" << job->error() << ' ' << job->errorString();
|
qDebug() << "ERROR" << job->error() << ' ' << job->errorString();
|
||||||
}
|
}
|
||||||
#endif // PLASMA_NO_KIO
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ContainmentInterface::mimeTypeRetrieved(KIO::Job *job, const QString &mimetype)
|
void ContainmentInterface::mimeTypeRetrieved(KIO::Job *job, const QString &mimetype)
|
||||||
{
|
{
|
||||||
#ifndef PLASMA_NO_KIO
|
|
||||||
qDebug() << "Mimetype Job returns." << mimetype;
|
qDebug() << "Mimetype Job returns." << mimetype;
|
||||||
|
|
||||||
KIO::TransferJob *tjob = dynamic_cast<KIO::TransferJob *>(job);
|
KIO::TransferJob *tjob = dynamic_cast<KIO::TransferJob *>(job);
|
||||||
@ -818,7 +807,6 @@ void ContainmentInterface::mimeTypeRetrieved(KIO::Job *job, const QString &mimet
|
|||||||
|
|
||||||
clearDataForMimeJob(tjob);
|
clearDataForMimeJob(tjob);
|
||||||
}
|
}
|
||||||
#endif // PLASMA_NO_KIO
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ContainmentInterface::appletAddedForward(Plasma::Applet *applet)
|
void ContainmentInterface::appletAddedForward(Plasma::Applet *applet)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user