[kcmdeco] Adjust to kdecoration changes

There are no unstable classes any more.
This commit is contained in:
Martin Gräßlin 2013-10-01 08:01:10 +02:00
parent 8681c69d60
commit 56722972a7
2 changed files with 9 additions and 14 deletions

View file

@ -118,14 +118,12 @@ void KDecorationPreview::render(QPainter *painter, KDecoration *decoration, cons
int padLeft, padRight, padTop, padBottom; int padLeft, padRight, padTop, padBottom;
padLeft = padRight = padTop = padBottom = 0; padLeft = padRight = padTop = padBottom = 0;
bool useMask = true; bool useMask = true;
if (KDecorationUnstable *unstable = qobject_cast<KDecorationUnstable *>(decoration)) { decoration->padding(padLeft, padRight, padTop, padBottom);
unstable->padding(padLeft, padRight, padTop, padBottom);
size.setWidth(size.width() + padLeft + padRight); size.setWidth(size.width() + padLeft + padRight);
size.setHeight(size.height() + padTop + padBottom); size.setHeight(size.height() + padTop + padBottom);
if (padLeft || padRight || padTop || padBottom) { if (padLeft || padRight || padTop || padBottom) {
useMask = false; useMask = false;
} }
}
decoration->resize(size); decoration->resize(size);
// why an if-else block instead of (useMask ? mask : QRegion())? // why an if-else block instead of (useMask ? mask : QRegion())?
@ -479,11 +477,10 @@ KDecorationPreviewOptions::~KDecorationPreviewOptions()
{ {
} }
unsigned long KDecorationPreviewOptions::updateSettings() void KDecorationPreviewOptions::updateSettings()
{ {
KConfig cfg("kwinrc"); KConfig cfg("kwinrc");
unsigned long changed = 0; KDecorationOptions::updateSettings(&cfg);
changed |= KDecorationOptions::updateSettings(&cfg);
// set custom border size/buttons // set custom border size/buttons
if (customBorderSize != BordersCount) if (customBorderSize != BordersCount)
@ -499,8 +496,6 @@ unsigned long KDecorationPreviewOptions::updateSettings()
setTitleButtonsLeft(KDecorationOptions::defaultTitleButtonsLeft()); setTitleButtonsLeft(KDecorationOptions::defaultTitleButtonsLeft());
setTitleButtonsRight(KDecorationOptions::defaultTitleButtonsRight()); setTitleButtonsRight(KDecorationOptions::defaultTitleButtonsRight());
} }
return changed;
} }
void KDecorationPreviewOptions::setCustomBorderSize(BorderSize size) void KDecorationPreviewOptions::setCustomBorderSize(BorderSize size)

View file

@ -60,7 +60,7 @@ private:
}; };
class KDecorationPreviewBridge class KDecorationPreviewBridge
: public KDecorationBridgeUnstable : public KDecorationBridge
{ {
public: public:
KDecorationPreviewBridge(KDecorationPreview* preview, bool active); KDecorationPreviewBridge(KDecorationPreview* preview, bool active);
@ -139,7 +139,7 @@ class KDecorationPreviewOptions
public: public:
KDecorationPreviewOptions(); KDecorationPreviewOptions();
virtual ~KDecorationPreviewOptions(); virtual ~KDecorationPreviewOptions();
virtual unsigned long updateSettings(); void updateSettings();
void setCustomBorderSize(BorderSize size); void setCustomBorderSize(BorderSize size);
void setCustomTitleButtonsEnabled(bool enabled); void setCustomTitleButtonsEnabled(bool enabled);