From 94806e9e2be608f2022ad8937dfedd3836601698 Mon Sep 17 00:00:00 2001 From: Giorgos Tsiapaliokas Date: Mon, 2 Sep 2013 19:12:40 +0300 Subject: [PATCH] don't export ConfigCategory --- src/plasmaview/configview.cpp | 47 ++++++++----------------- src/plasmaview/configview.h | 64 +---------------------------------- src/plasmaview/configview_p.h | 62 +++++++++++++++++++++++++++++++++ 3 files changed, 77 insertions(+), 96 deletions(-) create mode 100644 src/plasmaview/configview_p.h diff --git a/src/plasmaview/configview.cpp b/src/plasmaview/configview.cpp index 075ac04f7..9e5fc7aa4 100644 --- a/src/plasmaview/configview.cpp +++ b/src/plasmaview/configview.cpp @@ -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(); } diff --git a/src/plasmaview/configview.h b/src/plasmaview/configview.h index 5e407fcae..1c589b500 100644 --- a/src/plasmaview/configview.h +++ b/src/plasmaview/configview.h @@ -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 { diff --git a/src/plasmaview/configview_p.h b/src/plasmaview/configview_p.h new file mode 100644 index 000000000..ed716abdc --- /dev/null +++ b/src/plasmaview/configview_p.h @@ -0,0 +1,62 @@ +/* + * 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 CONFIGUILOADER_P_H +#define CONFIGUILOADER_P_H + +#include + +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