diff options
author | Janne Koskinen <janne.p.koskinen@digia.com> | 2009-05-11 12:16:25 (GMT) |
---|---|---|
committer | Janne Koskinen <janne.p.koskinen@digia.com> | 2009-05-11 12:16:25 (GMT) |
commit | f005af3b8c8405219b39bacd348d3861f1243aa8 (patch) | |
tree | a2d1f332de493d3d2cf0e0d1b3ad7c062176fe39 /src/gui/widgets/qmenu_symbian.cpp | |
parent | 8aaa0cbf3451dee7bc8e8276faad3b2f2954dc1c (diff) | |
parent | 565f2957fb049f2df0330fac72ec5335860b9c7f (diff) | |
download | Qt-f005af3b8c8405219b39bacd348d3861f1243aa8.zip Qt-f005af3b8c8405219b39bacd348d3861f1243aa8.tar.gz Qt-f005af3b8c8405219b39bacd348d3861f1243aa8.tar.bz2 |
Merge branch 'master' of git@scm.dev.nokia.troll.no:qt/qt-s60-public
Conflicts:
src/gui/widgets/qmenu_symbian.cpp
Diffstat (limited to 'src/gui/widgets/qmenu_symbian.cpp')
-rw-r--r-- | src/gui/widgets/qmenu_symbian.cpp | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/src/gui/widgets/qmenu_symbian.cpp b/src/gui/widgets/qmenu_symbian.cpp index 37c5fdb..47154e8 100644 --- a/src/gui/widgets/qmenu_symbian.cpp +++ b/src/gui/widgets/qmenu_symbian.cpp @@ -33,7 +33,7 @@ QT_BEGIN_NAMESPACE // ### FIX/Document this, we need some safe range of menu id's for Qt that don't clash with AIW ones #define QT_FIRST_MENU_ITEM 32000 -static QMenuBarPrivate *s60_menubar=0; +static QList<QMenuBarPrivate *> s60_menubars; struct SymbianMenuItem { @@ -167,7 +167,7 @@ static void setSoftkeys() { CEikButtonGroupContainer* cba = CEikonEnv::Static()->AppUiFactory()->Cba(); if (cba){ - if (s60_menubar) + if (s60_menubars.count()>0) cba->SetCommandSetL(R_AVKON_SOFTKEYS_OPTIONS_EXIT); else cba->SetCommandSetL(R_AVKON_SOFTKEYS_EXIT); @@ -178,11 +178,11 @@ static void rebuildMenu() { qt_symbian_menu_static_cmd_id = QT_FIRST_MENU_ITEM; deleteAll( &symbianMenus ); - if (!s60_menubar) + if (s60_menubars.count()==0) return; - for (int i = 0; i < s60_menubar->actions.size(); ++i) { + for (int i = 0; i < s60_menubars.last()->actions.size(); ++i) { QSymbianMenuAction *symbianActionTopLevel = new QSymbianMenuAction; - symbianActionTopLevel->action = s60_menubar->actions.at(i); + symbianActionTopLevel->action = s60_menubars.last()->actions.at(i); symbianActionTopLevel->parent = 0; symbianActionTopLevel->command = qt_symbian_menu_static_cmd_id++; qt_symbian_insert_action(symbianActionTopLevel, &symbianMenus); @@ -193,7 +193,7 @@ static void rebuildMenu() Q_GUI_EXPORT void qt_symbian_show_toplevel( CEikMenuPane* menuPane) { - if (!s60_menubar) + if (s60_menubars.count()==0) return; rebuildMenu(); for (int i = 0; i < symbianMenus.count(); ++i) @@ -261,15 +261,17 @@ void QMenuBarPrivate::symbianDestroyMenuBar() Q_Q(QMenuBar); int index = nativeMenuBars.indexOf(q); nativeMenuBars.removeAt(index); + s60_menubars.removeLast(); + rebuildMenu(); if (symbian_menubar) - delete symbian_menubar; + delete symbian_menubar; symbian_menubar = 0; } QMenuBarPrivate::QSymbianMenuBarPrivate::QSymbianMenuBarPrivate(QMenuBarPrivate *menubar) { d = menubar; - s60_menubar = menubar; + s60_menubars.append(menubar); } QMenuBarPrivate::QSymbianMenuBarPrivate::~QSymbianMenuBarPrivate() @@ -277,7 +279,7 @@ QMenuBarPrivate::QSymbianMenuBarPrivate::~QSymbianMenuBarPrivate() deleteAll( &symbianMenus ); symbianMenus.clear(); d = 0; - s60_menubar = 0; + rebuild(); } QMenuPrivate::QSymbianMenuPrivate::QSymbianMenuPrivate() @@ -362,7 +364,7 @@ void QMenuBarPrivate::QSymbianMenuBarPrivate::removeAction(QSymbianMenuAction *a void QMenuBarPrivate::QSymbianMenuBarPrivate::rebuild() { setSoftkeys(); - if (!s60_menubar) + if (s60_menubars.count()==0) return; rebuildMenu(); |