From d86b233464bae539553f5da3b1f7a8117743cd7f Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Fri, 21 Sep 2012 14:23:41 +0200 Subject: [PATCH] avoid potential infinite recursions --- declarativeimports/plasmacomponents/qmenu.cpp | 20 ++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/declarativeimports/plasmacomponents/qmenu.cpp b/declarativeimports/plasmacomponents/qmenu.cpp index e2c90293d..e91c365e4 100644 --- a/declarativeimports/plasmacomponents/qmenu.cpp +++ b/declarativeimports/plasmacomponents/qmenu.cpp @@ -175,14 +175,18 @@ void QMenuProxy::open(int x, int y) } if (!parentItem || !parentItem->scene()) { - open(0, 0); + m_menu->popup(QPoint(0, 0)); + m_status = DialogStatus::Open; + emit statusChanged(); return; } QList views = parentItem->scene()->views(); if (views.size() < 1) { - open(0, 0); + m_menu->popup(QPoint(0, 0)); + m_status = DialogStatus::Open; + emit statusChanged(); return; } @@ -233,14 +237,18 @@ void QMenuProxy::open() } if (!parentItem || !parentItem->scene()) { - open(0, 0); + m_menu->popup(QPoint(0, 0)); + m_status = DialogStatus::Open; + emit statusChanged(); return; } QList views = parentItem->scene()->views(); if (views.size() < 1) { - open(0, 0); + m_menu->popup(QPoint(0, 0)); + m_status = DialogStatus::Open; + emit statusChanged(); return; } @@ -264,7 +272,9 @@ void QMenuProxy::open() } if (!view) { - open(0, 0); + m_menu->popup(QPoint(0, 0)); + m_status = DialogStatus::Open; + emit statusChanged(); return; }