move configcategory in own file
This commit is contained in:
parent
819bece755
commit
c33282e37f
@ -2,6 +2,7 @@ project(PlasmaQuick)
|
|||||||
|
|
||||||
set(plasmaquick_LIB_SRC
|
set(plasmaquick_LIB_SRC
|
||||||
plasmaquickview.cpp
|
plasmaquickview.cpp
|
||||||
|
configcategory_p.cpp
|
||||||
configmodel.cpp
|
configmodel.cpp
|
||||||
configview.cpp
|
configview.cpp
|
||||||
containmentconfigview_p.cpp
|
containmentconfigview_p.cpp
|
||||||
|
115
src/plasmaquick/configcategory_p.cpp
Normal file
115
src/plasmaquick/configcategory_p.cpp
Normal file
@ -0,0 +1,115 @@
|
|||||||
|
/*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "configcategory_p.h"
|
||||||
|
#include "configview.h"
|
||||||
|
#include "configmodel.h"
|
||||||
|
#include "Plasma/Applet"
|
||||||
|
#include "Plasma/Containment"
|
||||||
|
//#include "plasmoid/wallpaperinterface.h"
|
||||||
|
#include "kdeclarative/configpropertymap.h"
|
||||||
|
|
||||||
|
#include <QDebug>
|
||||||
|
#include <QDir>
|
||||||
|
#include <QQmlComponent>
|
||||||
|
#include <QQmlEngine>
|
||||||
|
#include <QQmlContext>
|
||||||
|
#include <QQuickItem>
|
||||||
|
|
||||||
|
#include <KGlobal>
|
||||||
|
#include <KLocalizedString>
|
||||||
|
#include <kdeclarative/kdeclarative.h>
|
||||||
|
|
||||||
|
#include <Plasma/Corona>
|
||||||
|
#include <Plasma/PluginLoader>
|
||||||
|
|
||||||
|
///////////////////////ConfigCategory
|
||||||
|
|
||||||
|
ConfigCategory::ConfigCategory(QObject *parent)
|
||||||
|
: QObject(parent)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
ConfigCategory::~ConfigCategory()
|
||||||
|
{}
|
||||||
|
|
||||||
|
QString ConfigCategory::name() const
|
||||||
|
{
|
||||||
|
return m_name;
|
||||||
|
}
|
||||||
|
|
||||||
|
void ConfigCategory::setName(const QString &name)
|
||||||
|
{
|
||||||
|
if (m_name == name) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
m_name = name;
|
||||||
|
emit nameChanged();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
QString ConfigCategory::icon() const
|
||||||
|
{
|
||||||
|
return m_icon;
|
||||||
|
}
|
||||||
|
|
||||||
|
void ConfigCategory::setIcon(const QString &icon)
|
||||||
|
{
|
||||||
|
if (m_icon == icon) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
m_icon = icon;
|
||||||
|
emit iconChanged();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
QString ConfigCategory::source() const
|
||||||
|
{
|
||||||
|
return m_source;
|
||||||
|
}
|
||||||
|
|
||||||
|
void ConfigCategory::setSource(const QString &source)
|
||||||
|
{
|
||||||
|
if (m_source == source) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
m_source = source;
|
||||||
|
emit sourceChanged();
|
||||||
|
}
|
||||||
|
|
||||||
|
QString ConfigCategory::pluginName() const
|
||||||
|
{
|
||||||
|
return m_pluginName;
|
||||||
|
}
|
||||||
|
|
||||||
|
void ConfigCategory::setPluginName(const QString &name)
|
||||||
|
{
|
||||||
|
if (m_pluginName == name) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
m_pluginName = name;
|
||||||
|
emit pluginNameChanged();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#include "moc_configcategory_p.cpp"
|
@ -17,8 +17,8 @@
|
|||||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef CONFIGUILOADER_P_H
|
#ifndef CONFIGCATEGORY_P_H
|
||||||
#define CONFIGUILOADER_P_H
|
#define CONFIGCATEGORY_P_H
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
|
|
@ -17,7 +17,7 @@
|
|||||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "configview_p.h"
|
#include "configcategory_p.h"
|
||||||
#include "configview.h"
|
#include "configview.h"
|
||||||
#include "configmodel.h"
|
#include "configmodel.h"
|
||||||
#include "Plasma/Applet"
|
#include "Plasma/Applet"
|
||||||
@ -39,79 +39,6 @@
|
|||||||
#include <Plasma/Corona>
|
#include <Plasma/Corona>
|
||||||
#include <Plasma/PluginLoader>
|
#include <Plasma/PluginLoader>
|
||||||
|
|
||||||
///////////////////////ConfigCategory
|
|
||||||
|
|
||||||
ConfigCategory::ConfigCategory(QObject *parent)
|
|
||||||
: QObject(parent)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
ConfigCategory::~ConfigCategory()
|
|
||||||
{}
|
|
||||||
|
|
||||||
QString ConfigCategory::name() const
|
|
||||||
{
|
|
||||||
return m_name;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ConfigCategory::setName(const QString &name)
|
|
||||||
{
|
|
||||||
if (m_name == name) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
m_name = name;
|
|
||||||
emit nameChanged();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
QString ConfigCategory::icon() const
|
|
||||||
{
|
|
||||||
return m_icon;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ConfigCategory::setIcon(const QString &icon)
|
|
||||||
{
|
|
||||||
if (m_icon == icon) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
m_icon = icon;
|
|
||||||
emit iconChanged();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
QString ConfigCategory::source() const
|
|
||||||
{
|
|
||||||
return m_source;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ConfigCategory::setSource(const QString &source)
|
|
||||||
{
|
|
||||||
if (m_source == source) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
m_source = source;
|
|
||||||
emit sourceChanged();
|
|
||||||
}
|
|
||||||
|
|
||||||
QString ConfigCategory::pluginName() const
|
|
||||||
{
|
|
||||||
return m_pluginName;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ConfigCategory::setPluginName(const QString &name)
|
|
||||||
{
|
|
||||||
if (m_pluginName == name) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
m_pluginName = name;
|
|
||||||
emit pluginNameChanged();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//////////////////////////////ConfigModel
|
//////////////////////////////ConfigModel
|
||||||
|
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "configview_p.h"
|
#include "configcategory_p.h"
|
||||||
#include "configview.h"
|
#include "configview.h"
|
||||||
#include "configmodel.h"
|
#include "configmodel.h"
|
||||||
#include "Plasma/Applet"
|
#include "Plasma/Applet"
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
|
|
||||||
#include "currentcontainmentactionsmodel_p.h"
|
#include "currentcontainmentactionsmodel_p.h"
|
||||||
#include "containmentconfigview_p.h"
|
#include "containmentconfigview_p.h"
|
||||||
#include "configview_p.h"
|
#include "configcategory_p.h"
|
||||||
#include "configmodel.h"
|
#include "configmodel.h"
|
||||||
|
|
||||||
#include <kdeclarative/configpropertymap.h>
|
#include <kdeclarative/configpropertymap.h>
|
||||||
|
@ -32,7 +32,7 @@ class QAbstractItemModel;
|
|||||||
class ConfigPropertyMap;
|
class ConfigPropertyMap;
|
||||||
class CurrentContainmentActionsModel;
|
class CurrentContainmentActionsModel;
|
||||||
|
|
||||||
|
//TODO: out of the library?
|
||||||
class ContainmentConfigView : public ConfigView
|
class ContainmentConfigView : public ConfigView
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
@ -30,6 +30,7 @@ namespace Plasma {
|
|||||||
class ContainmentActions;
|
class ContainmentActions;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//TODO: out of the library?
|
||||||
class CurrentContainmentActionsModel : public QStandardItemModel
|
class CurrentContainmentActionsModel : public QStandardItemModel
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
Loading…
Reference in New Issue
Block a user