be safe (view can be null!) and don't call view() repeatedly as it requires tromping through all the views. not a killer in most situations, but nice to avoide unecessary work
svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=874045
This commit is contained in:
parent
e5c19dde50
commit
1dc982c466
@ -433,6 +433,12 @@ void PopupAppletPrivate::dialogStatusChanged(bool status)
|
|||||||
|
|
||||||
void PopupAppletPrivate::updateDialogPosition()
|
void PopupAppletPrivate::updateDialogPosition()
|
||||||
{
|
{
|
||||||
|
QGraphicsView *view = q->view();
|
||||||
|
|
||||||
|
if (!view) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
KConfigGroup sizeGroup = q->config();
|
KConfigGroup sizeGroup = q->config();
|
||||||
sizeGroup = KConfigGroup(&sizeGroup, "PopupApplet");
|
sizeGroup = KConfigGroup(&sizeGroup, "PopupApplet");
|
||||||
const int width = qMin(sizeGroup.readEntry("DialogWidth", 0),
|
const int width = qMin(sizeGroup.readEntry("DialogWidth", 0),
|
||||||
@ -450,8 +456,8 @@ void PopupAppletPrivate::updateDialogPosition()
|
|||||||
}
|
}
|
||||||
|
|
||||||
QSize s = dialog->size();
|
QSize s = dialog->size();
|
||||||
QPoint pos = q->view()->mapFromScene(q->scenePos());
|
QPoint pos = view->mapFromScene(q->scenePos());
|
||||||
pos = q->view()->mapToGlobal(pos);
|
pos = view->mapToGlobal(pos);
|
||||||
|
|
||||||
switch (q->location()) {
|
switch (q->location()) {
|
||||||
case BottomEdge:
|
case BottomEdge:
|
||||||
|
Loading…
Reference in New Issue
Block a user