From 9877c2b3b4b9bb8afaac9b207917ccdd866ad1d3 Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Tue, 2 Jun 2009 20:28:48 +0200 Subject: Since now, S60 commands are handled by QApplication::s60HandleCommandL inside QtGui, we do not need to export those QMenu[Bar]::symbianCommands through our public API, anymore. This commit moved the code of QMenuBar::symbianCommands to QMenuBarPrivate::symbianCommands and made that one static. QMenu[Private]::symbianCommands was apparently unused -> deleted. RevBy: Jason Barron RevvBy: Markku Luukkainen --- src/gui/kernel/qapplication.h | 2 +- src/gui/kernel/qapplication_s60.cpp | 13 ++++++++++--- src/gui/widgets/qmenu.h | 3 --- src/gui/widgets/qmenu_p.h | 1 - src/gui/widgets/qmenu_symbian.cpp | 34 +++++----------------------------- src/gui/widgets/qmenubar.h | 4 ---- src/gui/widgets/qmenubar_p.h | 2 +- src/s60main/qts60mainappui.cpp | 2 +- 8 files changed, 18 insertions(+), 43 deletions(-) diff --git a/src/gui/kernel/qapplication.h b/src/gui/kernel/qapplication.h index ca0eb98..f9559fa 100644 --- a/src/gui/kernel/qapplication.h +++ b/src/gui/kernel/qapplication.h @@ -233,7 +233,7 @@ public: #if defined(Q_WS_S60) int s60ProcessEvent(TWsEvent *event); virtual bool s60EventFilter(TWsEvent *aEvent); - void s60HandleCommandL(int command); + void symbianHandleCommand(int command); #endif #if defined(Q_WS_QWS) virtual bool qwsEventFilter(QWSEvent *); diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp index 3d865d3..7b1817f 100644 --- a/src/gui/kernel/qapplication_s60.cpp +++ b/src/gui/kernel/qapplication_s60.cpp @@ -28,7 +28,7 @@ #endif #include "private/qwindowsurface_s60_p.h" #include "qpaintengine.h" -#include "qmenubar.h" +#include "private/qmenubar_p.h" #include "apgwgnam.h" // For CApaWindowGroupName #include // For CMdaAudioToneUtility @@ -1038,7 +1038,14 @@ bool QApplication::s60EventFilter(TWsEvent *aEvent) return false; } -void QApplication::s60HandleCommandL(int command) +/*! + Handles commands which are typically handled by CAknAppUi::HandleCommandL() + Qts Ui integration into Symbian is partially achieved by deriving from CAknAppUi. + Currently, exit, menu and softkey commands are handled + + \sa s60EventFilter(), s60ProcessEvent() +*/ +void QApplication::symbianHandleCommand(int command) { switch (command) { case EEikCmdExit: @@ -1048,7 +1055,7 @@ void QApplication::s60HandleCommandL(int command) break; default: // For now assume all unknown menu items are Qt menu items - QMenuBar::symbianCommands(command); + QMenuBarPrivate::symbianCommands(command); break; } } diff --git a/src/gui/widgets/qmenu.h b/src/gui/widgets/qmenu.h index 1676eb8..bf1c39f 100644 --- a/src/gui/widgets/qmenu.h +++ b/src/gui/widgets/qmenu.h @@ -184,9 +184,6 @@ protected: #ifdef Q_OS_WINCE QAction* wceCommands(uint command); #endif -#ifdef Q_OS_SYMBIAN - void symbianCommands(int command); -#endif private Q_SLOTS: void internalSetSloppyAction(); diff --git a/src/gui/widgets/qmenu_p.h b/src/gui/widgets/qmenu_p.h index a45f12f..aafc945 100644 --- a/src/gui/widgets/qmenu_p.h +++ b/src/gui/widgets/qmenu_p.h @@ -358,7 +358,6 @@ public: return 0; } } *symbian_menu; - bool symbianCommands(int command); #endif QPointer noReplayFor; }; diff --git a/src/gui/widgets/qmenu_symbian.cpp b/src/gui/widgets/qmenu_symbian.cpp index 86affe3..f181924 100644 --- a/src/gui/widgets/qmenu_symbian.cpp +++ b/src/gui/widgets/qmenu_symbian.cpp @@ -219,42 +219,18 @@ Q_GUI_EXPORT void qt_symbian_show_submenu( CEikMenuPane* menuPane, int id) } } -void QMenu::symbianCommands(int command) -{ - Q_D(QMenu); - d->symbianCommands(command); -} - -void QMenuBar::symbianCommands(int command) +void QMenuBarPrivate::symbianCommands(int command) { int size = nativeMenuBars.size(); for (int i = 0; i < nativeMenuBars.size(); ++i) { - bool result = nativeMenuBars.at(i)->d_func()->symbianCommands(command); - if (result) - return; - } -} - -bool QMenuBarPrivate::symbianCommands(int command) -{ SymbianMenuItem* menu = qt_symbian_find_menu_item(command, symbianMenus); if (!menu) - return false; - - emit q_func()->triggered(menu->action); - menu->action->activate(QAction::Trigger); - return true; -} - -bool QMenuPrivate::symbianCommands(int command) -{ - SymbianMenuItem* menu = qt_symbian_find_menu_item(command, symbianMenus); - if (!menu) - return false; + continue; - emit q_func()->triggered(menu->action); + emit nativeMenuBars.at(i)->triggered(menu->action); menu->action->activate(QAction::Trigger); - return true; + break; + } } void QMenuBarPrivate::symbianCreateMenuBar(QWidget *parent) diff --git a/src/gui/widgets/qmenubar.h b/src/gui/widgets/qmenubar.h index 36c983b..42f0c0c 100644 --- a/src/gui/widgets/qmenubar.h +++ b/src/gui/widgets/qmenubar.h @@ -118,10 +118,6 @@ public: static void wceRefresh(); #endif -#ifdef Q_OS_SYMBIAN - static void symbianCommands(int command); -#endif - public Q_SLOTS: virtual void setVisible(bool visible); diff --git a/src/gui/widgets/qmenubar_p.h b/src/gui/widgets/qmenubar_p.h index d562cd9..7993acd 100644 --- a/src/gui/widgets/qmenubar_p.h +++ b/src/gui/widgets/qmenubar_p.h @@ -259,7 +259,7 @@ public: } } *symbian_menubar; - bool symbianCommands(int command); + static void symbianCommands(int command); #endif }; diff --git a/src/s60main/qts60mainappui.cpp b/src/s60main/qts60mainappui.cpp index dafbe96..8467aef 100644 --- a/src/s60main/qts60mainappui.cpp +++ b/src/s60main/qts60mainappui.cpp @@ -73,7 +73,7 @@ CQtS60MainAppUi::~CQtS60MainAppUi() void CQtS60MainAppUi::HandleCommandL( TInt aCommand ) { if (qApp) - qApp->s60HandleCommandL(aCommand); + qApp->symbianHandleCommand(aCommand); } void CQtS60MainAppUi::HandleWsEventL(const TWsEvent& aEvent, CCoeControl *control) -- cgit v0.12