From 57162f188df5877927e498f9d7ee31c3b3a721b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20K=C3=BCgler?= Date: Thu, 26 Feb 2009 00:11:41 +0000 Subject: [PATCH] Don't crash here. It does crash there for me when I click onto an applet's handle which has been added from another applet. I'm not sure why this happens. I've been running with this patch for a couple of days and didn't notice any sideeffects, besides plasma not crashing. svn path=/trunk/KDE/kdelibs/; revision=931935 --- private/applethandle.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/private/applethandle.cpp b/private/applethandle.cpp index 8ea8cace1..a63552997 100644 --- a/private/applethandle.cpp +++ b/private/applethandle.cpp @@ -474,7 +474,7 @@ void AppletHandle::mousePressEvent(QGraphicsSceneMouseEvent *event) } else { m_resizeStaticPoint = mapToScene(m_applet->geometry().bottomRight()); } - m_resizeGrabPoint = mapToScene(event->pos()); + m_resizeGrabPoint = mapToScene(event->pos()); QPointF cursorRelativeToStatic = m_resizeGrabPoint - m_resizeStaticPoint; // rotate @@ -487,9 +487,10 @@ void AppletHandle::mousePressEvent(QGraphicsSceneMouseEvent *event) //set mousePos to the position in the applet, in screencoords, so it becomes easy //to reposition the toplevel view to the correct position. - QPoint localpos = m_currentView->mapFromScene(m_applet->scenePos()); - m_mousePos = event->screenPos() - m_currentView->mapToGlobal(localpos); - + if (m_currentView && m_applet) { + QPoint localpos = m_currentView->mapFromScene(m_applet->scenePos()); + m_mousePos = event->screenPos() - m_currentView->mapToGlobal(localpos); + } return; }