From 5289e1e95a0ae120cb74e384de56cdc032542674 Mon Sep 17 00:00:00 2001 From: Ivailo Monev Date: Fri, 2 Jun 2023 23:39:43 +0300 Subject: [PATCH] plasma: remove unused private Plasma::DataEngineService and Plasma::GetSource classes Signed-off-by: Ivailo Monev --- plasma/CMakeLists.txt | 2 - plasma/dataengine.cpp | 1 - plasma/private/datacontainer_p.h | 3 -- plasma/private/dataengineservice.cpp | 66 -------------------------- plasma/private/dataengineservice_p.h | 60 ------------------------ plasma/private/getsource.cpp | 70 ---------------------------- plasma/private/getsource_p.h | 48 ------------------- plasma/service.h | 1 - plasma/tooltipcontent.cpp | 6 +-- plasma/wallpaper.cpp | 1 - 10 files changed, 3 insertions(+), 255 deletions(-) delete mode 100644 plasma/private/dataengineservice.cpp delete mode 100644 plasma/private/dataengineservice_p.h delete mode 100644 plasma/private/getsource.cpp delete mode 100644 plasma/private/getsource_p.h diff --git a/plasma/CMakeLists.txt b/plasma/CMakeLists.txt index 5fb3fa18..1fd12e37 100644 --- a/plasma/CMakeLists.txt +++ b/plasma/CMakeLists.txt @@ -86,11 +86,9 @@ set(plasma_LIB_SRCS private/datacontainer_p.cpp private/dataenginebindings.cpp private/dataengineconsumer.cpp - private/dataengineservice.cpp private/extenderapplet.cpp private/extenderitemmimedata.cpp private/focusindicator.cpp - private/getsource.cpp private/nativetabbar.cpp private/packages.cpp private/plasmoidservice.cpp diff --git a/plasma/dataengine.cpp b/plasma/dataengine.cpp index f7379cbe..a00325f6 100644 --- a/plasma/dataengine.cpp +++ b/plasma/dataengine.cpp @@ -34,7 +34,6 @@ #include "datacontainer.h" #include "service.h" -#include "private/dataengineservice_p.h" #include "private/service_p.h" namespace Plasma diff --git a/plasma/private/datacontainer_p.h b/plasma/private/datacontainer_p.h index a948aebf..71195c7c 100644 --- a/plasma/private/datacontainer_p.h +++ b/plasma/private/datacontainer_p.h @@ -20,8 +20,6 @@ #ifndef PLASMA_DATACONTAINER_P_H #define PLASMA_DATACONTAINER_P_H -#include "servicejob.h" - #include #include #include @@ -30,7 +28,6 @@ namespace Plasma { -class ServiceJob; class SignalRelay; class DataContainerPrivate diff --git a/plasma/private/dataengineservice.cpp b/plasma/private/dataengineservice.cpp deleted file mode 100644 index c23f947f..00000000 --- a/plasma/private/dataengineservice.cpp +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright © 2009 Rob Scheepmaker - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Library General Public License version 2 as - * published by the Free Software Foundation - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details - * - * You should have received a copy of the GNU Library General Public - * License along with this program; if not, write to the - * Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -#include "dataengineservice_p.h" - -#include "../dataengine.h" -#include "getsource_p.h" - -#include - -namespace Plasma -{ - -DataEngineService::DataEngineService(DataEngine *engine) - : Plasma::Service(engine), - m_engine(engine) -{ - setName("dataengineservice"); - setOperationNames( - QStringList() - << "GetSource" // SourceName, UUID - << "GetSourceNames" - << "ServiceForSource" // SourceName - ); - engine->connectAllSources(this, 1000); - connect(engine, SIGNAL(sourceAdded(QString)), this, SLOT(sourceAdded(QString))); -} - -Plasma::ServiceJob* DataEngineService::createJob(const QString& operation, - const QMap& parameters) -{ - return new GetSource(m_engine, operation, parameters, this); -} - -void DataEngineService::dataUpdated(QString source, Plasma::DataEngine::Data data) -{ - if (data != m_data[source]) { - m_data[source] = data; - m_peersAlreadyUpdated[source] = QStringList(); - } -} - -void DataEngineService::sourceAdded(QString source) -{ - m_engine->connectSource(source, this, 1000); -} - -} - -#include "moc_dataengineservice_p.cpp" - diff --git a/plasma/private/dataengineservice_p.h b/plasma/private/dataengineservice_p.h deleted file mode 100644 index b4ce4ea4..00000000 --- a/plasma/private/dataengineservice_p.h +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright © 2009 Rob Scheepmaker - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Library General Public License version 2 as - * published by the Free Software Foundation - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details - * - * You should have received a copy of the GNU Library General Public - * License along with this program; if not, write to the - * Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -#ifndef PLASMA_DATAENGINESERVICE_P_H -#define PLASMA_DATAENGINESERVICE_P_H - -#include - -#include "../dataengine.h" -#include "../service.h" - -namespace Plasma -{ - -class DataEngine; -class GetSource; - -class DataEngineService : public Plasma::Service -{ - Q_OBJECT - - public: - DataEngineService(DataEngine *engine); - - public Q_SLOTS: - void dataUpdated(QString source, Plasma::DataEngine::Data data); - - protected: - Plasma::ServiceJob* createJob(const QString& operation, - const QMap& parameters); - - private Q_SLOTS: - void sourceAdded(QString source); - - private: - DataEngine *m_engine; - QMap m_peersAlreadyUpdated; - QMap m_data; - - friend class GetSource; -}; - -} - -#endif // PLASMA_DATAENGINESERVICE_P_H diff --git a/plasma/private/getsource.cpp b/plasma/private/getsource.cpp deleted file mode 100644 index 56362a35..00000000 --- a/plasma/private/getsource.cpp +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright © 2008 Rob Scheepmaker - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Library General Public License version 2 as - * published by the Free Software Foundation - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details - * - * You should have received a copy of the GNU Library General Public - * License along with this program; if not, write to the - * Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -#include "getsource_p.h" - -#include "dataengineservice_p.h" -#include "service_p.h" - -#include "../dataengine.h" -#include "../service.h" - -#include - -namespace Plasma -{ - -GetSource::GetSource(DataEngine *engine, const QString& operation, - const QMap& parameters, - DataEngineService *service) - : ServiceJob(QString::fromLatin1("publickey"), operation, parameters, service), - m_engine(engine), - m_service(service) -{ -} - -void GetSource::start() -{ - kDebug() << "Trying to perform the action" << operationName(); - - //TODO: check with capabilities before performing actions. - if (operationName() == "GetSource") { - QString source = parameters().value("SourceName").toString(); - QString UUID = parameters().value("UUID").toString(); - if (!m_service->m_peersAlreadyUpdated[source].contains(UUID)) { - m_service->m_peersAlreadyUpdated[source].append(UUID); - setResult(m_service->m_data[source]); - } else { - setResult(false); //no update needed - } - } else if (operationName() == "GetSourceNames") { - setResult(m_engine->sources()); - } else if (operationName() == "ServiceForSource") { - QString source = parameters().value("SourceName").toString(); - Service *service = m_engine->serviceForSource(source); - QString serviceName = "plasma-service-" + service->name(); - - kDebug() << "serviceForSource: getting source " << serviceName; - setResult(serviceName); - } -} - -} - -#include "moc_getsource_p.cpp" - diff --git a/plasma/private/getsource_p.h b/plasma/private/getsource_p.h deleted file mode 100644 index fe41fbbc..00000000 --- a/plasma/private/getsource_p.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright © 2009 Rob Scheepmaker - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Library General Public License version 2 as - * published by the Free Software Foundation - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details - * - * You should have received a copy of the GNU Library General Public - * License along with this program; if not, write to the - * Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -#ifndef GETSOURCE_H -#define GETSOURCE_H - -#include "../servicejob.h" - -namespace Plasma -{ - -class DataEngine; -class DataEngineService; - -class GetSource : public Plasma::ServiceJob -{ - Q_OBJECT - - public: - GetSource(DataEngine *engine, const QString& operation, - const QMap& parameters, - DataEngineService *service = 0); - - void start(); - - private: - DataEngine *m_engine; - DataEngineService *m_service; -}; - -} - -#endif //JOBVIEW_H diff --git a/plasma/service.h b/plasma/service.h index 8cd09b64..c041accd 100644 --- a/plasma/service.h +++ b/plasma/service.h @@ -274,7 +274,6 @@ private: friend class Applet; friend class DataEnginePrivate; - friend class GetSource; friend class PackagePrivate; }; diff --git a/plasma/tooltipcontent.cpp b/plasma/tooltipcontent.cpp index cb29b62c..9a2014aa 100644 --- a/plasma/tooltipcontent.cpp +++ b/plasma/tooltipcontent.cpp @@ -70,7 +70,7 @@ public: }; ToolTipContent::ToolTipContent() - : d(new ToolTipContentPrivate) + : d(new ToolTipContentPrivate()) { } @@ -93,7 +93,7 @@ ToolTipContent &ToolTipContent::operator=(const ToolTipContent &other) ToolTipContent::ToolTipContent(const QString &mainText, const QString &subText, const QPixmap &image) - : d(new ToolTipContentPrivate) + : d(new ToolTipContentPrivate()) { setMainText(mainText); setSubText(subText); @@ -103,7 +103,7 @@ ToolTipContent::ToolTipContent(const QString &mainText, ToolTipContent::ToolTipContent(const QString &mainText, const QString &subText, const QIcon &icon) - : d(new ToolTipContentPrivate) + : d(new ToolTipContentPrivate()) { setMainText(mainText); setSubText(subText); diff --git a/plasma/wallpaper.cpp b/plasma/wallpaper.cpp index c5471497..db49a62b 100644 --- a/plasma/wallpaper.cpp +++ b/plasma/wallpaper.cpp @@ -448,7 +448,6 @@ void WallpaperPrivate::renderWallpaper(const QString &sourceImagePath, const QIm pos = QPoint((size.width() - scaledSize.width()) / 2, (size.height() - scaledSize.height()) / 2); } - break; } case Wallpaper::MaxpectResize: {