Drop unused code
This commit is contained in:
parent
0df0266602
commit
4e07ced451
4 changed files with 2 additions and 92 deletions
|
@ -56,7 +56,6 @@ void AuroraeFactory::init()
|
|||
m_theme->loadTheme(themeName, config);
|
||||
m_theme->setBorderSize((KDecorationDefines::BorderSize)themeGroup.readEntry<int>("BorderSize", KDecorationDefines::BorderNormal));
|
||||
m_theme->setButtonSize((KDecorationDefines::BorderSize)themeGroup.readEntry<int>("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")) {
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -24,7 +24,6 @@
|
|||
// #include "libaurorae_export.h"
|
||||
|
||||
#include <QtCore/QObject>
|
||||
#include <QtGui/QGraphicsItem>
|
||||
#include <kdecoration.h>
|
||||
|
||||
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.
|
||||
|
|
|
@ -39,6 +39,7 @@
|
|||
#include <QtDeclarative/QDeclarativeEngine>
|
||||
#include <QtDeclarative/QDeclarativeView>
|
||||
#include <QtGui/QSortFilterProxyModel>
|
||||
#include <QtGui/QGraphicsObject>
|
||||
// KDE
|
||||
#include <KAboutData>
|
||||
#include <KDialog>
|
||||
|
|
Loading…
Reference in a new issue