From 6297027cba37f100f4d3bd134a5b265c5605a0f5 Mon Sep 17 00:00:00 2001 From: "Aaron J. Seigo" Date: Sat, 12 Sep 2009 00:18:57 +0000 Subject: [PATCH] harmonize this code a bit svn path=/trunk/KDE/kdelibs/; revision=1022541 --- popupapplet.cpp | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/popupapplet.cpp b/popupapplet.cpp index 000ce534d..d4d7c6d45 100644 --- a/popupapplet.cpp +++ b/popupapplet.cpp @@ -623,8 +623,8 @@ void PopupAppletPrivate::updateDialogPosition() KConfigGroup *mainGroup = static_cast(q)->d->mainConfigGroup(); KConfigGroup sizeGroup(mainGroup, "PopupApplet"); - Q_ASSERT(q->containment()); - Q_ASSERT(q->containment()->corona()); + Corona *corona = qobject_cast(q->scene()); + Q_ASSERT(corona); int preferredWidth = 0; int preferredHeight = 0; @@ -634,9 +634,9 @@ void PopupAppletPrivate::updateDialogPosition() } const int width = qMin(sizeGroup.readEntry("DialogWidth", preferredWidth), - q->containment()->corona()->screenGeometry(-1).width() - 50); + corona->screenGeometry(-1).width() - 50); const int height = qMin(sizeGroup.readEntry("DialogHeight", preferredHeight), - q->containment()->corona()->screenGeometry(-1).height() - 50); + corona->screenGeometry(-1).height() - 50); QSize saved(width, height); @@ -653,11 +653,7 @@ void PopupAppletPrivate::updateDialogPosition() QSize s = dialog->size(); QPoint pos = view->mapFromScene(q->scenePos()); - //try to access a corona - Corona *corona = qobject_cast(q->scene()); - if (corona) { - pos = corona->popupPosition(q, s); - } + pos = corona->popupPosition(q, s); bool reverse = false; if (q->formFactor() == Plasma::Vertical) {