add a ctor that takes a KSharedConfig::Ptr

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=694406
This commit is contained in:
Aaron J. Seigo 2007-07-30 16:18:27 +00:00
parent f7abb4b135
commit b1fafa0edc
2 changed files with 23 additions and 1 deletions

View File

@ -338,7 +338,18 @@ void ConfigXmlHandler::resetState()
}
ConfigXml::ConfigXml(const QString &configFile, QIODevice *xml, QObject *parent)
: KConfigSkeleton(configFile/*, parent*/), //FIXME: on monday, use the parent again after aseigo (that's me! =) commits fixes to kconfigskeleton
: KConfigSkeleton(configFile, parent),
d(new Private)
{
QXmlInputSource source(xml);
QXmlSimpleReader reader;
ConfigXmlHandler handler(this, d);
reader.setContentHandler(&handler);
reader.parse(&source, false);
}
ConfigXml::ConfigXml(KSharedConfig::Ptr config, QIODevice *xml, QObject *parent)
: KConfigSkeleton(config, parent),
d(new Private)
{
QXmlInputSource source(xml);

View File

@ -20,6 +20,7 @@
#define CONFIGXML_H
#include <KConfigSkeleton>
#include <KSharedConfig>
#include <plasma/plasma_export.h>
@ -81,6 +82,16 @@ public:
* @param parent optional QObject parent
**/
ConfigXml(const QString &configFile, QIODevice *xml, QObject *parent = 0);
/**
* 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
**/
ConfigXml(KSharedConfig::Ptr config, QIODevice *xml, QObject *parent = 0);
~ConfigXml();
class Private;