From 4e07ced451734c3b9a7fb8d5fbd1478fe20bab6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Fri, 13 Jan 2012 10:11:45 +0100 Subject: [PATCH] Drop unused code --- clients/aurorae/src/aurorae.cpp | 1 - clients/aurorae/src/lib/auroraetheme.cpp | 78 ----------------------- clients/aurorae/src/lib/auroraetheme.h | 14 +--- kcmkwin/kwindecoration/kwindecoration.cpp | 1 + 4 files changed, 2 insertions(+), 92 deletions(-) diff --git a/clients/aurorae/src/aurorae.cpp b/clients/aurorae/src/aurorae.cpp index fef0febb8d..c4b446b773 100644 --- a/clients/aurorae/src/aurorae.cpp +++ b/clients/aurorae/src/aurorae.cpp @@ -56,7 +56,6 @@ void AuroraeFactory::init() m_theme->loadTheme(themeName, config); m_theme->setBorderSize((KDecorationDefines::BorderSize)themeGroup.readEntry("BorderSize", KDecorationDefines::BorderNormal)); m_theme->setButtonSize((KDecorationDefines::BorderSize)themeGroup.readEntry("ButtonSize", KDecorationDefines::BorderNormal)); - m_theme->setShowTooltips(options()->showTooltips()); m_theme->setTabDragMimeType(clientGroupItemDragMimeType()); // setup the QML engine foreach (const QString &importPath, KGlobal::dirs()->findDirs("module", "imports")) { diff --git a/clients/aurorae/src/lib/auroraetheme.cpp b/clients/aurorae/src/lib/auroraetheme.cpp index d9365c37b8..bc1d5d710f 100644 --- a/clients/aurorae/src/lib/auroraetheme.cpp +++ b/clients/aurorae/src/lib/auroraetheme.cpp @@ -40,13 +40,11 @@ public: AuroraeThemePrivate(); ~AuroraeThemePrivate(); void initButtonFrame(AuroraeButtonType type); - void reset(); QString themeName; Aurorae::ThemeConfig themeConfig; QHash< AuroraeButtonType, QString > pathes; bool activeCompositing; KDecorationDefines::BorderSize borderSize; - bool showTooltips; KDecorationDefines::BorderSize buttonSize; QString dragMimeType; QString decorationPath; @@ -55,7 +53,6 @@ public: AuroraeThemePrivate::AuroraeThemePrivate() :activeCompositing(true) , borderSize(KDecoration::BorderNormal) - , showTooltips(true) , buttonSize(KDecoration::BorderNormal) { } @@ -80,10 +77,6 @@ void AuroraeThemePrivate::initButtonFrame(AuroraeButtonType type) } } -void AuroraeThemePrivate::reset() -{ -} - /************************************************ * AuroraeTheme ************************************************/ @@ -115,10 +108,6 @@ void AuroraeTheme::loadTheme(const QString &name) void AuroraeTheme::loadTheme(const QString &name, const KConfig &config) { - if (!d->themeName.isNull()) { - // only reset if the theme has been initialized at least once - d->reset(); - } d->themeName = name; QString file("aurorae/themes/" + d->themeName + "/decoration.svg"); QString path = KGlobal::dirs()->findResource("data", file); @@ -148,13 +137,6 @@ void AuroraeTheme::loadTheme(const QString &name, const KConfig &config) emit themeChanged(); } -void AuroraeTheme::readThemeConfig(const KConfig &config) -{ - // read config values - d->themeConfig.load(config); - emit themeChanged(); -} - bool AuroraeTheme::hasButton(AuroraeButtonType button) const { return d->pathes.contains(button); @@ -188,52 +170,10 @@ QLatin1String AuroraeTheme::mapButtonToName(AuroraeButtonType type) } } -char AuroraeTheme::mapButtonToChar(AuroraeButtonType type) -{ - char c = ' '; - switch (type) { - case Aurorae::MinimizeButton: - c = 'I'; - break; - case Aurorae::MaximizeButton: // fall through - case Aurorae::RestoreButton: - c = 'A'; - break; - case Aurorae::CloseButton: - c = 'X'; - break; - case Aurorae::AllDesktopsButton: - c = 'S'; - break; - case Aurorae::KeepAboveButton: - c = 'F'; - break; - case Aurorae::KeepBelowButton: - c = 'B'; - break; - case Aurorae::ShadeButton: - c = 'L'; - break; - case Aurorae::HelpButton: - c = 'H'; - break; - case Aurorae::MenuButton: - c = 'M'; - break; - default: - break; // nothing - } - return c; -} - const QString &AuroraeTheme::themeName() const { return d->themeName; } -const Aurorae::ThemeConfig &AuroraeTheme::themeConfig() const -{ - return d->themeConfig; -} void AuroraeTheme::borders(int& left, int& top, int& right, int& bottom, bool maximized) const { @@ -493,13 +433,6 @@ void AuroraeTheme::titleEdges(int &left, int &top, int &right, int &bottom, bool } } -void AuroraeTheme::buttonMargins(int &left, int &top, int &right) const -{ - left = d->themeConfig.titleBorderLeft(); - top = d->themeConfig.buttonMarginTop(); - right = d->themeConfig.titleBorderRight(); -} - bool AuroraeTheme::isCompositingActive() const { return d->activeCompositing; @@ -525,17 +458,6 @@ void AuroraeTheme::setBorderSize(KDecorationDefines::BorderSize size) d->borderSize = size; } -bool AuroraeTheme::isShowTooltips() const -{ - return d->showTooltips; -} - -void AuroraeTheme::setShowTooltips(bool show) -{ - d->showTooltips = show; - emit showTooltipsChanged(show); -} - void AuroraeTheme::setButtonSize(KDecorationDefines::BorderSize size) { d->buttonSize = size; diff --git a/clients/aurorae/src/lib/auroraetheme.h b/clients/aurorae/src/lib/auroraetheme.h index 7e3da1c5e9..df7de79b06 100644 --- a/clients/aurorae/src/lib/auroraetheme.h +++ b/clients/aurorae/src/lib/auroraetheme.h @@ -24,7 +24,6 @@ // #include "libaurorae_export.h" #include -#include #include class KConfig; @@ -34,7 +33,7 @@ class AuroraeThemePrivate; class ThemeConfig; enum AuroraeButtonType { - MinimizeButton = QGraphicsItem::UserType+1, + MinimizeButton = 0, MaximizeButton, RestoreButton, CloseButton, @@ -114,7 +113,6 @@ public: // TODO: KSharedConfigPtr void loadTheme(const QString &name, const KConfig &config); bool isValid() const; - void readThemeConfig(const KConfig& config); const QString &themeName() const; int leftBorder() const; int rightBorder() const; @@ -171,11 +169,6 @@ public: * Title edges are global to all windows. */ void titleEdges(int &left, int &top, int &right, int &bottom, bool maximized) const; - /** - * Sets the button margins. - * Button margins are global to all windows. There is no button margin bottom. - */ - void buttonMargins(int& left, int& top, int& right) const; void setCompositingActive(bool active); bool isCompositingActive() const; @@ -186,7 +179,6 @@ public: QString defaultButtonsLeft() const; QString defaultButtonsRight() const; void setBorderSize(KDecorationDefines::BorderSize size); - bool isShowTooltips() const; /** * Sets the size of the buttons. * The available sizes are identical to border sizes, therefore BorderSize is used. @@ -202,19 +194,15 @@ public: // TODO: move to namespace static QLatin1String mapButtonToName(AuroraeButtonType type); - static char mapButtonToChar(AuroraeButtonType type); public Q_SLOTS: - void setShowTooltips(bool show); void loadTheme(const QString &name); Q_SIGNALS: void themeChanged(); - void showTooltipsChanged(bool show); void buttonSizesChanged(); private: - const ThemeConfig &themeConfig() const; /** * Sets the borders according to maximized state. * Borders are global to all windows. diff --git a/kcmkwin/kwindecoration/kwindecoration.cpp b/kcmkwin/kwindecoration/kwindecoration.cpp index fe6fce6f41..c18ec293d8 100644 --- a/kcmkwin/kwindecoration/kwindecoration.cpp +++ b/kcmkwin/kwindecoration/kwindecoration.cpp @@ -39,6 +39,7 @@ #include #include #include +#include // KDE #include #include