From 93c35e4c15f03212617200eddd25d8738b63dd42 Mon Sep 17 00:00:00 2001 From: Ivailo Monev Date: Sat, 21 Oct 2023 19:57:19 +0300 Subject: [PATCH] generic: remove build-time compat options Signed-off-by: Ivailo Monev --- kded/CMakeLists.txt | 9 -- kded/config-kded.h.cmake | 1 - kded/kbuildsycoca.cpp | 5 - plasma/CMakeLists.txt | 26 +----- plasma/applet.cpp | 92 +++++++------------ plasma/applet.h | 9 -- plasma/config-plasma.h.cmake | 4 - plasma/containment.cpp | 48 ++++------ plasma/package.cpp | 8 +- plasma/packagestructure.cpp | 16 +--- .../private/associatedapplicationmanager.cpp | 27 +----- plasma/private/packages_p.h | 3 - plasma/runnermanager.cpp | 9 +- plasma/wallpaper.cpp | 20 +--- 14 files changed, 69 insertions(+), 208 deletions(-) delete mode 100644 kded/config-kded.h.cmake delete mode 100644 plasma/config-plasma.h.cmake diff --git a/kded/CMakeLists.txt b/kded/CMakeLists.txt index 47785dd2..a1e3e08a 100644 --- a/kded/CMakeLists.txt +++ b/kded/CMakeLists.txt @@ -6,15 +6,6 @@ endif() include_directories(${KDE4_KIO_INCLUDES}) -if(KDE_PLATFORM_FEATURE_BINARY_COMPATIBLE_FEATURE_REDUCTION) - set(KBUILDSYCOCA_NO_KCRASH TRUE) -endif() - -configure_file( - ${CMAKE_CURRENT_SOURCE_DIR}/config-kded.h.cmake - ${CMAKE_CURRENT_BINARY_DIR}/config-kded.h -) - ########### next target ############### set(kded_SRCS diff --git a/kded/config-kded.h.cmake b/kded/config-kded.h.cmake deleted file mode 100644 index 688c327c..00000000 --- a/kded/config-kded.h.cmake +++ /dev/null @@ -1 +0,0 @@ -#cmakedefine KBUILDSYCOCA_NO_KCRASH diff --git a/kded/kbuildsycoca.cpp b/kded/kbuildsycoca.cpp index 707aca43..28bb4b0a 100644 --- a/kded/kbuildsycoca.cpp +++ b/kded/kbuildsycoca.cpp @@ -24,7 +24,6 @@ #include "vfolder_menu.h" #include -#include #include #include @@ -43,10 +42,8 @@ #include #include #include -#ifndef KBUILDSYCOCA_NO_KCRASH #include #include -#endif #include #include @@ -658,9 +655,7 @@ int main(int argc, char **argv) QCoreApplication k(argc, argv); KComponentData mainComponent(d); -#ifndef KBUILDSYCOCA_NO_KCRASH KCrash::setCrashHandler(crashHandler); -#endif // force generating of KLocale object. if not, the database will get // be translated diff --git a/plasma/CMakeLists.txt b/plasma/CMakeLists.txt index 90149d00..be3bbc93 100644 --- a/plasma/CMakeLists.txt +++ b/plasma/CMakeLists.txt @@ -1,35 +1,13 @@ -if(KDE_PLATFORM_FEATURE_BINARY_COMPATIBLE_FEATURE_REDUCTION) - set(PLASMA_NO_SOLID TRUE) - set(PLASMA_NO_KIO TRUE) - set(PLASMA_NO_KUTILS TRUE) - set(PLASMA_NO_GLOBAL_SHORTCUTS TRUE) -endif() - include_directories( ${CMAKE_CURRENT_SOURCE_DIR} ${KDE4_KDECORE_INCLUDES} ${KDE4_KDEUI_INCLUDES} + ${KDE4_KIO_INCLUDES} ${CMAKE_SOURCE_DIR}/plasma/extenders # for the export headers ${CMAKE_BINARY_DIR}/kutils ) -if(NOT PLASMA_NO_KIO) - include_directories(${KDE4_KIO_INCLUDES}) - set(PLASMA_EXTRA_LIBS ${PLASMA_EXTRA_LIBS} kio) -endif() - -if(NOT PLASMA_NO_SOLID) - include_directories(${CMAKE_BINARY_DIR}/solid/) - include_directories(${CMAKE_SOURCE_DIR}/solid/) - set(PLASMA_EXTRA_LIBS ${PLASMA_EXTRA_LIBS} solid) -endif() - -configure_file( - config-plasma.h.cmake - ${CMAKE_CURRENT_BINARY_DIR}/config-plasma.h -) - if(ENABLE_TESTING) add_subdirectory(tests) endif() @@ -143,9 +121,9 @@ add_library(plasma SHARED ${plasma_LIB_SRCS}) target_link_libraries(plasma PUBLIC ${QT_QTNETWORK_LIBRARY} ${QT_QTSVG_LIBRARY} - ${PLASMA_EXTRA_LIBS} kdecore kdeui + kio ) target_link_libraries(plasma PRIVATE ${X11_LIBRARIES}) diff --git a/plasma/applet.cpp b/plasma/applet.cpp index e395c058..2e68b67c 100644 --- a/plasma/applet.cpp +++ b/plasma/applet.cpp @@ -21,14 +21,40 @@ */ #include "applet.h" +#include "abstracttoolbox.h" +#include "containment.h" +#include "corona.h" +#include "dataenginemanager.h" +#include "dialog.h" +#include "extenders/extender.h" +#include "extenders/extenderitem.h" +#include "package.h" +#include "plasma.h" +#include "svg.h" +#include "framesvg.h" +#include "popupapplet.h" +#include "theme.h" +#include "view.h" +#include "widgets/iconwidget.h" +#include "widgets/label.h" +#include "widgets/pushbutton.h" +#include "widgets/busywidget.h" +#include "tooltipmanager.h" +#include "wallpaper.h" +#include "paintutils.h" +#include "pluginloader.h" +#include "animations/animation.h" #include "private/applet_p.h" - -#include "config-plasma.h" - -#include - -#include -#include +#include "private/applethandle_p.h" +#include "private/extenderitem_p.h" +#include "private/framesvg_p.h" +#include "private/associatedapplicationmanager_p.h" +#include "private/containment_p.h" +#include "private/extenderapplet_p.h" +#include "private/package_p.h" +#include "private/packages_p.h" +#include "private/popupapplet_p.h" +#include "private/service_p.h" #include #include @@ -65,44 +91,8 @@ #include #include -#ifndef PLASMA_NO_SOLID -#include -#endif - -#include "abstracttoolbox.h" -#include "containment.h" -#include "corona.h" -#include "dataenginemanager.h" -#include "dialog.h" -#include "extenders/extender.h" -#include "extenders/extenderitem.h" -#include "package.h" -#include "plasma.h" -#include "svg.h" -#include "framesvg.h" -#include "popupapplet.h" -#include "theme.h" -#include "view.h" -#include "widgets/iconwidget.h" -#include "widgets/label.h" -#include "widgets/pushbutton.h" -#include "widgets/busywidget.h" -#include "tooltipmanager.h" -#include "wallpaper.h" -#include "paintutils.h" -#include "pluginloader.h" - -#include "private/applethandle_p.h" -#include "private/extenderitem_p.h" -#include "private/framesvg_p.h" -#include "private/associatedapplicationmanager_p.h" -#include "private/containment_p.h" -#include "private/extenderapplet_p.h" -#include "private/package_p.h" -#include "private/packages_p.h" -#include "private/popupapplet_p.h" -#include "private/service_p.h" - +#include +#include namespace Plasma { @@ -766,16 +756,6 @@ QString Applet::pluginName() const return d->appletDescription.pluginName(); } -bool Applet::shouldConserveResources() const -{ -#warning TODO: remove this method, applets should use the solid method -#ifndef PLASMA_NO_SOLID - return Solid::PowerManagement::appShouldConserveResources(); -#else - return true; -#endif -} - QString Applet::category() const { if (!d->appletDescription.isValid()) { @@ -1836,7 +1816,6 @@ void AppletPrivate::addStandardConfigurationPages(KConfigDialog *dialog) void AppletPrivate::addGlobalShortcutsPage(KConfigDialog *dialog) { -#ifndef PLASMA_NO_GLOBAL_SHORTCUTS if (isContainment) { return; } @@ -1856,7 +1835,6 @@ void AppletPrivate::addGlobalShortcutsPage(KConfigDialog *dialog) QObject::connect(dialog, SIGNAL(applyClicked()), q, SLOT(configDialogFinished()), Qt::UniqueConnection); QObject::connect(dialog, SIGNAL(okClicked()), q, SLOT(configDialogFinished()), Qt::UniqueConnection); -#endif } void AppletPrivate::configDialogFinished() diff --git a/plasma/applet.h b/plasma/applet.h index 10aa7313..6743479f 100644 --- a/plasma/applet.h +++ b/plasma/applet.h @@ -79,7 +79,6 @@ class PLASMA_EXPORT Applet : public QGraphicsWidget Q_PROPERTY(bool busy READ isBusy WRITE setBusy) Q_PROPERTY(bool configurationRequired READ configurationRequired WRITE setConfigurationRequired) Q_PROPERTY(QRectF geometry READ geometry WRITE setGeometry) - Q_PROPERTY(bool shouldConserveResources READ shouldConserveResources) Q_PROPERTY(uint id READ id CONSTANT) Q_PROPERTY(bool userConfiguring READ isUserConfiguring) Q_PROPERTY(BackgroundHints backgroundHints READ backgroundHints WRITE setBackgroundHints) @@ -376,14 +375,6 @@ class PLASMA_EXPORT Applet : public QGraphicsWidget */ QString pluginName() const; - /** - * Whether the applet should conserve resources. If true, try to avoid doing stuff which - * is computationally heavy. Try to conserve power and resources. - * - * @return true if it should conserve resources, false if it does not. - */ - bool shouldConserveResources() const; - /** * Returns the icon related to this applet **/ diff --git a/plasma/config-plasma.h.cmake b/plasma/config-plasma.h.cmake deleted file mode 100644 index 74d39275..00000000 --- a/plasma/config-plasma.h.cmake +++ /dev/null @@ -1,4 +0,0 @@ -#cmakedefine PLASMA_NO_SOLID -#cmakedefine PLASMA_NO_KIO -#cmakedefine PLASMA_NO_GLOBAL_SHORTCUTS - diff --git a/plasma/containment.cpp b/plasma/containment.cpp index 3014e2c4..390fc1d5 100644 --- a/plasma/containment.cpp +++ b/plasma/containment.cpp @@ -21,8 +21,22 @@ #include "containment.h" #include "private/containment_p.h" - -#include "config-plasma.h" +#include "abstracttoolbox.h" +#include "animator.h" +#include "containmentactions.h" +#include "containmentactionspluginsconfig.h" +#include "corona.h" +#include "extender.h" +#include "extenderitem.h" +#include "svg.h" +#include "wallpaper.h" +#include "private/applet_p.h" +#include "private/containmentactionspluginsconfig_p.h" +#include "private/extenderitemmimedata_p.h" +#include "private/extenderapplet_p.h" +#include "private/wallpaper_p.h" +#include "plasma/plasma.h" +#include "animations/animation.h" #include #include @@ -45,31 +59,9 @@ #include #include #include - -#ifndef PLASMA_NO_KIO #include "kio/jobclasses.h" // for KIO::JobFlags #include "kio/job.h" #include "kio/scheduler.h" -#endif - -#include "abstracttoolbox.h" -#include "animator.h" -#include "containmentactions.h" -#include "containmentactionspluginsconfig.h" -#include "corona.h" -#include "extender.h" -#include "extenderitem.h" -#include "svg.h" -#include "wallpaper.h" - -#include "private/applet_p.h" -#include "private/containmentactionspluginsconfig_p.h" -#include "private/extenderitemmimedata_p.h" -#include "private/extenderapplet_p.h" -#include "private/wallpaper_p.h" - -#include "plasma/plasma.h" -#include "animations/animation.h" namespace Plasma { @@ -1253,7 +1245,6 @@ void ContainmentPrivate::dropData(QPointF scenePos, QPoint screenPos, QGraphicsS } } else if (KUrl::List::canDecode(mimeData)) { foreach (const KUrl &url, KUrl::List::fromMimeData(mimeData)) { -#ifndef PLASMA_NO_KIO KMimeType::Ptr mime = KMimeType::findByUrl(url); QString mimeName = mime->name(); QRectF geom(pos, QSize()); @@ -1282,7 +1273,6 @@ void ContainmentPrivate::dropData(QPointF scenePos, QPoint screenPos, QGraphicsS } dropMenus[job] = choices; -#endif } if (dropEvent) { @@ -1368,18 +1358,15 @@ void ContainmentPrivate::dropData(QPointF scenePos, QPoint screenPos, QGraphicsS void ContainmentPrivate::clearDataForMimeJob(KIO::Job *job) { -#ifndef PLASMA_NO_KIO QObject::disconnect(job, 0, q, 0); dropPoints.remove(job); KMenu *choices = dropMenus.take(job); delete choices; job->kill(); -#endif // PLASMA_NO_KIO } void ContainmentPrivate::dropJobResult(KJob *job) { -#ifndef PLASMA_NO_KIO KIO::TransferJob* tjob = qobject_cast(job); if (!tjob) { kDebug() << "job is not a KIO::TransferJob, won't handle the drop..."; @@ -1392,12 +1379,10 @@ void ContainmentPrivate::dropJobResult(KJob *job) // We call mimetypeRetrieved since there might be other mechanisms // for finding suitable applets. Cleanup happens there as well. mimeTypeRetrieved(qobject_cast(job), QString()); -#endif // PLASMA_NO_KIO } void ContainmentPrivate::mimeTypeRetrieved(KIO::Job *job, const QString &mimetype) { -#ifndef PLASMA_NO_KIO kDebug() << "Mimetype Job returns." << mimetype; KIO::TransferJob* tjob = qobject_cast(job); if (!tjob) { @@ -1518,7 +1503,6 @@ void ContainmentPrivate::mimeTypeRetrieved(KIO::Job *job, const QString &mimetyp } clearDataForMimeJob(job); -#endif // PLASMA_NO_KIO } diff --git a/plasma/package.cpp b/plasma/package.cpp index e62f3fa2..49a7bfcf 100644 --- a/plasma/package.cpp +++ b/plasma/package.cpp @@ -19,7 +19,9 @@ *******************************************************************************/ #include "package.h" -#include "config-plasma.h" +#include "packagemetadata.h" +#include "private/package_p.h" +#include "private/service_p.h" #include #include @@ -32,10 +34,6 @@ #include #include -#include "packagemetadata.h" -#include "private/package_p.h" -#include "private/service_p.h" - namespace Plasma { diff --git a/plasma/packagestructure.cpp b/plasma/packagestructure.cpp index 621419d6..01494c15 100644 --- a/plasma/packagestructure.cpp +++ b/plasma/packagestructure.cpp @@ -18,8 +18,9 @@ *******************************************************************************/ #include "packagestructure.h" - -#include "config-plasma.h" +#include "package.h" +#include "private/packages_p.h" +#include "theme.h" #include #include @@ -29,19 +30,13 @@ #include #include -#ifndef PLASMA_NO_KIO #include -#endif #include #include #include #include #include -#include "package.h" -#include "private/packages_p.h" -#include "theme.h" - namespace Plasma { @@ -157,9 +152,7 @@ PackageStructure::Ptr PackageStructure::load(const QString &packageFormat) if (url.isLocalFile()) { KConfig config(url.toLocalFile(), KConfig::SimpleConfig); structure->read(&config); - } -#ifndef PLASMA_NO_KIO - else { + } else { KTemporaryFile tmp; if (tmp.open()) { KIO::Job *job = KIO::file_copy(url, KUrl(tmp.fileName()), @@ -170,7 +163,6 @@ PackageStructure::Ptr PackageStructure::load(const QString &packageFormat) } } } -#endif return structure; } diff --git a/plasma/private/associatedapplicationmanager.cpp b/plasma/private/associatedapplicationmanager.cpp index 7dd32c03..e3a8a440 100644 --- a/plasma/private/associatedapplicationmanager.cpp +++ b/plasma/private/associatedapplicationmanager.cpp @@ -18,23 +18,14 @@ */ #include "associatedapplicationmanager_p.h" - -#include "config-plasma.h" +#include "plasma/applet.h" #include #include #include #include - -#ifndef PLASMA_NO_KIO #include -#else -#include -#include -#endif - -#include "plasma/applet.h" namespace Plasma { @@ -115,30 +106,14 @@ KUrl::List AssociatedApplicationManager::urls(const Plasma::Applet *applet) cons void AssociatedApplicationManager::run(Plasma::Applet *applet) { if (d->applicationNames.contains(applet)) { -#ifndef PLASMA_NO_KIO bool success = KRun::run(d->applicationNames.value(applet), d->urlLists.value(applet), 0); -#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(); - bool success = QProcess::startDetached(execCommand, parameters); -#endif - if (!success) { applet->showMessage(KIcon("application-exit"), i18n("There was an error attempting to exec the associated application with this widget."), ButtonOk); } } else if (d->urlLists.contains(applet) && !d->urlLists.value(applet).isEmpty()) { -#ifndef PLASMA_NO_KIO KRun *krun = new KRun(d->urlLists.value(applet).first(), 0); krun->setAutoDelete(true); -#else - QStandardPaths::openUrl(d->urlLists.value(applet).first()); -#endif } } diff --git a/plasma/private/packages_p.h b/plasma/private/packages_p.h index eff7138a..eca8a40d 100644 --- a/plasma/private/packages_p.h +++ b/plasma/private/packages_p.h @@ -24,9 +24,6 @@ #include "plasma/wallpaper.h" #include "plasma/plasma.h" -#include "config-plasma.h" - - namespace Plasma { diff --git a/plasma/runnermanager.cpp b/plasma/runnermanager.cpp index 6ee72e23..02d2781b 100644 --- a/plasma/runnermanager.cpp +++ b/plasma/runnermanager.cpp @@ -20,8 +20,9 @@ */ #include "runnermanager.h" - -#include "config-plasma.h" +#include "private/runnerjobs_p.h" +#include "pluginloader.h" +#include "querymatch.h" #include #include @@ -33,10 +34,6 @@ #include #include -#include "private/runnerjobs_p.h" -#include "pluginloader.h" -#include "querymatch.h" - //#define MEASURE_PREPTIME namespace Plasma diff --git a/plasma/wallpaper.cpp b/plasma/wallpaper.cpp index db49a62b..771320a7 100644 --- a/plasma/wallpaper.cpp +++ b/plasma/wallpaper.cpp @@ -19,8 +19,11 @@ */ #include "wallpaper.h" - -#include "config-plasma.h" +#include "plasma/plasma.h" +#include "plasma/package.h" +#include "plasma/private/dataengineconsumer_p.h" +#include "plasma/private/packages_p.h" +#include "plasma/private/wallpaper_p.h" #include #include @@ -37,16 +40,7 @@ #include #include #include - -#ifndef PLASMA_NO_KIO #include -#endif - -#include "plasma/plasma.h" -#include "plasma/package.h" -#include "plasma/private/dataengineconsumer_p.h" -#include "plasma/private/packages_p.h" -#include "plasma/private/wallpaper_p.h" static const QByteArray imageFormat = QImageWriter::defaultImageFormat(); @@ -598,11 +592,7 @@ void Wallpaper::insertIntoCache(const QString& key, const QImage &image) if (d->cacheRendering) { if (image.isNull()) { -#ifndef PLASMA_NO_KIO KIO::file_delete(d->cachePath(key)); -#else - QFile::remove(d->cachePath(key)); -#endif } else { image.save(d->cachePath(key), imageFormat, 100); }