move ConfigLoaderHandler in own header

This commit is contained in:
Marco Martin 2013-05-02 11:33:23 +02:00
parent 1d7c6af919
commit e58ab0bc99
2 changed files with 67 additions and 31 deletions

View File

@ -19,6 +19,7 @@
#include "configloader.h"
#include "private/configloader_p.h"
#include "private/configloaderhandler_p.h"
#include <QColor>
#include <QFont>
@ -32,37 +33,6 @@
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);
private:
void addItem();
void resetState();
ConfigLoader *m_config;
ConfigLoaderPrivate *d;
int m_min;
int m_max;
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<KConfigSkeleton::ItemEnum::Choice> m_enumChoices;
bool m_haveMin;
bool m_haveMax;
bool m_inChoice;
};
void ConfigLoaderPrivate::parse(ConfigLoader *loader, QIODevice *xml)
{

View File

@ -0,0 +1,66 @@
/*
* Copyright 2007-2008 Aaron Seigo <aseigo@kde.org>
* Copyright 2013 Marco Martin <mart@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 PLASMA_CONFIGLOADERHANDLER_P_H
#define PLASMA_CONFIGLOADERHANDLER_P_H
#include <QXmlDefaultHandler>
#include <kurl.h>
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);
private:
void addItem();
void resetState();
ConfigLoader *m_config;
ConfigLoaderPrivate *d;
int m_min;
int m_max;
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<KConfigSkeleton::ItemEnum::Choice> m_enumChoices;
bool m_haveMin;
bool m_haveMax;
bool m_inChoice;
};
} // namespace Plasma
#endif