add a ctor that takes a KSharedConfig::Ptr
svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=694406
This commit is contained in:
parent
f7abb4b135
commit
b1fafa0edc
@ -338,7 +338,18 @@ void ConfigXmlHandler::resetState()
|
|||||||
}
|
}
|
||||||
|
|
||||||
ConfigXml::ConfigXml(const QString &configFile, QIODevice *xml, QObject *parent)
|
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)
|
d(new Private)
|
||||||
{
|
{
|
||||||
QXmlInputSource source(xml);
|
QXmlInputSource source(xml);
|
||||||
|
11
configxml.h
11
configxml.h
@ -20,6 +20,7 @@
|
|||||||
#define CONFIGXML_H
|
#define CONFIGXML_H
|
||||||
|
|
||||||
#include <KConfigSkeleton>
|
#include <KConfigSkeleton>
|
||||||
|
#include <KSharedConfig>
|
||||||
|
|
||||||
#include <plasma/plasma_export.h>
|
#include <plasma/plasma_export.h>
|
||||||
|
|
||||||
@ -81,6 +82,16 @@ public:
|
|||||||
* @param parent optional QObject parent
|
* @param parent optional QObject parent
|
||||||
**/
|
**/
|
||||||
ConfigXml(const QString &configFile, QIODevice *xml, QObject *parent = 0);
|
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();
|
~ConfigXml();
|
||||||
|
|
||||||
class Private;
|
class Private;
|
||||||
|
Loading…
Reference in New Issue
Block a user