From 4ce14a16548fa7a6435677851e4e3da83a7e8f3f Mon Sep 17 00:00:00 2001 From: David Edmundson Date: Sat, 26 Apr 2014 14:29:54 +0200 Subject: [PATCH] Remove duplicated ConfigLoader This moved to KConfigGui as KConfigLoader. Use of private KConfig API in Service had to be ported to use only public method. REVIEW: 117784 --- autotests/CMakeLists.txt | 1 - autotests/configloadertest.cpp | 210 -------- autotests/configloadertest.h | 67 --- autotests/configloadertest.xml | 71 --- src/plasma/CMakeLists.txt | 2 - src/plasma/applet.cpp | 8 +- src/plasma/applet.h | 4 +- src/plasma/configloader.cpp | 467 ------------------ src/plasma/configloader.h | 154 ------ src/plasma/containment.cpp | 2 + src/plasma/dataengine.cpp | 2 + src/plasma/private/applet_p.cpp | 1 + src/plasma/private/applet_p.h | 2 +- src/plasma/private/configloader_p.h | 227 --------- src/plasma/private/configloaderhandler_p.h | 73 --- src/plasma/private/service_p.h | 4 - src/plasma/service.cpp | 135 +---- .../qml/plasmoid/appletinterface.cpp | 1 + .../qml/plasmoid/wallpaperinterface.cpp | 8 +- .../qml/plasmoid/wallpaperinterface.h | 10 +- 20 files changed, 35 insertions(+), 1414 deletions(-) delete mode 100644 autotests/configloadertest.cpp delete mode 100644 autotests/configloadertest.h delete mode 100644 autotests/configloadertest.xml delete mode 100644 src/plasma/configloader.cpp delete mode 100644 src/plasma/configloader.h delete mode 100644 src/plasma/private/configloader_p.h delete mode 100644 src/plasma/private/configloaderhandler_p.h diff --git a/autotests/CMakeLists.txt b/autotests/CMakeLists.txt index 8501228f5..7ee5df99b 100644 --- a/autotests/CMakeLists.txt +++ b/autotests/CMakeLists.txt @@ -25,7 +25,6 @@ MACRO(PLASMA_UNIT_TESTS) ENDMACRO(PLASMA_UNIT_TESTS) PLASMA_UNIT_TESTS( - configloadertest packagestructuretest packageurlinterceptortest pluginloadertest diff --git a/autotests/configloadertest.cpp b/autotests/configloadertest.cpp deleted file mode 100644 index a89d95168..000000000 --- a/autotests/configloadertest.cpp +++ /dev/null @@ -1,210 +0,0 @@ -/******************************************************************************** -* Copyright 2010 by Martin Blumenstingl * -* * -* This library 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 of the License, or (at your option) any later version. * -* * -* This library 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 * -* Library General Public License for more details. * -* * -* You should have received a copy of the GNU Library General Public License * -* along with this library; see the file COPYING.LIB. If not, write to * -* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * -* Boston, MA 02110-1301, USA. * -*********************************************************************************/ - -#include -#include "configloadertest.h" - -#include -#include -#include - -#include "plasma/configloader.h" - -Q_DECLARE_METATYPE(QList) - -#define TEST_NAME QString::fromLatin1("configloadertest") - -#define GET_CONFIG_ITEM_VALUE(type, configName) \ - KConfigSkeletonItem* item = cl->findItem(TEST_NAME, configName); \ - /* Check if we got back a valid item. */ \ - QVERIFY(item != 0); \ - /* Cast the item to the given type. */ \ - type typeItem = dynamic_cast(item); \ - /* Make sure the cast was successful. */ \ - QVERIFY(typeItem != 0); - -void ConfigLoaderTest::init() -{ - QString fileName = TEST_NAME + QString::fromLatin1(".xml"); - configFile = new QFile(QFINDTESTDATA(QString::fromLatin1("/") + fileName)); - cl = new Plasma::ConfigLoader(configFile->fileName(), configFile); -} - -void ConfigLoaderTest::cleanup() -{ - delete cl; - delete configFile; -} - -void ConfigLoaderTest::boolDefaultValue() -{ - GET_CONFIG_ITEM_VALUE(KCoreConfigSkeleton::ItemBool *, "DefaultBoolItem"); - - QVERIFY(typeItem->isEqual(true)); -} - -void ConfigLoaderTest::colorDefaultValue() -{ - GET_CONFIG_ITEM_VALUE(KConfigSkeleton::ItemColor *, "DefaultColorItem"); - - QVERIFY(typeItem->isEqual(QColor("#00FF00"))); -} - -void ConfigLoaderTest::dateTimeDefaultValue() -{ - GET_CONFIG_ITEM_VALUE(KCoreConfigSkeleton::ItemDateTime *, "DefaultDateTimeItem"); - - QVERIFY(typeItem->isEqual(QDateTime::fromString("Thu Sep 09 2010"))); -} - -void ConfigLoaderTest::enumDefaultValue() -{ - GET_CONFIG_ITEM_VALUE(KConfigSkeleton::ItemEnum *, "DefaultEnumItem"); - - QVERIFY(typeItem->isEqual(3)); -} - -void ConfigLoaderTest::fontDefaultValue() -{ - GET_CONFIG_ITEM_VALUE(KConfigSkeleton::ItemFont *, "DefaultFontItem"); - - QVERIFY(typeItem->isEqual(QFont("DejaVu Sans"))); -} - -void ConfigLoaderTest::intDefaultValue() -{ - GET_CONFIG_ITEM_VALUE(KCoreConfigSkeleton::ItemInt *, "DefaultIntItem"); - - QVERIFY(typeItem->isEqual(27)); -} - -void ConfigLoaderTest::passwordDefaultValue() -{ - GET_CONFIG_ITEM_VALUE(KConfigSkeleton::ItemPassword *, "DefaultPasswordItem"); - - QVERIFY(typeItem->isEqual(QString::fromLatin1("h4x."))); -} - -void ConfigLoaderTest::pathDefaultValue() -{ - GET_CONFIG_ITEM_VALUE(KConfigSkeleton::ItemPath *, "DefaultPathItem"); - - QVERIFY(typeItem->isEqual(QString::fromLatin1("/dev/null"))); -} - -void ConfigLoaderTest::stringDefaultValue() -{ - GET_CONFIG_ITEM_VALUE(KConfigSkeleton::ItemString *, "DefaultStringItem"); - - QVERIFY(typeItem->isEqual(QString::fromLatin1("TestString"))); -} - -void ConfigLoaderTest::stringListDefaultValue() -{ - GET_CONFIG_ITEM_VALUE(KConfigSkeleton::ItemStringList *, "DefaultStringListItem"); - - // Create a string list with the expected values. - QStringList expected; - expected.append("One"); - expected.append("Two"); - expected.append("Three"); - expected.append("Four"); - expected.append("Five"); - - QVERIFY(typeItem->isEqual(expected)); -} - -void ConfigLoaderTest::uintDefaultValue() -{ - GET_CONFIG_ITEM_VALUE(KCoreConfigSkeleton::ItemUInt *, "DefaultUIntItem"); - - QVERIFY(typeItem->isEqual(7U)); -} - -void ConfigLoaderTest::urlDefaultValue() -{ - GET_CONFIG_ITEM_VALUE(KCoreConfigSkeleton::ItemUrl *, "DefaultUrlItem"); - - QVERIFY(typeItem->isEqual(QUrl("http://kde.org"))); -} - -void ConfigLoaderTest::doubleDefaultValue() -{ - GET_CONFIG_ITEM_VALUE(KCoreConfigSkeleton::ItemDouble *, "DefaultDoubleItem"); - - QVERIFY(typeItem->isEqual(13.37)); -} - -void ConfigLoaderTest::intListDefaultValue() -{ - GET_CONFIG_ITEM_VALUE(KCoreConfigSkeleton::ItemIntList *, "DefaultIntListItem"); - - // Create a int list with the expected values. - QList expected; - expected.append(1); - expected.append(1); - expected.append(2); - expected.append(3); - expected.append(5); - expected.append(8); - - QVERIFY(typeItem->isEqual(qVariantFromValue(expected))); -} - -void ConfigLoaderTest::longLongDefaultValue() -{ - GET_CONFIG_ITEM_VALUE(KCoreConfigSkeleton::ItemLongLong *, "DefaultLongLongItem"); - - QVERIFY(typeItem->isEqual(Q_INT64_C(-9211372036854775808))); -} - -void ConfigLoaderTest::pointDefaultValue() -{ - GET_CONFIG_ITEM_VALUE(KCoreConfigSkeleton::ItemPoint *, "DefaultPointItem"); - - QVERIFY(typeItem->isEqual(QPoint(185, 857))); -} - -void ConfigLoaderTest::rectDefaultValue() -{ - GET_CONFIG_ITEM_VALUE(KCoreConfigSkeleton::ItemRect *, "DefaultRectItem"); - - // Create a new QRect with the expected value. - QRect expected; - expected.setCoords(3, 7, 951, 358); - - QVERIFY(typeItem->isEqual(expected)); -} - -void ConfigLoaderTest::sizeDefaultValue() -{ - GET_CONFIG_ITEM_VALUE(KCoreConfigSkeleton::ItemSize *, "DefaultSizeItem"); - - QVERIFY(typeItem->isEqual(QSize(640, 480))); -} - -void ConfigLoaderTest::ulongLongDefaultValue() -{ - GET_CONFIG_ITEM_VALUE(KCoreConfigSkeleton::ItemULongLong *, "DefaultULongLongItem"); - - QVERIFY(typeItem->isEqual(Q_UINT64_C(9223372036854775806))); -} - -QTEST_MAIN(ConfigLoaderTest) - diff --git a/autotests/configloadertest.h b/autotests/configloadertest.h deleted file mode 100644 index 791b0f610..000000000 --- a/autotests/configloadertest.h +++ /dev/null @@ -1,67 +0,0 @@ -/******************************************************************************** -* Copyright 2010 by Martin Blumenstingl * -* * -* This library 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 of the License, or (at your option) any later version. * -* * -* This library 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 * -* Library General Public License for more details. * -* * -* You should have received a copy of the GNU Library General Public License * -* along with this library; see the file COPYING.LIB. If not, write to * -* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * -* Boston, MA 02110-1301, USA. * -*********************************************************************************/ - -#ifndef CONFIGLOADERTEST_H -#define CONFIGLOADERTEST_H - -#include - -namespace Plasma -{ -class ConfigLoader; -} - -class QFile; - -class ConfigLoaderTest : public QObject -{ - Q_OBJECT - -public Q_SLOTS: - void init(); - void cleanup(); - -private Q_SLOTS: - void boolDefaultValue(); - void colorDefaultValue(); - void dateTimeDefaultValue(); - void enumDefaultValue(); - void fontDefaultValue(); - void intDefaultValue(); - void passwordDefaultValue(); - void pathDefaultValue(); - void stringDefaultValue(); - void stringListDefaultValue(); - void uintDefaultValue(); - void urlDefaultValue(); - void doubleDefaultValue(); - void intListDefaultValue(); - void longLongDefaultValue(); - void pointDefaultValue(); - void rectDefaultValue(); - void sizeDefaultValue(); - void ulongLongDefaultValue(); - -private: - Plasma::ConfigLoader *cl; - QFile *configFile; -}; - -#endif - diff --git a/autotests/configloadertest.xml b/autotests/configloadertest.xml deleted file mode 100644 index 13ccd320a..000000000 --- a/autotests/configloadertest.xml +++ /dev/null @@ -1,71 +0,0 @@ - - - - - - - true - - - #00FF00 - - - Thu Sep 09 2010 - - - 3 - - - - - - - DejaVu Sans - - - 27 - - - h4x. - - - /dev/null - - - TestString - - - One,Two,Three,Four,Five - - - 7 - - - http://kde.org - - - 13.37 - - - 1,1,2,3,5,8 - - - -9211372036854775808 - - - 185,857 - - - 3,7,951,358 - - - 640,480 - - - 9223372036854775806 - - - \ No newline at end of file diff --git a/src/plasma/CMakeLists.txt b/src/plasma/CMakeLists.txt index a7e98922e..bfcb5983e 100644 --- a/src/plasma/CMakeLists.txt +++ b/src/plasma/CMakeLists.txt @@ -44,7 +44,6 @@ set(Plasma_LIB_SRCS #applets,containments,corona applet.cpp - configloader.cpp containment.cpp containmentactions.cpp corona.cpp @@ -151,7 +150,6 @@ generate_export_header(KF5Plasma ecm_generate_headers(Plasma_CamelCase_HEADERS HEADER_NAMES Applet - ConfigLoader Containment ContainmentActions Corona diff --git a/src/plasma/applet.cpp b/src/plasma/applet.cpp index 88c4973d4..7b6e6eb0f 100644 --- a/src/plasma/applet.cpp +++ b/src/plasma/applet.cpp @@ -43,9 +43,9 @@ #include #include #include +#include #include -#include "configloader.h" #include "containment.h" #include "corona.h" #include "package.h" @@ -264,16 +264,16 @@ bool Applet::destroyed() const return d->transient; } -ConfigLoader *Applet::configScheme() const +KConfigLoader *Applet::configScheme() const { if (!d->configLoader) { const QString xmlPath = d->package ? d->package->filePath("mainconfigxml") : QString(); KConfigGroup cfg = config(); if (xmlPath.isEmpty()) { - d->configLoader = new ConfigLoader(&cfg, 0); + d->configLoader = new KConfigLoader(cfg, 0); } else { QFile file(xmlPath); - d->configLoader = new ConfigLoader(&cfg, &file); + d->configLoader = new KConfigLoader(cfg, &file); QObject::connect(d->configLoader, SIGNAL(configChanged()), this, SLOT(propagateConfigChanged())); } } diff --git a/src/plasma/applet.h b/src/plasma/applet.h index 06147fbe1..8112fbc92 100644 --- a/src/plasma/applet.h +++ b/src/plasma/applet.h @@ -30,7 +30,6 @@ #include #include -#include #include #include #include @@ -38,6 +37,7 @@ class QWidget; class KActionCollection; +class KConfigLoader; namespace Plasma { @@ -178,7 +178,7 @@ public: * * @return config skeleton object, or 0 if none **/ - ConfigLoader *configScheme() const; + KConfigLoader *configScheme() const; /** * Saves state information about this applet that will diff --git a/src/plasma/configloader.cpp b/src/plasma/configloader.cpp deleted file mode 100644 index 4822548d9..000000000 --- a/src/plasma/configloader.cpp +++ /dev/null @@ -1,467 +0,0 @@ -/* - * Copyright 2007 Aaron Seigo - * - * 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 "configloader.h" -#include "private/configloader_p.h" -#include "private/configloaderhandler_p.h" - -#include -#include -#include -#include -#include -#include -#include - -#include - -namespace Plasma -{ - -void ConfigLoaderPrivate::parse(ConfigLoader *loader, QIODevice *xml) -{ - clearData(); - loader->clearItems(); - - if (xml) { - QXmlInputSource source(xml); - QXmlSimpleReader reader; - ConfigLoaderHandler handler(loader, this); - reader.setContentHandler(&handler); - reader.parse(&source, false); - } -} - -ConfigLoaderHandler::ConfigLoaderHandler(ConfigLoader *config, ConfigLoaderPrivate *d) - : QXmlDefaultHandler(), - m_config(config), - d(d) -{ - resetState(); -} - -bool ConfigLoaderHandler::startElement(const QString &namespaceURI, const QString &localName, - const QString &qName, const QXmlAttributes &attrs) -{ - Q_UNUSED(namespaceURI) - Q_UNUSED(qName) - -// qDebug() << "ConfigLoaderHandler::startElement(" << localName << qName; - int numAttrs = attrs.count(); - QString tag = localName.toLower(); - if (tag == "group") { - QString group; - for (int i = 0; i < numAttrs; ++i) { - QString name = attrs.localName(i).toLower(); - if (name == "name") { - //qDebug() << "set group to" << attrs.value(i); - group = attrs.value(i); - } - } - if (group.isEmpty()) { - group = d->baseGroup; - } else { - d->groups.append(group); - if (!d->baseGroup.isEmpty()) { - group = d->baseGroup + '\x1d' + group; - } - } - m_currentGroup = group; - if (m_config) { - m_config->setCurrentGroup(group); - } - } else if (tag == "entry") { - for (int i = 0; i < numAttrs; ++i) { - QString name = attrs.localName(i).toLower(); - if (name == "name") { - m_name = attrs.value(i).trimmed(); - } else if (name == "type") { - m_type = attrs.value(i).toLower(); - } else if (name == "key") { - m_key = attrs.value(i).trimmed(); - } - } - } else if (tag == "choice") { - m_choice.name.clear(); - m_choice.label.clear(); - m_choice.whatsThis.clear(); - for (int i = 0; i < numAttrs; ++i) { - QString name = attrs.localName(i).toLower(); - if (name == "name") { - m_choice.name = attrs.value(i); - } - } - m_inChoice = true; - } - - return true; -} - -bool ConfigLoaderHandler::characters(const QString &ch) -{ - m_cdata.append(ch); - return true; -} - -QString ConfigLoaderHandler::name() const -{ - return m_name; -} - -void ConfigLoaderHandler::setName(const QString &name) -{ - m_name = name; -} - -QString ConfigLoaderHandler::key() const -{ - return m_key; -} - -void ConfigLoaderHandler::setKey(const QString &key) -{ - m_key = key; -} - -QString ConfigLoaderHandler::type() const -{ - return m_type; -} - -QString ConfigLoaderHandler::currentGroup() const -{ - return m_currentGroup; -} - -QString ConfigLoaderHandler::defaultValue() const -{ - return m_default; -} - -bool ConfigLoaderHandler::endElement(const QString &namespaceURI, - const QString &localName, const QString &qName) -{ - Q_UNUSED(namespaceURI) - Q_UNUSED(qName) - -// qDebug() << "ConfigLoaderHandler::endElement(" << localName << qName; - const QString tag = localName.toLower(); - if (tag == "group") { - m_name = "__operationName"; - m_type = "string"; - //m_default = currentGroup(); - addItem(); - resetState(); - } - if (tag == "entry") { - addItem(); - resetState(); - } else if (tag == "label") { - if (m_inChoice) { - m_choice.label = m_cdata.trimmed(); - } else { - m_label = m_cdata.trimmed(); - } - } else if (tag == "whatsthis") { - if (m_inChoice) { - m_choice.whatsThis = m_cdata.trimmed(); - } else { - m_whatsThis = m_cdata.trimmed(); - } - } else if (tag == "default") { - m_default = m_cdata.trimmed(); - } else if (tag == "min") { - m_min = m_cdata.toInt(&m_haveMin); - } else if (tag == "max") { - m_max = m_cdata.toInt(&m_haveMax); - } else if (tag == "choice") { - m_enumChoices.append(m_choice); - m_inChoice = false; - } - - m_cdata.clear(); - return true; -} - -void ConfigLoaderHandler::addItem() -{ - if (m_name.isEmpty()) { - if (m_key.isEmpty()) { - return; - } - - m_name = m_key; - } - - m_name.remove(' '); - - KConfigSkeletonItem *item = 0; - - if (m_type == "bool") { - bool defaultValue = m_default.toLower() == "true"; - item = m_config->addItemBool(m_name, *d->newBool(), defaultValue, m_key); - } else if (m_type == "color") { - item = m_config->addItemColor(m_name, *d->newColor(), QColor(m_default), m_key); - } else if (m_type == "datetime") { - item = m_config->addItemDateTime(m_name, *d->newDateTime(), - QDateTime::fromString(m_default), m_key); - } else if (m_type == "enum") { - m_key = (m_key.isEmpty()) ? m_name : m_key; - bool ok; - int value = m_default.toUInt(&ok); - //if is not an integer, try to find the string value among the registered choices - if (!ok) { - int i = 0; - foreach (const KConfigSkeleton::ItemEnum::Choice &choice, m_enumChoices) { - if (choice.name == m_default) { - value = i; - break; - } - ++i; - } - } - KConfigSkeleton::ItemEnum *enumItem = - new KConfigSkeleton::ItemEnum(m_config->currentGroup(), - m_key, *d->newInt(), - m_enumChoices, - value); - m_config->addItem(enumItem, m_name); - item = enumItem; - } else if (m_type == "font") { - item = m_config->addItemFont(m_name, *d->newFont(), QFont(m_default), m_key); - } else if (m_type == "int") { - KConfigSkeleton::ItemInt *intItem = m_config->addItemInt(m_name, *d->newInt(), - m_default.toInt(), m_key); - - if (m_haveMin) { - intItem->setMinValue(m_min); - } - - if (m_haveMax) { - intItem->setMaxValue(m_max); - } - - item = intItem; - } else if (m_type == "password") { - item = m_config->addItemPassword(m_name, *d->newString(), m_default, m_key); - } else if (m_type == "path") { - item = m_config->addItemPath(m_name, *d->newString(), m_default, m_key); - } else if (m_type == "string") { - item = m_config->addItemString(m_name, *d->newString(), m_default, m_key); - } else if (m_type == "stringlist") { - //FIXME: the split() is naive and will break on lists with ,'s in them - item = m_config->addItemStringList(m_name, *d->newStringList(), - m_default.split(','), m_key); - } else if (m_type == "uint") { - KConfigSkeleton::ItemUInt *uintItem = - m_config->addItemUInt(m_name, *d->newUint(), m_default.toUInt(), m_key); - if (m_haveMin) { - uintItem->setMinValue(m_min); - } - if (m_haveMax) { - uintItem->setMaxValue(m_max); - } - item = uintItem; - } else if (m_type == "url") { - m_key = (m_key.isEmpty()) ? m_name : m_key; - KConfigSkeleton::ItemUrl *urlItem = - new KConfigSkeleton::ItemUrl(m_config->currentGroup(), - m_key, *d->newUrl(), - QUrl::fromUserInput(m_default)); - m_config->addItem(urlItem, m_name); - item = urlItem; - } else if (m_type == "double") { - KConfigSkeleton::ItemDouble *doubleItem = m_config->addItemDouble(m_name, - *d->newDouble(), m_default.toDouble(), m_key); - if (m_haveMin) { - doubleItem->setMinValue(m_min); - } - if (m_haveMax) { - doubleItem->setMaxValue(m_max); - } - item = doubleItem; - } else if (m_type == "intlist") { - QStringList tmpList = m_default.split(','); - QList defaultList; - foreach (const QString &tmp, tmpList) { - defaultList.append(tmp.toInt()); - } - item = m_config->addItemIntList(m_name, *d->newIntList(), defaultList, m_key); - } else if (m_type == "longlong") { - KConfigSkeleton::ItemLongLong *longlongItem = m_config->addItemLongLong(m_name, - *d->newLongLong(), m_default.toLongLong(), m_key); - if (m_haveMin) { - longlongItem->setMinValue(m_min); - } - if (m_haveMax) { - longlongItem->setMaxValue(m_max); - } - item = longlongItem; - /* No addItemPathList in KConfigSkeleton ? - } else if (m_type == "PathList") { - //FIXME: the split() is naive and will break on lists with ,'s in them - item = m_config->addItemPathList(m_name, *d->newStringList(), m_default.split(","), m_key); - */ - } else if (m_type == "point") { - QPoint defaultPoint; - QStringList tmpList = m_default.split(','); - if (tmpList.size() >= 2) { - defaultPoint.setX(tmpList[0].toInt()); - defaultPoint.setY(tmpList[1].toInt()); - } - item = m_config->addItemPoint(m_name, *d->newPoint(), defaultPoint, m_key); - } else if (m_type == "rect") { - QRect defaultRect; - QStringList tmpList = m_default.split(','); - if (tmpList.size() >= 4) { - defaultRect.setCoords(tmpList[0].toInt(), tmpList[1].toInt(), - tmpList[2].toInt(), tmpList[3].toInt()); - } - item = m_config->addItemRect(m_name, *d->newRect(), defaultRect, m_key); - } else if (m_type == "size") { - QSize defaultSize; - QStringList tmpList = m_default.split(','); - if (tmpList.size() >= 2) { - defaultSize.setWidth(tmpList[0].toInt()); - defaultSize.setHeight(tmpList[1].toInt()); - } - item = m_config->addItemSize(m_name, *d->newSize(), defaultSize, m_key); - } else if (m_type == "ulonglong") { - KConfigSkeleton::ItemULongLong *ulonglongItem = - m_config->addItemULongLong(m_name, *d->newULongLong(), m_default.toULongLong(), m_key); - if (m_haveMin) { - ulonglongItem->setMinValue(m_min); - } - if (m_haveMax) { - ulonglongItem->setMaxValue(m_max); - } - item = ulonglongItem; - /* No addItemUrlList in KConfigSkeleton ? - } else if (m_type == "urllist") { - //FIXME: the split() is naive and will break on lists with ,'s in them - QStringList tmpList = m_default.split(","); - QList defaultList; - foreach (const QString& tmp, tmpList) { - defaultList.append(QUrl(tmp)); - } - item = m_config->addItemUrlList(m_name, *d->newUrlList(), defaultList, m_key);*/ - } - - if (item) { - item->setLabel(m_label); - item->setWhatsThis(m_whatsThis); - d->keysToNames.insert(item->group() + item->key(), item->name()); - } -} - -void ConfigLoaderHandler::resetState() -{ - m_haveMin = false; - m_min = 0; - m_haveMax = false; - m_max = 0; - m_name.clear(); - m_type.clear(); - m_label.clear(); - m_default.clear(); - m_key.clear(); - m_whatsThis.clear(); - m_enumChoices.clear(); - m_inChoice = false; -} - -ConfigLoader::ConfigLoader(const QString &configFile, QIODevice *xml, QObject *parent) - : KConfigSkeleton(configFile, parent), - d(new ConfigLoaderPrivate) -{ - d->parse(this, xml); -} - -ConfigLoader::ConfigLoader(KSharedConfigPtr config, QIODevice *xml, QObject *parent) - : KConfigSkeleton(config, parent), - d(new ConfigLoaderPrivate) -{ - d->parse(this, xml); -} - -//FIXME: obviously this is broken and should be using the group as the root, -// but KConfigSkeleton does not currently support this. it will eventually though, -// at which point this can be addressed properly -ConfigLoader::ConfigLoader(const KConfigGroup *config, QIODevice *xml, QObject *parent) - : KConfigSkeleton(KSharedConfig::openConfig(config->config()->name()), parent), - d(new ConfigLoaderPrivate) -{ - KConfigGroup group = config->parent(); - d->baseGroup = config->name(); - while (group.isValid() && group.name() != "") { - d->baseGroup = group.name() + '\x1d' + d->baseGroup; - group = group.parent(); - } - d->parse(this, xml); -} - -ConfigLoader::~ConfigLoader() -{ - delete d; -} - -KConfigSkeletonItem *ConfigLoader::findItem(const QString &group, const QString &key) -{ - return KConfigSkeleton::findItem(d->keysToNames[group + key]); -} - -KConfigSkeletonItem *ConfigLoader::findItemByName(const QString &name) -{ - return KConfigSkeleton::findItem(name); -} - -QVariant ConfigLoader::property(const QString &name) -{ - KConfigSkeletonItem *item = KConfigSkeleton::findItem(name); - - if (item) { - return item->property(); - } - - return QVariant(); -} - -bool ConfigLoader::hasGroup(const QString &group) const -{ - return d->groups.contains(group); -} - -QStringList ConfigLoader::groupList() const -{ - return d->groups; -} - -bool ConfigLoader::usrWriteConfig() -{ - if (d->saveDefaults) { - KConfigSkeletonItem::List itemList = items(); - for (int i = 0; i < itemList.size(); i++) { - KConfigGroup cg(config(), itemList.at(i)->group()); - cg.writeEntry(itemList.at(i)->key(), ""); - } - } - return true; -} - -} // Plasma namespace diff --git a/src/plasma/configloader.h b/src/plasma/configloader.h deleted file mode 100644 index 4ef9cb429..000000000 --- a/src/plasma/configloader.h +++ /dev/null @@ -1,154 +0,0 @@ -/* - * Copyright 2007 Aaron Seigo - * - * 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 PLASMA_CONFIGLOADER_H -#define PLASMA_CONFIGLOADER_H - -#include -#include -#include - -#include - -/** - * @class ConfigLoader plasma/configloader.h - * - * @short A KConfigSkeleton that populates itself based on KConfigXT XML - * - * This class allows one to ship an XML file and reconstitute it into a - * KConfigSkeleton object at runtime. Common usage might look like this: - * - * \code - * QFile file(xmlFilePath); - * Plasma::ConfigLoader appletConfig(configFilePath, &file); - * \endcode - * - * Alternatively, any QIODevice may be used in place of QFile in the - * example above. - * - * Currently the following data types are supported: - * - * @li bools - * @li colors - * @li datetimes - * @li enumerations - * @li fonts - * @li ints - * @li passwords - * @li paths - * @li strings - * @li stringlists - * @li uints - * @li urls - * @li doubles - * @li int lists - * @li longlongs - * @li path lists - * @li points - * @li rects - * @li sizes - * @li ulonglongs - * @li url lists - **/ - -namespace Plasma -{ - -class ConfigLoaderPrivate; - -class PLASMA_EXPORT ConfigLoader : public KConfigSkeleton -{ -public: - /** - * Creates a KConfigSkeleton populated using the definition found in - * the XML data passed in. - * - * @param configFile path to the configuration file to use - * @param xml the xml data; must be valid KConfigXT data - * @param parent optional QObject parent - **/ - ConfigLoader(const QString &configFile, QIODevice *xml, QObject *parent = 0); - - /** - * Creates a KConfigSkeleton populated using the definition found in - * the XML data passed in. - * - * @param config the configuration object to use - * @param xml the xml data; must be valid KConfigXT data - * @param parent optional QObject parent - **/ - ConfigLoader(KSharedConfigPtr config, QIODevice *xml, QObject *parent = 0); - - /** - * Creates a KConfigSkeleton populated using the definition found in - * the XML data passed in. - * - * @param config the group to use as the root for configuration items - * @param xml the xml data; must be valid KConfigXT data - * @param parent optional QObject parent - **/ - ConfigLoader(const KConfigGroup *config, QIODevice *xml, QObject *parent = 0); - ~ConfigLoader(); - - /** - * Finds the item for the given group and key. - * - * @param group the group in the config file to look in - * @param key the configuration key to find - * @return the associated KConfigSkeletonItem, or 0 if none - */ - KConfigSkeletonItem *findItem(const QString &group, const QString &key); - - /** - * Finds an item by its name - */ - KConfigSkeletonItem *findItemByName(const QString &name); - - /** - * Returns the property (variantized value) of the named item - */ - QVariant property(const QString &name); - - /** - * Check to see if a group exists - * - * @param group the name of the group to check for - * @return true if the group exists, or false if it does not - */ - bool hasGroup(const QString &group) const; - - /** - * @return the list of groups defined by the XML - */ - QStringList groupList() const; - -protected: - /** - * Hack used to force writing when no default exists in config file. - */ - bool usrWriteConfig(); - -private: - friend class Service; - ConfigLoaderPrivate *const d; -}; - -} // Plasma namespace - -#endif //multiple inclusion guard diff --git a/src/plasma/containment.cpp b/src/plasma/containment.cpp index 95c9da0d7..c897f3f04 100644 --- a/src/plasma/containment.cpp +++ b/src/plasma/containment.cpp @@ -39,6 +39,8 @@ #include #include #include +#include +#include #if !PLASMA_NO_KIO #include "kio/jobclasses.h" // for KIO::JobFlags diff --git a/src/plasma/dataengine.cpp b/src/plasma/dataengine.cpp index 86e33d195..a4bfddab4 100644 --- a/src/plasma/dataengine.cpp +++ b/src/plasma/dataengine.cpp @@ -29,6 +29,8 @@ #include #include +#include + #include #include #include diff --git a/src/plasma/private/applet_p.cpp b/src/plasma/private/applet_p.cpp index d0ac89ece..9feefed23 100644 --- a/src/plasma/private/applet_p.cpp +++ b/src/plasma/private/applet_p.cpp @@ -34,6 +34,7 @@ #include #include #include +#include #include "containment.h" #include "corona.h" diff --git a/src/plasma/private/applet_p.h b/src/plasma/private/applet_p.h index f31f02e39..fcce650af 100644 --- a/src/plasma/private/applet_p.h +++ b/src/plasma/private/applet_p.h @@ -92,7 +92,7 @@ public: // sripting and package stuff AppletScript *script; Package *package; - ConfigLoader *configLoader; + KConfigLoader *configLoader; // actions stuff; put activationAction into actions? KActionCollection *actions; diff --git a/src/plasma/private/configloader_p.h b/src/plasma/private/configloader_p.h deleted file mode 100644 index 25bb6b8ee..000000000 --- a/src/plasma/private/configloader_p.h +++ /dev/null @@ -1,227 +0,0 @@ -/* - * Copyright 2007-2008 Aaron Seigo - * - * 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 PLASMA_CONFIGLOADER_P_H -#define PLASMA_CONFIGLOADER_P_H - -#include - -namespace Plasma -{ - -class ConfigLoaderPrivate -{ -public: - ConfigLoaderPrivate() - : saveDefaults(false) - { - } - - ~ConfigLoaderPrivate() - { - clearData(); - } - - void clearData() - { - qDeleteAll(bools); - qDeleteAll(strings); - qDeleteAll(stringlists); - qDeleteAll(colors); - qDeleteAll(fonts); - qDeleteAll(ints); - qDeleteAll(uints); - qDeleteAll(urls); - qDeleteAll(dateTimes); - qDeleteAll(doubles); - qDeleteAll(intlists); - qDeleteAll(longlongs); - qDeleteAll(points); - qDeleteAll(rects); - qDeleteAll(sizes); - qDeleteAll(ulonglongs); - qDeleteAll(urllists); - } - - bool *newBool() - { - bool *v = new bool; - bools.append(v); - return v; - } - - QString *newString() - { - QString *v = new QString; - strings.append(v); - return v; - } - - QStringList *newStringList() - { - QStringList *v = new QStringList; - stringlists.append(v); - return v; - } - - QColor *newColor() - { - QColor *v = new QColor; - colors.append(v); - return v; - } - - QFont *newFont() - { - QFont *v = new QFont; - fonts.append(v); - return v; - } - - qint32 *newInt() - { - qint32 *v = new qint32; - ints.append(v); - return v; - } - - quint32 *newUint() - { - quint32 *v = new quint32; - uints.append(v); - return v; - } - - QUrl *newUrl() - { - QUrl *v = new QUrl; - urls.append(v); - return v; - } - - QDateTime *newDateTime() - { - QDateTime *v = new QDateTime; - dateTimes.append(v); - return v; - } - - double *newDouble() - { - double *v = new double; - doubles.append(v); - return v; - } - - QList *newIntList() - { - QList *v = new QList; - intlists.append(v); - return v; - } - - qint64 *newLongLong() - { - qint64 *v = new qint64; - longlongs.append(v); - return v; - } - - QPoint *newPoint() - { - QPoint *v = new QPoint; - points.append(v); - return v; - } - - QRect *newRect() - { - QRect *v = new QRect; - rects.append(v); - return v; - } - - QSize *newSize() - { - QSize *v = new QSize; - sizes.append(v); - return v; - } - - quint64 *newULongLong() - { - quint64 *v = new quint64; - ulonglongs.append(v); - return v; - } - - QList *newUrlList() - { - QList *v = new QList(); - urllists.append(v); - return v; - } - - void parse(ConfigLoader *loader, QIODevice *xml); - - /** - * Whether or not to write out default values. - * - * @param writeDefaults true if defaults should be written out - */ - void setWriteDefaults(bool writeDefaults) - { - saveDefaults = writeDefaults; - } - - /** - * @return true if default values will also be written out - */ - bool writeDefaults() const - { - return saveDefaults; - } - - QList bools; - QList strings; - QList stringlists; - QList colors; - QList fonts; - QList ints; - QList uints; - QList urls; - QList dateTimes; - QList doubles; - QList *> intlists; - QList longlongs; - QList points; - QList rects; - QList sizes; - QList ulonglongs; - QList *> urllists; - QString baseGroup; - QStringList groups; - QHash keysToNames; - bool saveDefaults; -}; - -} // namespace Plasma - -#endif - diff --git a/src/plasma/private/configloaderhandler_p.h b/src/plasma/private/configloaderhandler_p.h deleted file mode 100644 index df96a3328..000000000 --- a/src/plasma/private/configloaderhandler_p.h +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright 2007-2008 Aaron Seigo - * Copyright 2013 Marco Martin - * - * 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 PLASMA_CONFIGLOADERHANDLER_P_H -#define PLASMA_CONFIGLOADERHANDLER_P_H - -#include - -namespace Plasma -{ - -class ConfigLoaderHandler : public QXmlDefaultHandler -{ -public: - ConfigLoaderHandler(ConfigLoader *config, ConfigLoaderPrivate *d); - bool startElement(const QString &namespaceURI, const QString &localName, - const QString &qName, const QXmlAttributes &atts); - bool endElement(const QString &namespaceURI, const QString &localName, - const QString &qName); - bool characters(const QString &ch); - - QString name() const; - void setName(const QString &name); - QString key() const; - void setKey(const QString &name); - QString type() const; - QString currentGroup() const; - QString defaultValue() const; - -private: - virtual void addItem(); - void resetState(); - - ConfigLoader *m_config; - ConfigLoaderPrivate *d; - int m_min; - int m_max; - QString m_currentGroup; - QString m_name; - QString m_key; - QString m_type; - QString m_label; - QString m_default; - QString m_cdata; - QString m_whatsThis; - KConfigSkeleton::ItemEnum::Choice m_choice; - QList m_enumChoices; - bool m_haveMin; - bool m_haveMax; - bool m_inChoice; -}; - -} // namespace Plasma - -#endif - diff --git a/src/plasma/private/service_p.h b/src/plasma/private/service_p.h index 3a703928d..d0886dbc2 100644 --- a/src/plasma/private/service_p.h +++ b/src/plasma/private/service_p.h @@ -31,13 +31,9 @@ #include #include -#include "plasma/configloader.h" - namespace Plasma { -class ConfigLoader; - class NullServiceJob : public ServiceJob { public: diff --git a/src/plasma/service.cpp b/src/plasma/service.cpp index 1b3cbaf23..31502ecf1 100644 --- a/src/plasma/service.cpp +++ b/src/plasma/service.cpp @@ -30,126 +30,17 @@ #include #include #include +#include +#include #include -#include "configloader.h" #include "version.h" -#include "private/configloader_p.h" -#include "private/configloaderhandler_p.h" #include "pluginloader.h" namespace Plasma { -class ConfigLoaderHandlerMap : public ConfigLoaderHandler -{ -public: - ConfigLoaderHandlerMap(ConfigLoader *config, ConfigLoaderPrivate *d) - : ConfigLoaderHandler(config, d) - {} - - void addItem(); - const QMap &groupsMap() const; - -private: - QMap m_groupsMap; -}; - -void ConfigLoaderHandlerMap::addItem() -{ - if (name().isEmpty()) { - if (key().isEmpty()) { - return; - } - - setName(key()); - } else if (key().isEmpty()) { - if (name().isEmpty()) { - return; - } - - setKey(name()); - } - - if (!m_groupsMap.contains(currentGroup())) { - m_groupsMap[currentGroup()] = QVariantMap(); - m_groupsMap[currentGroup()]["_name"] = currentGroup(); - } - - if (type() == "bool") { - bool defaultVal = defaultValue().toLower() == "true"; - m_groupsMap[currentGroup()][key()] = defaultVal; - } else if (type() == "color") { - m_groupsMap[currentGroup()][key()] = QColor(defaultValue()); - } else if (type() == "datetime") { - m_groupsMap[currentGroup()][key()] = QDateTime::fromString(defaultValue()); - } else if (type() == "enum") { - key() = (key().isEmpty()) ? name() : key(); - m_groupsMap[currentGroup()][key()] = defaultValue().toUInt(); - } else if (type() == "font") { - m_groupsMap[currentGroup()][key()] = QFont(defaultValue()); - } else if (type() == "int") { - m_groupsMap[currentGroup()][key()] = defaultValue().toInt(); - } else if (type() == "password") { - m_groupsMap[currentGroup()][key()] = defaultValue(); - } else if (type() == "path") { - m_groupsMap[currentGroup()][key()] = defaultValue(); - } else if (type() == "string") { - m_groupsMap[currentGroup()][key()] = defaultValue(); - } else if (type() == "stringlist") { - //FIXME: the split() is naive and will break on lists with ,'s in them - m_groupsMap[currentGroup()][key()] = defaultValue().split(','); - } else if (type() == "uint") { - m_groupsMap[currentGroup()][key()] = defaultValue().toUInt(); - } else if (type() == "url") { - setKey((key().isEmpty()) ? name() : key()); - m_groupsMap[currentGroup()][key()] = QUrl::fromUserInput(defaultValue()); - } else if (type() == "double") { - m_groupsMap[currentGroup()][key()] = defaultValue().toDouble(); - } else if (type() == "intlist") { - QStringList tmpList = defaultValue().split(','); - QList defaultList; - foreach (const QString &tmp, tmpList) { - defaultList.append(tmp.toInt()); - } - m_groupsMap[currentGroup()][key()] = QVariant::fromValue(defaultList); - } else if (type() == "longlong") { - m_groupsMap[currentGroup()][key()] = defaultValue().toLongLong(); - } else if (type() == "point") { - QPoint defaultPoint; - QStringList tmpList = defaultValue().split(','); - if (tmpList.size() >= 2) { - defaultPoint.setX(tmpList[0].toInt()); - defaultPoint.setY(tmpList[1].toInt()); - } - m_groupsMap[currentGroup()][key()] = defaultPoint; - } else if (type() == "rect") { - QRect defaultRect; - QStringList tmpList = defaultValue().split(','); - if (tmpList.size() >= 4) { - defaultRect.setCoords(tmpList[0].toInt(), tmpList[1].toInt(), - tmpList[2].toInt(), tmpList[3].toInt()); - } - m_groupsMap[currentGroup()][key()] = tmpList; - } else if (type() == "size") { - QSize defaultSize; - QStringList tmpList = defaultValue().split(','); - if (tmpList.size() >= 2) { - defaultSize.setWidth(tmpList[0].toInt()); - defaultSize.setHeight(tmpList[1].toInt()); - } - m_groupsMap[currentGroup()][key()] = tmpList; - } else if (type() == "ulonglong") { - m_groupsMap[currentGroup()][key()] = defaultValue().toULongLong(); - } -} - -const QMap &ConfigLoaderHandlerMap::groupsMap() const -{ - return m_groupsMap; -} - Service::Service(QObject *parent) : QObject(parent), d(new ServicePrivate(this)) @@ -279,15 +170,19 @@ void Service::setOperationsScheme(QIODevice *xml) { d->operationsMap.clear(); - ConfigLoaderPrivate *configLoaderPrivate = new ConfigLoaderPrivate; - configLoaderPrivate->setWriteDefaults(true); - ConfigLoaderHandlerMap configLoaderHandler(0, configLoaderPrivate); - QXmlInputSource source(xml); - QXmlSimpleReader reader; - reader.setContentHandler(&configLoaderHandler); - reader.parse(&source, false); - d->operationsMap = configLoaderHandler.groupsMap(); - delete configLoaderPrivate; + // /dev/null is because I need to pass a filename argument to construct a + // KSharedConfig. We need a config object for the config loader even + // though we dont' actually want to use any config parts from it, + // we just want to share the KConfigLoader XML parsing. + KSharedConfigPtr config = KSharedConfig::openConfig("/dev/null"); + KConfigLoader loader(config, xml); + + foreach (const QString &group, loader.groupList()) { + d->operationsMap[group]["_name"] = group; + } + foreach (KConfigSkeletonItem *item, loader.items()) { + d->operationsMap[item->group()][item->key()] = item->property(); + } } void Service::registerOperationsScheme() diff --git a/src/scriptengines/qml/plasmoid/appletinterface.cpp b/src/scriptengines/qml/plasmoid/appletinterface.cpp index f36270c87..b8e1002ad 100644 --- a/src/scriptengines/qml/plasmoid/appletinterface.cpp +++ b/src/scriptengines/qml/plasmoid/appletinterface.cpp @@ -37,6 +37,7 @@ #include #include #include +#include #include #include diff --git a/src/scriptengines/qml/plasmoid/wallpaperinterface.cpp b/src/scriptengines/qml/plasmoid/wallpaperinterface.cpp index a3a9b5134..bc2d749bf 100644 --- a/src/scriptengines/qml/plasmoid/wallpaperinterface.cpp +++ b/src/scriptengines/qml/plasmoid/wallpaperinterface.cpp @@ -26,6 +26,7 @@ #include #include #include +#include #include #include @@ -33,7 +34,6 @@ #include #include -#include #include QHash WallpaperInterface::s_rootObjects = QHash(); @@ -88,7 +88,7 @@ KDeclarative::ConfigPropertyMap *WallpaperInterface::configuration() const return m_configuration; } -Plasma::ConfigLoader *WallpaperInterface::configScheme() +KConfigLoader *WallpaperInterface::configScheme() { if (!m_configLoader) { //FIXME: do we need "mainconfigxml" in wallpaper packagestructures? @@ -98,10 +98,10 @@ Plasma::ConfigLoader *WallpaperInterface::configScheme() cfg = KConfigGroup(&cfg, "Wallpaper"); if (xmlPath.isEmpty()) { - m_configLoader = new Plasma::ConfigLoader(&cfg, 0); + m_configLoader = new KConfigLoader(cfg, 0); } else { QFile file(xmlPath); - m_configLoader = new Plasma::ConfigLoader(&cfg, &file); + m_configLoader = new KConfigLoader(cfg, &file); } } diff --git a/src/scriptengines/qml/plasmoid/wallpaperinterface.h b/src/scriptengines/qml/plasmoid/wallpaperinterface.h index bd70aa363..20c811fea 100644 --- a/src/scriptengines/qml/plasmoid/wallpaperinterface.h +++ b/src/scriptengines/qml/plasmoid/wallpaperinterface.h @@ -25,11 +25,7 @@ #include -namespace Plasma -{ -class ConfigLoader; -} - +class KConfigLoader; class KActionCollection; class ContainmentInterface; @@ -67,7 +63,7 @@ public: KDeclarative::ConfigPropertyMap *configuration() const; - Plasma::ConfigLoader *configScheme(); + KConfigLoader *configScheme(); QList contextualActions() const; @@ -107,7 +103,7 @@ private: KDeclarative::QmlObject *m_qmlObject; Plasma::Package m_pkg; KDeclarative::ConfigPropertyMap *m_configuration; - Plasma::ConfigLoader *m_configLoader; + KConfigLoader *m_configLoader; KActionCollection *m_actions; QSignalMapper *m_actionSignals;