From 73d767817d2ec1ed498a0eabecc071d947b25a23 Mon Sep 17 00:00:00 2001 From: Ivailo Monev Date: Sat, 21 Oct 2023 19:28:06 +0300 Subject: [PATCH] plasma: remove scripting leftovers Signed-off-by: Ivailo Monev --- plasma/applet.h | 5 ----- plasma/containment.cpp | 5 +---- plasma/containment.h | 1 - plasma/containmentactions.cpp | 12 ------------ plasma/containmentactions.h | 7 ------- plasma/dataengine.h | 6 +----- plasma/pluginloader.cpp | 1 - plasma/popupapplet.cpp | 1 - plasma/private/applet_p.h | 2 +- plasma/private/containmentactions_p.h | 12 ++++-------- plasma/private/packages.cpp | 6 ------ plasma/private/packages_p.h | 8 -------- plasma/private/wallpaper_p.h | 10 +++++----- plasma/service.h | 2 -- plasma/svg.cpp | 1 - plasma/tests/runnercontexttest.h | 2 +- plasma/wallpaper.h | 2 -- 17 files changed, 13 insertions(+), 70 deletions(-) diff --git a/plasma/applet.h b/plasma/applet.h index 8d6a933c..10aa7313 100644 --- a/plasma/applet.h +++ b/plasma/applet.h @@ -713,11 +713,6 @@ class PLASMA_EXPORT Applet : public QGraphicsWidget */ void newStatus(Plasma::ItemStatus status); - /** - * Emitted when an ExtenderItem in a scripting applet needs to be initialized - */ - void extenderItemRestored(Plasma::ExtenderItem *item); - /** * Emitted when the immutability changes * @since 4.4 diff --git a/plasma/containment.cpp b/plasma/containment.cpp index 6a52ddc0..3014e2c4 100644 --- a/plasma/containment.cpp +++ b/plasma/containment.cpp @@ -1252,10 +1252,7 @@ void ContainmentPrivate::dropData(QPointF scenePos, QPoint screenPos, QGraphicsS item->setExtender(applet->extender()); } } else if (KUrl::List::canDecode(mimeData)) { - //TODO: collect the mimetypes of available script engines and offer - // to create widgets out of the matching URLs, if any - const KUrl::List urls = KUrl::List::fromMimeData(mimeData); - foreach (const KUrl &url, urls) { + foreach (const KUrl &url, KUrl::List::fromMimeData(mimeData)) { #ifndef PLASMA_NO_KIO KMimeType::Ptr mime = KMimeType::findByUrl(url); QString mimeName = mime->name(); diff --git a/plasma/containment.h b/plasma/containment.h index b1373ed4..f482d67d 100644 --- a/plasma/containment.h +++ b/plasma/containment.h @@ -507,7 +507,6 @@ Q_SIGNALS: void configChanged(); protected: - //FIXME plasma2: those should be public to allow scripted containments access them /** * Sets the type of this containment. */ diff --git a/plasma/containmentactions.cpp b/plasma/containmentactions.cpp index 32275736..0b3e7aa7 100644 --- a/plasma/containmentactions.cpp +++ b/plasma/containmentactions.cpp @@ -21,7 +21,6 @@ #include "containment.h" #include "private/dataengineconsumer_p.h" -#include "private/packages_p.h" #include "private/containmentactions_p.h" #include "private/containment_p.h" @@ -39,8 +38,6 @@ namespace Plasma { -PackageStructure::Ptr ContainmentActionsPrivate::s_packageStructure(0); - ContainmentActions::ContainmentActions(QObject * parentObject) : d(new ContainmentActionsPrivate(KService::serviceByStorageId(QString()), this)) { @@ -111,15 +108,6 @@ ContainmentActions *ContainmentActions::load(Containment *parent, const KPluginI return load(parent, info.pluginName(), args); } -PackageStructure::Ptr ContainmentActions::packageStructure() -{ - if (!ContainmentActionsPrivate::s_packageStructure) { - ContainmentActionsPrivate::s_packageStructure = new ContainmentActionsPackage(); - } - - return ContainmentActionsPrivate::s_packageStructure; -} - Containment *ContainmentActions::containment() { if (d->containment) { diff --git a/plasma/containmentactions.h b/plasma/containmentactions.h index 97de6b92..eb7f151a 100644 --- a/plasma/containmentactions.h +++ b/plasma/containmentactions.h @@ -27,7 +27,6 @@ #include #include -#include namespace Plasma { @@ -101,11 +100,6 @@ class PLASMA_EXPORT ContainmentActions : public QObject **/ static ContainmentActions *load(Containment *parent, const KPluginInfo &info, const QVariantList &args = QVariantList()); - /** - * Returns the Package specialization for containmentactions. - */ - static PackageStructure::Ptr packageStructure(); - /** * Returns the user-visible name for the containmentactions, as specified in the * .desktop file. @@ -254,7 +248,6 @@ class PLASMA_EXPORT ContainmentActions : public QObject void paste(QPointF scenePos, QPoint screenPos); private: - friend class ContainmentActionsPackage; friend class ContainmentActionsPrivate; ContainmentActionsPrivate *const d; }; diff --git a/plasma/dataengine.h b/plasma/dataengine.h index 4319ac2d..2635352c 100644 --- a/plasma/dataengine.h +++ b/plasma/dataengine.h @@ -34,7 +34,6 @@ namespace Plasma { class DataContainer; -class Package; class Service; class DataEnginePrivate; @@ -176,10 +175,7 @@ NoAlignment) const; /** * Retrieves a pointer to the DataContainer for a given source. This method - * should not be used if possible. An exception is for script engines that - * can not provide a QMetaObject as required by connectSource for the initial - * call to dataUpdated. Using this method, such engines can provide their own - * connectSource API. + * should not be used if possible. * * @param source the name of the source. * @return pointer to a DataContainer, or zero on failure diff --git a/plasma/pluginloader.cpp b/plasma/pluginloader.cpp index 0d44e1f3..6b0e1f67 100644 --- a/plasma/pluginloader.cpp +++ b/plasma/pluginloader.cpp @@ -29,7 +29,6 @@ #include "applet.h" #include "abstractrunner.h" #include "containment.h" -#include "packagestructure.h" #include "popupapplet.h" #include "private/applet_p.h" #include "private/extenderapplet_p.h" diff --git a/plasma/popupapplet.cpp b/plasma/popupapplet.cpp index 7ee10c61..f85f795b 100644 --- a/plasma/popupapplet.cpp +++ b/plasma/popupapplet.cpp @@ -42,7 +42,6 @@ #include "plasma/dialog.h" #include "plasma/extenders/extender.h" #include "plasma/extenders/extenderitem.h" -#include "plasma/package.h" #include "plasma/theme.h" #include "plasma/tooltipmanager.h" #include "plasma/widgets/iconwidget.h" diff --git a/plasma/private/applet_p.h b/plasma/private/applet_p.h index 722caf95..a407d953 100644 --- a/plasma/private/applet_p.h +++ b/plasma/private/applet_p.h @@ -197,7 +197,7 @@ public: bool hasConfigurationInterface; bool failed; bool isContainment; - bool transient ; + bool transient; bool needsConfig; bool started; }; diff --git a/plasma/private/containmentactions_p.h b/plasma/private/containmentactions_p.h index 5afef7ee..c6fb73a5 100644 --- a/plasma/private/containmentactions_p.h +++ b/plasma/private/containmentactions_p.h @@ -31,24 +31,20 @@ public: ContainmentActionsPrivate(KService::Ptr service, ContainmentActions *containmentActions) : q(containmentActions), containmentActionsDescription(service), - package(0), initialized(false), needsConfig(false), - containment(0) + containment(nullptr) { }; - static PackageStructure::Ptr s_packageStructure; - ContainmentActions *q; KPluginInfo containmentActionsDescription; - Package *package; KServiceAction mode; - bool initialized : 1; - bool needsConfig : 1; + bool initialized; + bool needsConfig; Containment *containment; }; } // namespace Plasma -#endif //PLASMA_CONTAINMENTACTIONSPRIVATE_H +#endif //PLASMA_CONTAINMENTACTIONSPRIVATE_H diff --git a/plasma/private/packages.cpp b/plasma/private/packages.cpp index afccafd9..baa4bcf4 100644 --- a/plasma/private/packages.cpp +++ b/plasma/private/packages.cpp @@ -257,12 +257,6 @@ void WallpaperPackage::paperDestroyed() m_paper = 0; } -ContainmentActionsPackage::ContainmentActionsPackage(QObject *parent) - : Plasma::PackageStructure(parent, QString("ContainmentActions")) -{ - //FIXME how do I do the mimetypes stuff? -} - } // namespace Plasma #include "moc_packages_p.cpp" diff --git a/plasma/private/packages_p.h b/plasma/private/packages_p.h index ffa960df..eff7138a 100644 --- a/plasma/private/packages_p.h +++ b/plasma/private/packages_p.h @@ -64,14 +64,6 @@ private: Wallpaper::ResizeMethod m_resizeMethod; }; -class ContainmentActionsPackage : public PackageStructure -{ - Q_OBJECT - -public: - explicit ContainmentActionsPackage(QObject *parent = 0); -}; - } // namespace Plasma #endif // LIBS_PLASMA_PACKAGES_P_H diff --git a/plasma/private/wallpaper_p.h b/plasma/private/wallpaper_p.h index 2b582750..b1a1488b 100644 --- a/plasma/private/wallpaper_p.h +++ b/plasma/private/wallpaper_p.h @@ -53,11 +53,11 @@ public: QSizeF targetSize; QList pendingUrls; QList contextActions; - bool cacheRendering : 1; - bool initialized : 1; - bool needsConfig : 1; - bool previewing : 1; - bool needsPreviewDuringConfiguration : 1; + bool cacheRendering; + bool initialized; + bool needsConfig; + bool previewing; + bool needsPreviewDuringConfiguration; }; } // namespace Plasma diff --git a/plasma/service.h b/plasma/service.h index c041accd..cfd0175b 100644 --- a/plasma/service.h +++ b/plasma/service.h @@ -28,7 +28,6 @@ #include #include -#include "packagemetadata.h" #include #include @@ -274,7 +273,6 @@ private: friend class Applet; friend class DataEnginePrivate; - friend class PackagePrivate; }; } // namespace Plasma diff --git a/plasma/svg.cpp b/plasma/svg.cpp index ea4b4487..358e08e9 100644 --- a/plasma/svg.cpp +++ b/plasma/svg.cpp @@ -35,7 +35,6 @@ #include #include "applet.h" -#include "package.h" #include "theme.h" namespace Plasma diff --git a/plasma/tests/runnercontexttest.h b/plasma/tests/runnercontexttest.h index 2371eb7f..feabbbbb 100644 --- a/plasma/tests/runnercontexttest.h +++ b/plasma/tests/runnercontexttest.h @@ -17,7 +17,7 @@ * Boston, MA 02110-1301, USA. * *******************************************************************************/ -#ifndef PACKAGEMETADATATEST_H +#ifndef RUNNERCONTEXTTEST_H #include diff --git a/plasma/wallpaper.h b/plasma/wallpaper.h index 18fdf977..36b6cb67 100644 --- a/plasma/wallpaper.h +++ b/plasma/wallpaper.h @@ -556,8 +556,6 @@ class PLASMA_EXPORT Wallpaper : public QObject private: friend class WallpaperPackage; friend class WallpaperPrivate; - friend class WallpaperScript; - friend class WallpaperWithPaint; friend class ContainmentPrivate; WallpaperPrivate *const d; };