From e54f5b793efd7d87e7263f3aa1aa7eac61d1f75b Mon Sep 17 00:00:00 2001 From: Alexander Lohnau Date: Mon, 7 Jun 2021 21:10:52 +0200 Subject: [PATCH] Remove defunct test dataengine The K_EXPORT_PLASMA_DATAENGINE_WITH_JSON expects a JSON file. But considering that nobody complained about this and it has been broken for years we can get rid of it. --- tests/CMakeLists.txt | 1 - tests/testengine/CMakeLists.txt | 10 -- .../plasma-dataengine-testengine.desktop | 47 ----- tests/testengine/testengine.cpp | 160 ------------------ tests/testengine/testengine.h | 34 ---- 5 files changed, 252 deletions(-) delete mode 100644 tests/testengine/CMakeLists.txt delete mode 100644 tests/testengine/plasma-dataengine-testengine.desktop delete mode 100644 tests/testengine/testengine.cpp delete mode 100644 tests/testengine/testengine.h diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index d09baa162..df1dfb718 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -1,3 +1,2 @@ add_subdirectory(kplugins) add_subdirectory(dpi) -add_subdirectory(testengine) diff --git a/tests/testengine/CMakeLists.txt b/tests/testengine/CMakeLists.txt deleted file mode 100644 index 780a24cbf..000000000 --- a/tests/testengine/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -add_library(plasma_engine_testengine MODULE testengine.cpp) - -kcoreaddons_desktop_to_json( - plasma_engine_testengine plasma-dataengine-testengine.desktop - SERVICE_TYPES ${CMAKE_SOURCE_DIR}/src/plasma/data/servicetypes/plasma-dataengine.desktop -) - - -target_link_libraries(plasma_engine_testengine - Qt5::Widgets KF5::Plasma) diff --git a/tests/testengine/plasma-dataengine-testengine.desktop b/tests/testengine/plasma-dataengine-testengine.desktop deleted file mode 100644 index 850fd6b36..000000000 --- a/tests/testengine/plasma-dataengine-testengine.desktop +++ /dev/null @@ -1,47 +0,0 @@ -[Desktop Entry] -Name=Test Data Engine -Name[bs]=Probni pogon za podatke -Name[ca]=Motor de dades de prova -Name[ca@valencia]=Motor de dades de prova -Name[cs]=Testovací datový nástroj -Name[da]=Test datamotor -Name[de]=Test-Datentreiber -Name[en_GB]=Test Data Engine -Name[es]=Motor de datos de pruebas -Name[fi]=Testitietomoottori -Name[fr]=Moteur de données pour faire des tests -Name[gd]=Inneal-dàta a chum deuchainn -Name[gl]=Motor de datos de probas -Name[hu]=Teszt adatmotor -Name[ia]=Motor del essayo de datos -Name[it]=Motore di dati di prova -Name[ko]=테스트 데이터 엔진 -Name[lt]=Bandomasis duomenų variklis -Name[mr]=चाचणी डेटा इंजिन -Name[nb]=Testdata-motor -Name[nds]=Test-Datenkarn -Name[nl]=Testgegevensengine -Name[nn]=Testdatamotor -Name[pa]=ਟੈਸਟ ਡਾਟਾ ਇੰਜਣ -Name[pl]=Silnik danych próbnych -Name[pt]=Motor de Dados de Teste -Name[pt_BR]=Mecanismo de dados de teste -Name[ru]=Тестовый источник данных -Name[sk]=Testovací dátový nástroj -Name[sl]=Preizkusni podatkovni pogon -Name[sr]=пробни датомотор података -Name[sr@ijekavian]=пробни датомотор података -Name[sr@ijekavianlatin]=probni datomotor podataka -Name[sr@latin]=probni datomotor podataka -Name[sv]=Testdatagränssnitt -Name[tr]=Test Veri Motoru -Name[ug]=سىناققا ئىشلىتىدىغان ماتور -Name[uk]=Перевірка рушія даних -Name[x-test]=xxTest Data Enginexx -Name[zh_CN]=测试用数据引擎 -Name[zh_TW]=測試資料引擎 -X-KDE-ServiceTypes=Plasma/DataEngine -Type=Service -Icon=unknown -X-KDE-Library=plasma_engine_testengine -X-Plasma-EngineName=testengine diff --git a/tests/testengine/testengine.cpp b/tests/testengine/testengine.cpp deleted file mode 100644 index d3df26133..000000000 --- a/tests/testengine/testengine.cpp +++ /dev/null @@ -1,160 +0,0 @@ -/* - SPDX-FileCopyrightText: 2008 Gilles CHAUVIN - - SPDX-License-Identifier: GPL-2.0-or-later -*/ - -#include "testengine.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -Q_DECLARE_METATYPE(TestEngine::MyUserType) - -TestEngine::TestEngine(QObject *parent, const QVariantList &args) - : Plasma::DataEngine(parent, args) -{ -} // ctor() - -TestEngine::~TestEngine() -{ -} // dtor() - -void TestEngine::init() -{ - QString dsn(QStringLiteral("TestEngine")); - - // QVariant::Invalid - // QVariant::BitArray - setData(dsn, QStringLiteral("QBitArray"), QVariant(QBitArray(97, false))); - // QVariant::Bitmap - setData(dsn, QStringLiteral("QBitmap"), QVariant(QBitmap(12, 57))); - // QVariant::Bool - setData(dsn, QStringLiteral("bool"), QVariant((bool)true)); - // QVariant::Brush - setData(dsn, QStringLiteral("QBrush"), QVariant(QBrush(Qt::SolidPattern))); - // QVariant::ByteArray - QByteArray byteArray; - for (int i = 0; i < 256; ++i) { - byteArray.append(i); - } - setData(dsn, QStringLiteral("QByteArray1"), QVariant(byteArray)); - setData(dsn, QStringLiteral("QByteArray2"), QVariant(QByteArray("KDE4"))); - // QVariant::Char - setData(dsn, QStringLiteral("QChar"), QVariant(QChar(0x4B))); - // QVariant::Color - setData(dsn, QStringLiteral("QColor"), QVariant(QColor("#031337"))); - // QVariant::Cursor - setData(dsn, QStringLiteral("QCursor"), QVariant(QCursor(Qt::ArrowCursor))); - // QVariant::Date - setData(dsn, QStringLiteral("QDate"), QVariant(QDate(2008, 1, 11))); - // QVariant::DateTime - setData(dsn, QStringLiteral("QDateTime"), QVariant(QDateTime(QDate(2008, 1, 11), QTime(12, 34, 56)))); - // QVariant::Double - setData(dsn, QStringLiteral("double"), QVariant((double)12.34)); - // QVariant::Font - setData(dsn, QStringLiteral("QFont"), QVariant(QFont())); - // QVariant::Icon - setData(dsn, QStringLiteral("QIcon"), QVariant(QIcon(QPixmap(12, 34)))); - // QVariant::Image - setData(dsn, QStringLiteral("QImage"), QVariant(QImage(56, 78, QImage::Format_Mono))); - // QVariant::Int - setData(dsn, QStringLiteral("int"), QVariant((int)-4321)); - // QVariant::KeySequence (???) - // QVariant::Line - setData(dsn, QStringLiteral("QLine"), QVariant(QLine(12, 34, 56, 78))); - // QVariant::LineF - setData(dsn, QStringLiteral("QLineF"), QVariant(QLineF(1.2, 3.4, 5.6, 7.8))); - // QVariant::List - QList list; - list << QStringLiteral("KDE4") << QBrush() << QPen(); - setData(dsn, QStringLiteral("QList"), QVariant(list)); - // QVariant::Locale - setData(dsn, QStringLiteral("QLocale"), QVariant(QLocale(QStringLiteral("fr_FR")))); - // QVariant::LongLong - setData(dsn, QStringLiteral("qlonglong"), QVariant((qlonglong)-4321)); - // QVariant::Map - QMap map; - for (int i = 0; i < 123; ++i) { - QString key = QStringLiteral("key%1").arg(i); - QString val = QStringLiteral("value%1").arg(i); - map[key] = val; - } - setData(dsn, QStringLiteral("QMap"), QVariant(map)); - // QVariant::Matrix - setData(dsn, QStringLiteral("QMatrix"), QVariant(QMatrix())); - // QVariant::Transform - setData(dsn, QStringLiteral("QTransform"), QVariant(QTransform())); - // QVariant::Palette - setData(dsn, QStringLiteral("QPalette"), QVariant(QPalette())); - // QVariant::Pen - setData(dsn, QStringLiteral("QPen"), QVariant(QPen(Qt::SolidLine))); - // QVariant::Pixmap - setData(dsn, QStringLiteral("QPixmap"), QVariant(QPixmap(12, 34))); - // QVariant::Point - setData(dsn, QStringLiteral("QPoint"), QVariant(QPoint(12, 34))); - // QVariant::PointArray (obsoleted in Qt4, see QPolygon) - // QVariant::PointF - setData(dsn, QStringLiteral("QPointF"), QVariant(QPointF(12.34, 56.78))); - // QVariant::Polygon - setData(dsn, QStringLiteral("QPolygon"), QVariant(QPolygon(42))); - // QVariant::Rect - setData(dsn, QStringLiteral("QRect"), QVariant(QRect(12, 34, 56, 78))); - // QVariant::RectF - setData(dsn, QStringLiteral("QRectF"), QVariant(QRectF(1.2, 3.4, 5.6, 7.8))); - // QVariant::RegExp - setData(dsn, QStringLiteral("QRegExp"), QVariant(QRegExp(QStringLiteral("^KDE4$")))); - // QVariant::Region - setData(dsn, QStringLiteral("QRegion"), QVariant(QRegion(10, 20, 30, 40))); - // QVariant::Size - setData(dsn, QStringLiteral("QSize"), QVariant(QSize(12, 34))); - // QVariant::SizeF - setData(dsn, QStringLiteral("QSizeF"), QVariant(QSizeF(12.34, 56.78))); - // QVariant::SizePolicy - setData(dsn, QStringLiteral("QSizePolicy"), QVariant(QSizePolicy())); - // QVariant::String - setData(dsn, QStringLiteral("QString"), QVariant(QStringLiteral("KDE4 ROCKS!"))); - // QVariant::StringList - QStringList stringList; - stringList << QStringLiteral("K") << QStringLiteral("D") << QStringLiteral("E") << QStringLiteral("4"); - setData(dsn, QStringLiteral("QStringList"), QVariant(stringList)); - // QVariant::TextFormat - setData(dsn, QStringLiteral("QTextFormat"), QVariant(QTextFormat())); - // QVariant::TextLength - setData(dsn, QStringLiteral("QTextLength"), QVariant(QTextLength())); - // QVariant::Time - setData(dsn, QStringLiteral("QTime"), QVariant(QTime(12, 34, 56))); - // QVariant::UInt - setData(dsn, QStringLiteral("uint"), QVariant((uint)4321)); - // QVariant::ULongLong - setData(dsn, QStringLiteral("qulonglong"), QVariant((qulonglong)4321)); - // QVariant::Url - setData(dsn, QStringLiteral("QUrl"), QVariant(QUrl(QStringLiteral("http://user:password@example.com:80/test.php?param1=foo¶m2=bar")))); - // QVariant::UserType - MyUserType userType; - QVariant v; - v.setValue(userType); - setData(dsn, QStringLiteral("UserType"), v); -} // init() - -bool TestEngine::sourceRequestEvent(const QString &source) -{ - // Nothing to do... - Q_UNUSED(source) - return true; -} // sourceRequestEvent() - -K_EXPORT_PLASMA_DATAENGINE_WITH_JSON(org.kde.examples.plasma_engine_testengine, TestEngine, "plasma-dataengine-testengine.desktop") - -#include "testengine.moc" diff --git a/tests/testengine/testengine.h b/tests/testengine/testengine.h deleted file mode 100644 index 802a4f748..000000000 --- a/tests/testengine/testengine.h +++ /dev/null @@ -1,34 +0,0 @@ -/* - SPDX-FileCopyrightText: 2008 Gilles CHAUVIN - - SPDX-License-Identifier: GPL-2.0-or-later -*/ - -/* - * A data engine meant to test the Plasma data engine explorer. - */ - -#ifndef __TESTENGINE_H__ -#define __TESTENGINE_H__ - -#include "plasma/dataengine.h" - -class TestEngine : public Plasma::DataEngine -{ - Q_OBJECT - -public: - struct MyUserType { - int a; - QString b; - }; - - TestEngine(QObject *parent, const QVariantList &args); - ~TestEngine(); - -protected: - void init(); - bool sourceRequestEvent(const QString &source) override; -}; - -#endif // __TESTENGINE_H__