plasma: remove unused test engine and containment

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2023-07-07 19:18:38 +03:00
parent 0aea7c273e
commit 3e8f4e9424
14 changed files with 0 additions and 946 deletions

View file

@ -1,9 +1,5 @@
project(kdewidgets)
if(ENABLE_TESTING)
add_subdirectory(tests)
endif()
add_subdirectory(pics)
include_directories(

View file

@ -1,2 +0,0 @@
# TODO test programs

View file

@ -1,6 +0,0 @@
These are the tests for the current makekdewidgets.
Currently there are two modes generated, and the checksums checked.
These files are correct and build plugins that are functionally
just as TrollTech wants them for designer. If at any time the
code is changed then these md5 sums should be updated.

View file

@ -1,2 +0,0 @@
ff629a98965347ed3303a2c70f35af51 testwithpixmaps.cpp
f736575862f21dc175e1778bc159afbf testkde.cpp

View file

@ -1,251 +0,0 @@
[Global]
PluginName=KDEWidgets
Includes=kcomponentdata.h
Init=new KComponentData("kdewidgets");
[KActiveLabel]
ToolTip=Active Label (KDE)
WhatsThis=A label with support for selection and clickable links
Group=Display (KDE)
[KColorButton]
ToolTip=Color Chooser Button (KDE)
WhatsThis=A button that allows selecting a color
Group=Graphics (KDE)
[KColorCombo]
ToolTip=Color Combo Box (KDE)
Group=Graphics (KDE)
[KComboBox]
ToolTip=Combo Box (KDE)
Group=Input (KDE)
[KCModule]
ToolTip=KControl Center Module (KDE)
IsContainer=true
Group=Container (KDE)
[KDateWidget]
ToolTip=Date preview (KDE)
Group=Input (KDE)
[KDatePicker]
ToolTip=A date selection widget (KDE)
WhatsThis=Provides a widget for calendar date input
ConstructorArgs=(parent, QDate::currentDate(), name)
Group=Input (KDE)
[KDialog]
IncludeFile=kdialog.h
ToolTip=Class for simple Dialogs (KDE)
IsContainer=true
Group=Container (KDE)
[KDualColorButton]
ToolTip=A widget for selecting two related colors (KDE)
Group=Graphics (KDE)
[KEditListBox]
ToolTip=Fullfeatured edit box with buttons (KDE)
Group=Views (KDE)
[KFontCombo]
ToolTip=Font Combo Box (KDE)
WhatsThis=A QCombo Box showing the installed system fonts (with preview)
Group=Input (KDE)
[KFontChooser]
IncludeFile=kfontdialog.h
IconSet=kfontcombo.png
ToolTip=Font Chooser (KDE)
WhatsThis=A font type, size and style selection widget complete with preview
Group=Input (KDE)
[KFontRequester]
IncludeFile=kfontrequester.h
ToolTip=Font Requester (KDE)
WhatsThis=A compact font selection and preview widget
Group=Input (KDE)
[KGradientSelector]
IncludeFile=kselect.h
WhatsThis=A widget that allows the user to select two colors to form a gradient
Group=Graphics (KDE)
[KHistoryCombo]
IncludeFile=kcombobox.h
ToolTip=A combobox for offering a history and completion (KDE)
WhatsThis=A combobox which implements a history like a unix shell
Group=Input (KDE)
[KHSSelector]
IncludeFile=kcolordialog.h
ToolTip=Widget for Hue/Saturation selection (KDE)
Group=Graphics (KDE)
[KLed]
ToolTip=LED Widget (KDE)
WhatsThis=A widget showing a light emitter diode
Group=Display (KDE)
[KListBox]
ToolTip=Extended List Box (KDE)
WhatsThis=An improved version of the QListBox that follows KDE settings
Group=Views (KDE)
[K3ListView]
ToolTip=Extended List View (KDE)
WhatsThis=An improved version of the QListView that allows certain KDE extensions
Group=Views (KDE)
[KLineEdit]
ToolTip=Line Edit (KDE)
Group=Input (KDE)
[KPasswordEdit]
IncludeFile=kpassworddialog.h
ToolTip=Safe Password LineEdit (KDE)
WhatsThis=A KLineEdit that is safe for prompting the user for passwords
Group=Input (KDE)
[KProgress]
ToolTip=Progress Bar (KDE)
WhatsThis=An improved progress bar for KDE that uses QFrame and QRangeControl
Group=Display (KDE)
[KPushButton]
ToolTip=Improved QPushButton (KDE)
WhatsThis=An improved QPushButton to follow KDE settings
Group=Buttons (KDE)
[KKeyButton]
ToolTip=Keyboard Key Button. (KDE)
WhatsThis=A push button that looks like a keyboard key.
IncludeFile=kkeybutton.h
Group=Buttons (KDE)
[KRestrictedLine]
ToolTip=Line Edit for restricted input (KDE)
Group=Input (KDE)
[KIconButton]
IncludeFile=kicondialog.h
ToolTip=Button for selecting an icon (KDE)
Group=Buttons (KDE)
[K3IconView]
IncludeFile=k3iconview.h
ToolTip=Extended Icon View (KDE)
WhatsThis=An improved version of the QIconView that allows certain KDE extensions
Group=Views (KDE)
[KIntSpinBox]
IncludeFile=knuminput.h
ToolTip=Enhanced Spinbox for Integer Values (KDE)
Group=Input (KDE)
[KRuler]
ToolTip=Measuring Ruler Widget (KDE)
WhatsThis=A measuring ruler widget as seen in KWord for page widths and heights
Group=Display (KDE)
[KSqueezedTextLabel]
ToolTip=A QLabel that squeezes its text (KDE)
WhatsThis=If the text is too long to fit into the label it is divided into remaining left and right parts which are separated by three dots
ConstructorArgs=("KSqueezedTextLabel", parent, name)
Group=Display (KDE)
[KTextEdit]
ToolTip=Improved QTextEdit (KDE)
WhatsThis=An improved version of the QTextEdit with mail or system browser invocation support
Group=Input (KDE)
[KUrlLabel]
ToolTip=URL Label (KDE)
ConstructorArgs=("KUrlLabel", QString(), parent, name)
Group=Display (KDE)
[KUrlComboRequester]
ToolTip=URL Requester (KDE)
WhatsThis=A widget holding a combobox and a pushbutton. A "file open" dialog opened when clicking on the pushbutton
IncludeFile=kurlrequester.h
Group=Input (KDE)
[KUrlRequester]
ToolTip=URL Requester (KDE)
WhatsThis=A widget holding a lineedit and a pushbutton. A "file open" dialog opened when clicking on the pushbutton
Group=Input (KDE)
[KIntNumInput]
ToolTip=Integer Input Widget (KDE)
WhatsThis=An input widget for integer numbers, consisting of a spinbox and a slider.
IncludeFile=knuminput.h
Group=Input (KDE)
[KDoubleNumInput]
ToolTip=Floating Point Number Input Widget (KDE)
WhatsThis=An input widget for floating point numbers, consisting of a spinbox and a slider.
IncludeFile=knuminput.h
Group=Input (KDE)
[KTimeWidget]
ToolTip=This widget can be used to display or allow user selection of time. (KDE)
IncludeFile=ktimewidget.h
Group=Input (KDE)
[KDateTimeWidget]
ToolTip=This widget can be used to display or allow user selection of date and time. (KDE)
IncludeFile=kdatetimewidget.h
Group=Input (KDE)
[KDateTable]
IncludeFile=kdatetbl.h
Group=Input (KDE)
ConstructorArgs=(parent, QDate::currentDate(), name)
[KLanguageButton]
IncludeFile=klanguagebutton.h
ToolTip=A widget for selecting a language
WhatsThis=A combobox suitable for selecting a language
Group=Input (KDE)
[KImageFilePreview]
IncludeFile=kimagefilepreview.h
ToolTip=A widget that provides a image preview of a URL
Group=Display (KDE)
ConstructorArgs=(parent)
[KActionSelector]
IncludeFile=kactionselector.h
ToolTip=A widget for selecting and arranging actions/objects
Group=Views (KDE)
[KWritePermsIcon]
IncludeFile=kauthicon.h
ToolTip=Auth icon for write permission display.
ConstructorArgs=("", parent, name)
Group=Display (KDE)
[KRootPermsIcon]
IncludeFile=kauthicon.h
ToolTip=Icon to show whether or not a user has root permissions.
Group=Display (KDE)
[KColorPatch]
IncludeFile=kcolordialog.h
ToolTip=The KColorPatch widget is a (usually small) widget showing a selected color.
Group=Display (KDE)
ConstructorArgs=(parent)
[KPaletteTable]
IncludeFile=kcolordialog.h
ToolTip=A color palette in table form.
Group=Display (KDE)
ConstructorArgs=(parent, 210, 16)
#[KABC::AddressLineEdit]
#IncludeFile=kabc/addresslineedit.h
#ToolTip=A lineedit with LDAP and kabc completion.
#Group=Input (KDE)
#ConstructorArgs=(parent, true, name)

View file

@ -1,15 +0,0 @@
project(plasma-containmentactions-test)
find_package(KDELibs4 REQUIRED)
include_directories(
${CMAKE_SOURCE_DIR}
${CMAKE_BINARY_DIR}
${KDE4_INCLUDES}
)
kde4_add_plugin(plasma_containmentactions_test test.cpp)
target_link_libraries(plasma_containmentactions_test KDE4::plasma KDE4::kio)
install(TARGETS plasma_containmentactions_test DESTINATION ${KDE4_PLUGIN_INSTALL_DIR})
install(FILES plasma-containmentactions-test.desktop DESTINATION ${KDE4_SERVICES_INSTALL_DIR})

View file

@ -1,26 +0,0 @@
<ui version="4.0" >
<class>Config</class>
<widget class="QWidget" name="Config" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>355</width>
<height>102</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout" >
<item>
<widget class="QLabel" name="label" >
<property name="text" >
<string>text:</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="text" />
</item>
</layout>
</widget>
<connections/>
</ui>

View file

@ -1,146 +0,0 @@
[Desktop Entry]
Name=Test
Name[ar]=اختبار
Name[bg]=Проба
Name[bs]=Test
Name[ca]=Prova
Name[ca@valencia]=Prova
Name[cs]=Test
Name[da]=Test
Name[de]=Test
Name[el]=Δοκιμή
Name[en_GB]=Test
Name[es]=Prueba
Name[et]=Test
Name[eu]=Proba
Name[fa]=آزمون
Name[fi]=Testi
Name[fr]=Test
Name[ga]=Tástáil
Name[gl]=Proba
Name[gu]=
Name[he]=בדיקה
Name[hi]=
Name[hr]=Test
Name[hu]=Teszt
Name[hy]=փորձարկում
Name[ia]=Essayo
Name[id]=Tes
Name[is]=Prófun
Name[it]=Prova
Name[ja]=
Name[kk]=Сынақ
Name[km]=
Name[ko]=
Name[ku]=Bicaribîne
Name[lt]=Testas
Name[lv]=Tests
Name[mr]=
Name[nb]=Test
Name[nds]=Utproberen
Name[nl]=Test
Name[pa]=
Name[pl]=Test
Name[pt]=Teste
Name[pt_BR]=Teste
Name[ro]=Test
Name[ru]=Проверка
Name[se]=Geahččaleapmi
Name[si]=
Name[sk]=Test
Name[sl]=Preizkus
Name[sq]=Test
Name[sr]=Проба
Name[sr@ijekavian]=Проба
Name[sr@ijekavianlatin]=Proba
Name[sr@latin]=Proba
Name[sv]=Test
Name[tg]=Санҷиш
Name[th]=
Name[tr]=Deneme
Name[tt]=Тикшерү
Name[ug]=سىنا
Name[uk]=Тест
Name[vi]=Kim tra
Name[wa]=Sayî
Name[x-test]=xxTestxx
Name[zh_CN]=
Name[zh_TW]=
Comment=A dummy plugin for testing
Comment[ar]=إضافة وهمية من أجل الاختبار
Comment[bg]=Празна приставка за изпробване
Comment[bs]=Lažni priključak za probe
Comment[ca]=Un connector fals per a provar
Comment[ca@valencia]=Un connector fals per a provar
Comment[cs]=Prázdný zásuvný modul pro testování
Comment[da]=Et attrap-plugin til testformål
Comment[de]=Ein Dummy-Modul zum Testen.
Comment[el]=Ένα "χαζό" πρόσθετο για δοκιμές
Comment[en_GB]=A dummy plugin for testing
Comment[es]=Un complemento de pruebas
Comment[et]=Libaplugin testimiseks
Comment[eu]=Probatarako gezurretazko plugin bat
Comment[fi]=Tyhjä testausliitännäinen
Comment[fr]=Un module factice pour tests
Comment[ga]=Bréagbhreiseán le haghaidh tástála
Comment[gl]=Un complemento para probas
Comment[gu]=
Comment[he]=תוסף דמה לבדיקה
Comment[hr]=Lažan priključak za testiranje
Comment[hu]=Üres bővítmény teszteléshez
Comment[hy]=Վարժական հարմարանք փորձարկման համար
Comment[ia]=Un plugin vacue pro essayar
Comment[id]=Plugin rekaan untuk pengujian
Comment[is]=Tilraunaíforrit fyrir prófanir
Comment[it]=Una estensione fittizia di prova
Comment[ja]=
Comment[kk]=Сынақ үшін бос плагині
Comment[km]=
Comment[ko]=
Comment[ku]=Pêvekekî hêsan ji bo ceribandinê
Comment[lt]=Netikras priedas testavimui
Comment[lv]=Testēšanai paredzēts spraudnis
Comment[mr]=
Comment[nb]=Et attrapp-programtillegg for testing
Comment[nds]=En Platzholler-Moduul för't Utproberen
Comment[nl]=Een dummy plugin voor testen
Comment[pa]=
Comment[pl]=Prosta wtyczka testowa
Comment[pt]=Um 'plugin' de exemplo para testes
Comment[pt_BR]=Um plugin fictício para testes
Comment[ro]=Modul fictiv pentru testare
Comment[ru]=Расширение для тестирования
Comment[se]=Geahččalanlassemodula
Comment[sk]=Ukážkový modul pre testovanie
Comment[sl]=Preizkusni vstavek za preizkušanje
Comment[sr]=Лажни прикључак за пробе
Comment[sr@ijekavian]=Лажни прикључак за пробе
Comment[sr@ijekavianlatin]=Lažni priključak za probe
Comment[sr@latin]=Lažni priključak za probe
Comment[sv]=Ett exempelinsticksprogram för test
Comment[tg]=Воситаҳо барои санҷиш
Comment[th]=
Comment[tr]=Denemek için sahte bir eklenti
Comment[tt]=Тикшертү өчен ялган өстәмә
Comment[ug]=سىناشقا ئىشلىتىدىغان قىستۇرما
Comment[uk]=Додаток для тестування
Comment[vi]=Mt phn b sung gi đ kim th
Comment[wa]=On fås tchôke-divins po l' asprouvaedje
Comment[x-test]=xxA dummy plugin for testingxx
Comment[zh_CN]=
Comment[zh_TW]=
Type=Service
Icon=preferences-desktop-color
ServiceTypes=Plasma/ContainmentActions
X-KDE-Library=plasma_containmentactions_test
X-KDE-PluginInfo-Author=Chani
X-KDE-PluginInfo-Email=chani@kde.org
X-KDE-PluginInfo-Name=test
X-KDE-PluginInfo-Version=pre0.1
X-KDE-PluginInfo-Website=http://plasma.kde.org/
X-KDE-PluginInfo-Depends=
X-KDE-PluginInfo-License=GPL
X-KDE-PluginInfo-EnabledByDefault=true
X-Plasma-HasConfigurationInterface=true

View file

@ -1,110 +0,0 @@
/*
* Copyright 2009 by Chani Armitage <chani@kde.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Library General Public License as
* published by the Free Software Foundation; either version 2, or
* (at your option) any later version.
*
* 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 "test.h"
#include <QtGui/qgraphicssceneevent.h>
#include <QtGui/qgraphicssceneevent.h>
#include <KDebug>
#include <KMenu>
#include <Plasma/Containment>
ContextTest::ContextTest(QObject *parent, const QVariantList &args)
: Plasma::ContainmentActions(parent, args)
{
setConfigurationRequired(true);
}
void ContextTest::contextEvent(QEvent *event)
{
switch (event->type()) {
case QEvent::GraphicsSceneMousePress: {
contextEvent(static_cast<QGraphicsSceneMouseEvent*>(event));
break;
}
case QEvent::GraphicsSceneWheel: {
wheelEvent(static_cast<QGraphicsSceneWheelEvent*>(event));
break;
}
default: {
break;
}
}
}
void ContextTest::contextEvent(QGraphicsSceneMouseEvent *event)
{
kDebug() << "test!!!!!!!!!!!!!!!!!!!!!!!" << event->pos();
kDebug() << event->buttons() << event->modifiers();
Plasma::Containment *c = containment();
if (c) {
kDebug() << c->name();
} else {
kDebug() << "fail";
return;
}
KMenu desktopMenu;
desktopMenu.addTitle(m_text);
desktopMenu.addAction(c->action("configure"));
desktopMenu.exec(event->screenPos());
}
void ContextTest::wheelEvent(QGraphicsSceneWheelEvent *event)
{
kDebug() << "test!!!!!!!!!!!!!11111111!!";
kDebug() << event->orientation() << event->delta();
kDebug() << event->buttons() << event->modifiers();
}
void ContextTest::init(const KConfigGroup &config)
{
m_text = config.readEntry("test-text", QString());
setConfigurationRequired(m_text.isEmpty());
}
QWidget* ContextTest::createConfigurationInterface(QWidget* parent)
{
//m_currentText = m_text;
QWidget *widget = new QWidget(parent);
m_ui.setupUi(widget);
m_ui.text->setText(m_text);
//FIXME this way or just get it on close?
//connect(m_ui.text, SIGNAL(changed(QColor)), this, SLOT(setColor(QColor)));
//connect(this, SIGNAL(settingsChanged(bool)), parent, SLOT(settingsChanged(bool)));
return widget;
}
void ContextTest::configurationAccepted()
{
m_text = m_ui.text->text();
}
void ContextTest::save(KConfigGroup &config)
{
config.writeEntry("test-text", m_text);
}
#include "moc_test.cpp"

View file

@ -1,49 +0,0 @@
/*
* Copyright 2009 by Chani Armitage <chani@kde.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Library General Public License as
* published by the Free Software Foundation; either version 2, or
* (at your option) any later version.
*
* 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 CONTEXTTEST_HEADER
#define CONTEXTTEST_HEADER
#include "ui_config.h"
#include <plasma/containmentactions.h>
#include <QString>
class ContextTest : public Plasma::ContainmentActions
{
Q_OBJECT
public:
ContextTest(QObject* parent, const QVariantList& args);
void init(const KConfigGroup &config);
void contextEvent(QEvent *event);
void contextEvent(QGraphicsSceneMouseEvent *event);
void wheelEvent(QGraphicsSceneWheelEvent *event);
QWidget* createConfigurationInterface(QWidget* parent);
void configurationAccepted();
void save(KConfigGroup &config);
private:
Ui::Config m_ui;
QString m_text;
};
K_EXPORT_PLASMA_CONTAINMENTACTIONS(test, ContextTest)
#endif

View file

@ -1,19 +0,0 @@
project(plasma_testengine_dataengine)
find_package(KDELibs4 REQUIRED)
include_directories(
${CMAKE_SOURCE_DIR}
${CMAKE_BINARY_DIR}
${KDE4_INCLUDES}
)
kde4_add_plugin(plasma_engine_testengine testengine.cpp)
target_link_libraries(plasma_engine_testengine
KDE4::kio
KDE4::plasma
)
install(TARGETS plasma_engine_testengine DESTINATION ${KDE4_PLUGIN_INSTALL_DIR})
install(FILES plasma-dataengine-testengine.desktop DESTINATION ${KDE4_SERVICES_INSTALL_DIR})

View file

@ -1,85 +0,0 @@
[Desktop Entry]
Name=Test Data Engine
Name[ar]=محرك بيانات الاختبار
Name[as]=
Name[ast]=Motor de datos de prueba
Name[be@latin]=Systema spraŭdžvańnia dla źviestak
Name[bg]=Пробно ядро за данни
Name[bn]= ি
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-Datenmodul
Name[el]=Μηχανή δεδομένων ελέγχου
Name[en_GB]=Test Data Engine
Name[eo]=Testa Datuma motoro
Name[es]=Motor de datos de prueba
Name[et]=Testandmemootor
Name[eu]=Proba datuen motorra
Name[fi]=Testitietomoottori
Name[fr]=Moteur de données de tests
Name[fy]=Test gegevensmotor
Name[ga]=Inneall Sonraí Tástála
Name[gl]=Motor de datos de probas
Name[gu]= િ િ
Name[he]=בדיקה למנוע מידע
Name[hi]= ि
Name[hne]= ि
Name[hr]=Provjeri podatkovni mehanizam
Name[hsb]=Test Data Engine
Name[hu]=Az adatkezelő modul tesztje
Name[hy]=Փորձարկման տվյալների գործիք
Name[ia]=Motor del essayo de datos
Name[id]=Mesin Data Tes
Name[is]=Gagnaprófunarvél
Name[it]=Motore dati di prova
Name[ja]=
Name[kk]=Сынақ деректер тетігі
Name[km]=
Name[kn]=
Name[ko]=
Name[ku]=Motora Dane Ceribandinê
Name[lt]=Bandomasis duomenų variklis
Name[lv]=Testēšanas datu dzinējs
Name[mai]=ि
Name[ml]=ി ി
Name[mr]= ि
Name[nb]=Testdata-motor
Name[nds]=Test-Datenkarn
Name[nl]=Testgegevensengine
Name[nn]=Testdatamotor
Name[pa]=
Name[pl]=Silnik testów danych
Name[pt]=Motor de Dados de Teste
Name[pt_BR]=Mecanismo de dados de teste
Name[ro]=Motor de date pentru teste
Name[ru]=Тестовый источник данных
Name[se]=Geahččalandáhtamohtor
Name[si]=
Name[sk]=Testovací dátový nástroj
Name[sl]=Preizkusni podatkovni pogon
Name[sq]=Motor i Testimit të të Dhënave
Name[sr]=пробни датомотор података
Name[sr@ijekavian]=пробни датомотор података
Name[sr@ijekavianlatin]=probni datomotor podataka
Name[sr@latin]=probni datomotor podataka
Name[sv]=Testdatagränssnitt
Name[ta]= ி
Name[tg]=Системаи санҷиши маълумот
Name[th]=
Name[tr]=Test Veri Motoru
Name[tt]=Тикшертү өчен мәгълүмат чыганагы
Name[ug]=سىناققا ئىشلىتىدىغان ماتور
Name[uk]=Перевірка рушія даних
Name[vi]=Cơ chế kim tra d liu
Name[wa]=Moteur di dnêyes d' asprouvaedje
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

View file

@ -1,178 +0,0 @@
/*
* Copyright (C) 2008 Gilles CHAUVIN <gcnweb+kde@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License either version 2, or
* (at your option) any later version 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 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 "testengine.h"
#include <QtCore/QBitArray>
#include <QtCore/qdatetime.h>
#include <QtCore/QLocale>
#include <QtCore/QUrl>
#include <QtGui/QBitmap>
#include <QtGui/QBrush>
#include <QtGui/QCursor>
#include <QtGui/QFont>
#include <QtGui/QIcon>
#include <QtGui/QPalette>
#include <QtGui/QPen>
#include <QtGui/QSizePolicy>
#include <QtGui/QTextFormat>
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("TestEngine");
// QVariant::Invalid
// QVariant::BitArray
setData(dsn, "QBitArray", QVariant(QBitArray(97, false)));
// QVariant::Bitmap
setData(dsn, "QBitmap", QVariant(QBitmap(12, 57)));
// QVariant::Bool
setData(dsn, "bool", QVariant((bool)true));
// QVariant::Brush
setData(dsn, "QBrush", QVariant(QBrush(Qt::SolidPattern)));
// QVariant::ByteArray
QByteArray byteArray;
for (int i=0; i<256; ++i) {
byteArray.append(i);
}
setData(dsn, "QByteArray1", QVariant(byteArray));
setData(dsn, "QByteArray2", QVariant(QByteArray("KDE4")));
// QVariant::Char
setData(dsn, "QChar", QVariant(QChar(0x4B)));
// QVariant::Color
setData(dsn, "QColor", QVariant(QColor("#031337")));
// QVariant::Cursor
setData(dsn, "QCursor", QVariant(QCursor(Qt::ArrowCursor)));
// QVariant::Date
setData(dsn, "QDate", QVariant(QDate(2008, 1, 11)));
// QVariant::DateTime
setData(dsn, "QDateTime", QVariant(QDateTime(QDate(2008, 1, 11), QTime(12, 34, 56))));
// QVariant::Double
setData(dsn, "double", QVariant((double)12.34));
// QVariant::Font
setData(dsn, "QFont", QVariant(QFont()));
// QVariant::Icon
setData(dsn, "QIcon", QVariant(QIcon(QPixmap(12, 34))));
// QVariant::Image
setData(dsn, "QImage", QVariant(QImage(56, 78, QImage::Format_Mono)));
// QVariant::Int
setData(dsn, "int", QVariant((int)-4321));
// QVariant::KeySequence (???)
// QVariant::Line
setData(dsn, "QLine", QVariant(QLine(12, 34, 56, 78)));
// QVariant::LineF
setData(dsn, "QLineF", QVariant(QLineF(1.2, 3.4, 5.6, 7.8)));
// QVariant::List
QList<QVariant> list;
list << QString("KDE4") << QBrush() << QPen();
setData(dsn, "QList", QVariant(list));
// QVariant::Locale
setData(dsn, "QLocale", QVariant(QLocale("fr_FR")));
// QVariant::LongLong
setData(dsn, "qlonglong", QVariant((qlonglong)-4321));
// QVariant::Map
QMap<QString, QVariant> map;
for (int i=0; i<123; ++i) {
QString key = QString("key%1").arg(i);
QString val = QString("value%1").arg(i);
map[key] = val;
}
setData(dsn, "QMap", QVariant(map));
// QVariant::Matrix
setData(dsn, "QMatrix", QVariant(QMatrix()));
// QVariant::Transform
setData(dsn, "QTransform", QVariant(QTransform()));
// QVariant::Palette
setData(dsn, "QPalette", QVariant(QPalette()));
// QVariant::Pen
setData(dsn, "QPen", QVariant(QPen(Qt::SolidLine)));
// QVariant::Pixmap
setData(dsn, "QPixmap", QVariant(QPixmap(12, 34)));
// QVariant::Point
setData(dsn, "QPoint", QVariant(QPoint(12, 34)));
// QVariant::PointArray (obsoloted in Qt4, see QPolygon)
// QVariant::PointF
setData(dsn, "QPointF", QVariant(QPointF(12.34, 56.78)));
// QVariant::Polygon
setData(dsn, "QPolygon", QVariant(QPolygon(42)));
// QVariant::Rect
setData(dsn, "QRect", QVariant(QRect(12, 34, 56, 78)));
// QVariant::RectF
setData(dsn, "QRectF", QVariant(QRectF(1.2, 3.4, 5.6, 7.8)));
// QVariant::RegExp
setData(dsn, "QRegExp", QVariant(QRegExp("^KDE4$")));
// QVariant::Region
setData(dsn, "QRegion", QVariant(QRegion(10, 20, 30, 40)));
// QVariant::Size
setData(dsn, "QSize", QVariant(QSize(12, 34)));
// QVariant::SizeF
setData(dsn, "QSizeF", QVariant(QSizeF(12.34, 56.78)));
// QVariant::SizePolicy
setData(dsn, "QSizePolicy", QVariant(QSizePolicy()));
// QVariant::String
setData(dsn, "QString", QVariant(QString("KDE4 ROCKS!")));
// QVariant::StringList
QStringList stringList;
stringList << "K" << "D" << "E" << "4";
setData(dsn, "QStringList", QVariant(stringList));
// QVariant::TextFormat
setData(dsn, "QTextFormat", QVariant(QTextFormat()));
// QVariant::TextLength
setData(dsn, "QTextLength", QVariant(QTextLength()));
// QVariant::Time
setData(dsn, "QTime", QVariant(QTime(12, 34, 56)));
// QVariant::UInt
setData(dsn, "uint", QVariant((uint)4321));
// QVariant::ULongLong
setData(dsn, "qulonglong", QVariant((qulonglong)4321));
// QVariant::Url
setData(dsn, "QUrl", QVariant(QUrl("http://user:password@example.com:80/test.php?param1=foo&param2=bar")));
// QVariant::UserType
MyUserType userType;
QVariant v;
v.setValue(userType);
setData(dsn, "UserType", v);
} // init()
bool TestEngine::sourceRequestEvent(const QString &source)
{
// Nothing to do...
Q_UNUSED(source)
return true;
} // sourceRequestEvent()
#include "moc_testengine.cpp"

View file

@ -1,53 +0,0 @@
/*
* Copyright (C) 2008 Gilles CHAUVIN <gcnweb+kde@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License either version 2, or
* (at your option) any later version 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 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.
*/
/*
* A data engine meant to test the Plasma data engine explorer.
*/
#ifndef __TESTDATAENGINE_H__
#define __TESTDATAENGINE_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);
};
K_EXPORT_PLASMA_DATAENGINE(testengine, TestEngine)
#endif // __TESTDATAENGINE_H__