From 85f7ded2b458d12aea74cc6bdd9b54a95e3cf169 Mon Sep 17 00:00:00 2001 From: "Aaron J. Seigo" Date: Sun, 27 Apr 2008 20:09:20 +0000 Subject: [PATCH] SVN_SILENT: get rid of some dead code; with all the api changing happening, no point in keeping stuff around that isn't compiled svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=801808 --- applet.cpp | 33 +++++---------------------------- 1 file changed, 5 insertions(+), 28 deletions(-) diff --git a/applet.cpp b/applet.cpp index 07e4e8eb6..6c6abd510 100644 --- a/applet.cpp +++ b/applet.cpp @@ -926,6 +926,9 @@ void Applet::flushPendingConstraintsEvents() if (c & Plasma::FormFactorConstraint) { FormFactor f = formFactor(); + //FIXME: this is a bit of a mess: calling setBackgroundHints twice, + // and moving an item to a non-vert/horiz containment that + // normally doesn't request a background would then get one! if (f == Planar) { setBackgroundHints(d->backgroundHints|ShadowedBackground); } else { @@ -937,34 +940,6 @@ void Applet::flushPendingConstraintsEvents() } else { setBackgroundHints(d->backgroundHints^StandardBackground); } - - /** - FIXME: what follows was an attempt to constrain the size of applets. it is, however, - broken for the following reasons: - - * it constrains to the size of an icon, when clearly this is not valid for - any non-single-icon applet - * it is far too pessimistic for horizontal constraints - - QSizeF newMax; - const QSizeF infSize(std::numeric_limits::infinity(), - std::numeric_limits::infinity()); - if (f == Plasma::Vertical && !(expandingDirections() & Qt::Vertical)) { - newMax = QSizeF(maximumContentSize().width(), IconSize(KIconLoader::Panel)); - } else if (f == Plasma::Horizontal && !(expandingDirections() & Qt::Horizontal)) { - newMax = QSizeF(IconSize(KIconLoader::Panel), maximumContentSize().height()); - } else if (maximumContentSize() != infSize) { - newMax = infSize; - } - - if (newMax.isValid()) { - setMaximumContentSize(newMax); - if (newMax.width() < contentSize().width() || - newMax.height() < contentSize().height()) { - updateGeometry(); - } - } - */ } Containment* containment = qobject_cast(this); @@ -1012,12 +987,14 @@ void Applet::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QW painter->setRenderHint(QPainter::SmoothPixmapTransform); painter->setRenderHint(QPainter::Antialiasing); } + if (d->background && formFactor() != Plasma::Vertical && formFactor() != Plasma::Horizontal) { //kDebug() << "option rect is" << option->rect; d->background->paintPanel(painter, option->rect, QPointF(0,0)); } + if (!d->failed) { if (widget && isContainment()) { // note that the widget we get is actually the viewport of the view, not the view itself