don't export ConfigCategory

This commit is contained in:
Giorgos Tsiapaliokas 2013-09-02 19:12:40 +03:00 committed by Marco Martin
parent 768d0c07a8
commit 94806e9e2b
3 changed files with 77 additions and 96 deletions

View File

@ -17,6 +17,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "configview_p.h"
#include "configview.h"
#include "Plasma/Applet"
#include "Plasma/Containment"
@ -39,28 +40,8 @@
///////////////////////ConfigCategory
class ConfigCategoryPrivate
{
public:
ConfigCategoryPrivate();
~ConfigCategoryPrivate();
QString name;
QString icon;
QString source;
QString pluginName;
};
ConfigCategoryPrivate::ConfigCategoryPrivate()
{
}
ConfigCategoryPrivate::~ConfigCategoryPrivate()
{
}
ConfigCategory::ConfigCategory(QObject *parent)
: QObject(parent),
d(new ConfigCategoryPrivate())
: QObject(parent)
{
}
@ -69,63 +50,63 @@ ConfigCategory::~ConfigCategory()
QString ConfigCategory::name() const
{
return d->name;
return m_name;
}
void ConfigCategory::setName(const QString &name)
{
if (d->name == name) {
if (m_name == name) {
return;
}
d->name = name;
m_name = name;
emit nameChanged();
}
QString ConfigCategory::icon() const
{
return d->icon;
return m_icon;
}
void ConfigCategory::setIcon(const QString &icon)
{
if (d->icon == icon) {
if (m_icon == icon) {
return;
}
d->icon = icon;
m_icon = icon;
emit iconChanged();
}
QString ConfigCategory::source() const
{
return d->source;
return m_source;
}
void ConfigCategory::setSource(const QString &source)
{
if (d->source == source) {
if (m_source == source) {
return;
}
d->source = source;
m_source = source;
emit sourceChanged();
}
QString ConfigCategory::pluginName() const
{
return d->pluginName;
return m_pluginName;
}
void ConfigCategory::setPluginName(const QString &name)
{
if (d->pluginName == name) {
if (m_pluginName == name) {
return;
}
d->pluginName = name;
m_pluginName = name;
emit pluginNameChanged();
}

View File

@ -36,70 +36,8 @@ class ConfigPropertyMap;
class ConfigCategoryPrivate;
class PLASMAVIEW_EXPORT ConfigCategory : public QObject
{
Q_OBJECT
Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged)
Q_PROPERTY(QString icon READ icon WRITE setIcon NOTIFY iconChanged)
Q_PROPERTY(QString source READ source WRITE setSource NOTIFY sourceChanged)
Q_PROPERTY(QString pluginName READ pluginName WRITE setPluginName NOTIFY pluginNameChanged)
public:
ConfigCategory(QObject *parent = 0);
~ConfigCategory();
/**
* @return the name of the category
**/
QString name() const;
/**
* @param name the name of the category
**/
void setName(const QString &name);
/**
* @return the icon of the category
**/
QString icon() const;
/**
* @param icon the icon of the category
**/
void setIcon(const QString &icon);
QString source() const;
void setSource(const QString &source);
QString pluginName() const;
void setPluginName(const QString &pluginName);
Q_SIGNALS:
/**
* emitted when the name id changed
**/
void nameChanged();
/**
* emitted when the icon is changed
**/
void iconChanged();
/**
* emitted when the source is changed
**/
void sourceChanged();
/**
* emitted when the plugin is changed
**/
void pluginNameChanged();
private:
ConfigCategoryPrivate *const d;
};
class ConfigModelPrivate;
class ConfigCategory;
class PLASMAVIEW_EXPORT ConfigModel : public QAbstractListModel
{

View File

@ -0,0 +1,62 @@
/*
* 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 CONFIGUILOADER_P_H
#define CONFIGUILOADER_P_H
#include <QObject>
class ConfigCategory : public QObject
{
Q_OBJECT
Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged)
Q_PROPERTY(QString icon READ icon WRITE setIcon NOTIFY iconChanged)
Q_PROPERTY(QString source READ source WRITE setSource NOTIFY sourceChanged)
Q_PROPERTY(QString pluginName READ pluginName WRITE setPluginName NOTIFY pluginNameChanged)
public:
ConfigCategory(QObject *parent = 0);
~ConfigCategory();
QString name() const;
void setName(const QString &name);
QString icon() const;
void setIcon(const QString &icon);
QString source() const;
void setSource(const QString &source);
QString pluginName() const;
void setPluginName(const QString &pluginName);
Q_SIGNALS:
void nameChanged();
void iconChanged();
void sourceChanged();
void pluginNameChanged();
private:
QString m_name;
QString m_icon;
QString m_source;
QString m_pluginName;
};
#endif // multiple inclusion guard