Commit 1b857f92 authored by Cyril Rossi's avatar Cyril Rossi
Browse files

KCM LookAndFeel : Remove unused Q_PROPERTIES, getter const, internal method...

KCM LookAndFeel : Remove unused Q_PROPERTIES, getter const, internal method private, typo in enum declaration

Summary: Clean up before moving LnF KCM to KConfigXT

Test Plan: Compile

Reviewers: #plasma, ervin, mart, bport

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D24819
parent fd1f77d5
......@@ -26,20 +26,16 @@
#include <KAboutData>
#include <KSharedConfig>
#include <QDebug>
#include <QStandardPaths>
#include <QProcess>
#include <QQuickWidget>
#include <QQuickView>
#include <KGlobalSettings>
#include <KIconLoader>
#include <KAutostart>
#include <KRun>
#include <QQmlEngine>
#include <QQmlContext>
#include <QDebug>
#include <QQuickItem>
#include <QQuickWindow>
#include <QStandardPaths>
#include <QProcess>
#include <QStandardItemModel>
#include <QX11Info>
......@@ -79,7 +75,7 @@ KCMLookandFeel::KCMLookandFeel(QObject* parent, const QVariantList& args)
QHash<int, QByteArray> roles = m_model->roleNames();
roles[PluginNameRole] = "pluginName";
roles[DescriptionRole] = "description";
roles[ScreenhotRole] = "screenshot";
roles[ScreenshotRole] = "screenshot";
roles[FullScreenPreviewRole] = "fullScreenPreview";
roles[HasSplashRole] = "hasSplash";
roles[HasLockScreenRole] = "hasLockScreen";
......@@ -118,7 +114,7 @@ void KCMLookandFeel::getNewStuff(QQuickItem *ctx)
m_newStuffDialog.data()->show();
}
QStandardItemModel *KCMLookandFeel::lookAndFeelModel()
QStandardItemModel *KCMLookandFeel::lookAndFeelModel() const
{
return m_model;
}
......@@ -197,7 +193,7 @@ void KCMLookandFeel::loadModel()
QStandardItem* row = new QStandardItem(pkg.metadata().name());
row->setData(pkg.metadata().pluginName(), PluginNameRole);
row->setData(pkg.metadata().comment(), DescriptionRole);
row->setData(pkg.filePath("preview"), ScreenhotRole);
row->setData(pkg.filePath("preview"), ScreenshotRole);
row->setData(pkg.filePath("fullscreenpreview"), FullScreenPreviewRole);
//What the package provides
......@@ -724,94 +720,6 @@ void KCMLookandFeel::setWindowDecoration(const QString &library, const QString &
QDBusConnection::sessionBus().send(message);
}
void KCMLookandFeel::setApplyColors(bool apply)
{
if (m_applyColors == apply) {
return;
}
m_applyColors = apply;
emit applyColorsChanged();
}
bool KCMLookandFeel::applyColors() const
{
return m_applyColors;
}
void KCMLookandFeel::setApplyWidgetStyle(bool apply)
{
if (m_applyWidgetStyle == apply) {
return;
}
m_applyWidgetStyle = apply;
emit applyWidgetStyleChanged();
}
bool KCMLookandFeel::applyWidgetStyle() const
{
return m_applyWidgetStyle;
}
void KCMLookandFeel::setApplyIcons(bool apply)
{
if (m_applyIcons == apply) {
return;
}
m_applyIcons = apply;
emit applyIconsChanged();
}
bool KCMLookandFeel::applyIcons() const
{
return m_applyIcons;
}
void KCMLookandFeel::setApplyPlasmaTheme(bool apply)
{
if (m_applyPlasmaTheme == apply) {
return;
}
m_applyPlasmaTheme = apply;
emit applyPlasmaThemeChanged();
}
bool KCMLookandFeel::applyPlasmaTheme() const
{
return m_applyPlasmaTheme;
}
void KCMLookandFeel::setApplyWindowSwitcher(bool apply)
{
if (m_applyWindowSwitcher == apply) {
return;
}
m_applyWindowSwitcher = apply;
emit applyWindowSwitcherChanged();
}
bool KCMLookandFeel::applyWindowSwitcher() const
{
return m_applyWindowSwitcher;
}
void KCMLookandFeel::setApplyDesktopSwitcher(bool apply)
{
if (m_applyDesktopSwitcher == apply) {
return;
}
m_applyDesktopSwitcher = apply;
emit applyDesktopSwitcherChanged();
}
bool KCMLookandFeel::applyDesktopSwitcher() const
{
return m_applyDesktopSwitcher;
}
void KCMLookandFeel::setResetDefaultLayout(bool reset)
{
if (m_resetDefaultLayout == reset) {
......
......@@ -22,7 +22,6 @@
#include <KConfig>
#include <KConfigGroup>
#include <QListWidget>
#include <QDir>
#include <KNewStuff3/KNS3/DownloadDialog>
......@@ -39,19 +38,12 @@ class KCMLookandFeel : public KQuickAddons::ConfigModule
Q_PROPERTY(QStandardItemModel *lookAndFeelModel READ lookAndFeelModel CONSTANT)
Q_PROPERTY(QString selectedPlugin READ selectedPlugin WRITE setSelectedPlugin NOTIFY selectedPluginChanged)
Q_PROPERTY(int selectedPluginIndex READ selectedPluginIndex NOTIFY selectedPluginIndexChanged)
Q_PROPERTY(bool applyColors READ applyColors WRITE setApplyColors NOTIFY applyColorsChanged)
Q_PROPERTY(bool applyWidgetStyle READ applyWidgetStyle WRITE setApplyWidgetStyle NOTIFY applyWidgetStyleChanged)
Q_PROPERTY(bool applyIcons READ applyIcons WRITE setApplyIcons NOTIFY applyIconsChanged)
Q_PROPERTY(bool applyPlasmaTheme READ applyPlasmaTheme WRITE setApplyPlasmaTheme NOTIFY applyPlasmaThemeChanged)
Q_PROPERTY(bool applyWindowSwitcher READ applyWindowSwitcher WRITE setApplyWindowSwitcher NOTIFY applyWindowSwitcherChanged)
Q_PROPERTY(bool applyDesktopSwitcher READ applyDesktopSwitcher WRITE setApplyDesktopSwitcher NOTIFY applyDesktopSwitcherChanged)
Q_PROPERTY(bool resetDefaultLayout READ resetDefaultLayout WRITE setResetDefaultLayout NOTIFY resetDefaultLayoutChanged)
public:
enum Roles {
PluginNameRole = Qt::UserRole +1,
ScreenhotRole,
ScreenshotRole,
FullScreenPreviewRole,
DescriptionRole,
HasSplashRole,
......@@ -66,19 +58,23 @@ public:
HasWindowSwitcherRole,
HasDesktopSwitcherRole
};
KCMLookandFeel(QObject* parent, const QVariantList& args);
~KCMLookandFeel() override;
//List only packages which provide at least one of the components
QList<Plasma::Package> availablePackages(const QStringList &components);
QStandardItemModel *lookAndFeelModel();
QStandardItemModel *lookAndFeelModel() const;
QString selectedPlugin() const;
void setSelectedPlugin(const QString &plugin);
int selectedPluginIndex() const;
bool resetDefaultLayout() const;
void setResetDefaultLayout(bool reset);
//Setters of the various theme pieces
void setWidgetStyle(const QString &style);
void setColors(const QString &scheme, const QString &colorFile);
......@@ -91,23 +87,6 @@ public:
void setDesktopSwitcher(const QString &theme);
void setWindowDecoration(const QString &library, const QString &theme);
void setApplyColors(bool apply);
bool applyColors() const;
void setApplyWidgetStyle(bool apply);
bool applyWidgetStyle() const;
void setApplyIcons(bool apply);
bool applyIcons() const;
void setApplyPlasmaTheme(bool apply);
bool applyPlasmaTheme() const;
void setApplyWindowSwitcher(bool apply);
bool applyWindowSwitcher() const;
void setApplyDesktopSwitcher(bool apply);
bool applyDesktopSwitcher() const;
bool resetDefaultLayout() const;
void setResetDefaultLayout(bool reset);
void loadModel();
Q_INVOKABLE void getNewStuff(QQuickItem *ctx);
public Q_SLOTS:
......@@ -117,17 +96,11 @@ public Q_SLOTS:
Q_SIGNALS:
void selectedPluginChanged();
void applyColorsChanged();
void applyWidgetStyleChanged();
void applyIconsChanged();
void applyPlasmaThemeChanged();
void applyWindowSwitcherChanged();
void applyDesktopSwitcherChanged();
void resetDefaultLayoutChanged();
void selectedPluginIndexChanged();
void resetDefaultLayoutChanged();
private:
void loadModel();
QDir cursorThemeDir(const QString &theme, const int depth);
const QStringList cursorSearchPaths();
QStandardItemModel *m_model;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment