Cleanup color scheme manager part of KCM Deco code
Summary: PreviewCient is internal to the KCM, it's not used by actual decorations where we need API compatibility. This property is not used by the KCM. The current code parses every color scheme config file for every decoration. This is one of the big contributing factors to this KCM being a bit sluggish. It was effectively deprecated in 2015 when a decoration palette was introduced. If we wanted to add colorscheme functionality in the KCM, we'd use that instead at a previewclient level. Test Plan: Found this was a problem with hotspot Grepped code for usage Ran KCM Reviewers: #plasma Subscribers: plasma-devel, kwin, #kwin Tags: #kwin Differential Revision: https://phabricator.kde.org/D9239
This commit is contained in:
parent
06a9a2a468
commit
1d3d4b1013
2 changed files with 0 additions and 34 deletions
|
@ -21,9 +21,6 @@
|
|||
#include <KDecoration2/Decoration>
|
||||
#include <KDecoration2/DecoratedClient>
|
||||
|
||||
#include <KColorScheme>
|
||||
#include <KColorSchemeManager>
|
||||
|
||||
#include <QDebug>
|
||||
#include <QCoreApplication>
|
||||
#include <QEvent>
|
||||
|
@ -37,8 +34,6 @@ namespace Preview
|
|||
PreviewClient::PreviewClient(DecoratedClient *c, Decoration *decoration)
|
||||
: QObject(decoration)
|
||||
, ApplicationMenuEnabledDecoratedClientPrivate(c, decoration)
|
||||
, m_colorSchemeManager(new KColorSchemeManager(this))
|
||||
, m_colorSchemeIndex(0)
|
||||
, m_icon(QIcon::fromTheme(QStringLiteral("start-here-kde")))
|
||||
, m_iconName(m_icon.name())
|
||||
, m_palette(QStringLiteral("kdeglobals"))
|
||||
|
@ -272,25 +267,6 @@ QColor PreviewClient::color(ColorGroup group, ColorRole role) const
|
|||
return m_palette.color(group, role);
|
||||
}
|
||||
|
||||
QAbstractItemModel *PreviewClient::colorSchemeModel() const
|
||||
{
|
||||
return m_colorSchemeManager->model();
|
||||
}
|
||||
|
||||
int PreviewClient::colorSchemeIndex() const
|
||||
{
|
||||
return m_colorSchemeIndex;
|
||||
}
|
||||
|
||||
void PreviewClient::setColorSchemeIndex(int index)
|
||||
{
|
||||
if (m_colorSchemeIndex == index) {
|
||||
return;
|
||||
}
|
||||
m_colorSchemeIndex = index;
|
||||
emit colorSchemeIndexChanged(m_colorSchemeIndex);
|
||||
}
|
||||
|
||||
Qt::Edges PreviewClient::adjacentScreenEdges() const
|
||||
{
|
||||
Qt::Edges edges;
|
||||
|
|
|
@ -26,7 +26,6 @@
|
|||
#include <QObject>
|
||||
#include <QPalette>
|
||||
|
||||
class KColorSchemeManager;
|
||||
class QAbstractItemModel;
|
||||
|
||||
namespace KDecoration2
|
||||
|
@ -40,8 +39,6 @@ class PreviewClient : public QObject, public ApplicationMenuEnabledDecoratedClie
|
|||
Q_PROPERTY(QString caption READ caption WRITE setCaption NOTIFY captionChanged)
|
||||
Q_PROPERTY(QIcon icon READ icon WRITE setIcon NOTIFY iconChanged)
|
||||
Q_PROPERTY(QString iconName READ iconName WRITE setIconName NOTIFY iconNameChanged)
|
||||
Q_PROPERTY(QAbstractItemModel *colorSchemeModel READ colorSchemeModel CONSTANT)
|
||||
Q_PROPERTY(int colorSchemeIndex READ colorSchemeIndex WRITE setColorSchemeIndex NOTIFY colorSchemeIndexChanged)
|
||||
Q_PROPERTY(bool active READ isActive WRITE setActive NOTIFY activeChanged)
|
||||
Q_PROPERTY(bool closeable READ isCloseable WRITE setCloseable NOTIFY closeableChanged)
|
||||
Q_PROPERTY(bool keepAbove READ isKeepAbove WRITE setKeepAbove NOTIFY keepAboveChanged)
|
||||
|
@ -137,10 +134,6 @@ public:
|
|||
void setIconName(const QString &icon);
|
||||
void setIcon(const QIcon &icon);
|
||||
|
||||
QAbstractItemModel *colorSchemeModel() const;
|
||||
int colorSchemeIndex() const;
|
||||
void setColorSchemeIndex(int index);
|
||||
|
||||
bool bordersTopEdge() const;
|
||||
bool bordersLeftEdge() const;
|
||||
bool bordersRightEdge() const;
|
||||
|
@ -174,7 +167,6 @@ Q_SIGNALS:
|
|||
void desktopChanged(int);
|
||||
void widthChanged(int);
|
||||
void heightChanged(int);
|
||||
void colorSchemeIndexChanged(int);
|
||||
void paletteChanged(const QPalette&);
|
||||
void bordersTopEdgeChanged(bool);
|
||||
void bordersLeftEdgeChanged(bool);
|
||||
|
@ -187,8 +179,6 @@ Q_SIGNALS:
|
|||
void closeRequested();
|
||||
|
||||
private:
|
||||
KColorSchemeManager *m_colorSchemeManager;
|
||||
int m_colorSchemeIndex;
|
||||
QString m_caption;
|
||||
QIcon m_icon;
|
||||
QString m_iconName;
|
||||
|
|
Loading…
Reference in a new issue