diff options
author | Jörgen Scheibengruber <jorgen.scheibengruber@nokia.com> | 2010-08-11 13:55:15 +0300 |
---|---|---|
committer | Jörgen Scheibengruber <jorgen.scheibengruber@nokia.com> | 2010-08-11 14:15:51 +0300 |
commit | 75478b8adde5b43835c14afdb66199a924396b6b (patch) | |
tree | cbb13f2c7e12096c0fe3fc18185e7e3702bd3c63 | |
parent | 0b35682a2191de5bac7f121c890e6fd042477f26 (diff) |
Revert "Fixes: NB#182427, Adding an action to an AppPage and then setting its widgets causes a crash"
This reverts commit ed2e3fe1b50725228de1b96915a3e5acfcd25ab6.
Details: This introduced NB#184199
-rw-r--r-- | src/views/mapplicationmenuview.cpp | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/src/views/mapplicationmenuview.cpp b/src/views/mapplicationmenuview.cpp index bad6d84d..a304fc0e 100644 --- a/src/views/mapplicationmenuview.cpp +++ b/src/views/mapplicationmenuview.cpp @@ -207,26 +207,28 @@ void MApplicationMenuViewPrivate::addActions() MWidget *MApplicationMenuViewPrivate::createWidget(QAction *action) { - MWidget * widget = getWidget(action); - widget = widget ? widget : requestWidget(qobject_cast<MAction *>(action)); - // If widget is not already created then create it + MWidget *widget = buttons.value(action); if (!widget) { - widget = createButton(action); - buttons.insert(action,widget); + widget = leasedWidgets.value(action); } - else { - MComboBox *comboBox = qobject_cast<MComboBox *>(widget); - if (comboBox) { - connect(comboBox, SIGNAL(clicked()), action, SIGNAL(triggered())); + if (!widget) { + MWidgetAction *widgetAction = qobject_cast<MWidgetAction *>(action); + if (widgetAction) { + widget = requestWidget(widgetAction); + MComboBox *comboBox = qobject_cast<MComboBox *>(widget); + if (comboBox) { + connect(comboBox, SIGNAL(clicked()), widgetAction, SIGNAL(triggered())); + } + leasedWidgets.insert(action, widget); + } else { + widget = createButton(action); + buttons.insert(action, widget); } - leasedWidgets.insert(action, widget); } - connect(action, SIGNAL(triggered()), controller, SLOT(disappear())); widget->setVisible(true); widget->setEnabled(action->isEnabled()); - return widget; } |