diff options
author | axis <qt-info@nokia.com> | 2009-10-20 13:15:51 (GMT) |
---|---|---|
committer | axis <qt-info@nokia.com> | 2009-10-21 10:56:50 (GMT) |
commit | 5370e5ff5481a64a7d4a7c182155ce893740abe0 (patch) | |
tree | 7c10423b6a446ce537d60cbae33e6b9ce8e4c7ae /src/gui/s60framework | |
parent | 3ce94323a886abf6047135f188a6e10082a3e28d (diff) | |
download | Qt-5370e5ff5481a64a7d4a7c182155ce893740abe0.zip Qt-5370e5ff5481a64a7d4a7c182155ce893740abe0.tar.gz Qt-5370e5ff5481a64a7d4a7c182155ce893740abe0.tar.bz2 |
Cleaned up the API of the Symbian event hooks.
The two major points were:
- Replacing "s60" with "symbian" in all event handling functions,
since there is nothing S60-specific about them.
- Replace the Symbian event types with the encapsulating
QSymbianEvent container. This allows us to cope with more types of
events in the future without having to add new virtual functions.
AutoTest: QWidget passed
Task: QT-1156
RevBy: Jason Barron
RevBy: Shane Kearns
RevBy: Sami Merila
Diffstat (limited to 'src/gui/s60framework')
-rw-r--r-- | src/gui/s60framework/qs60mainappui.cpp | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/src/gui/s60framework/qs60mainappui.cpp b/src/gui/s60framework/qs60mainappui.cpp index e630253..4ad78f9 100644 --- a/src/gui/s60framework/qs60mainappui.cpp +++ b/src/gui/s60framework/qs60mainappui.cpp @@ -50,6 +50,7 @@ #include "qs60mainappui.h" #include <QtGui/qapplication.h> +#include <QtGui/qsymbianevent.h> #include <QtGui/qmenu.h> #include <private/qmenu_p.h> #include <private/qt_s60_p.h> @@ -134,8 +135,10 @@ QS60MainAppUi::~QS60MainAppUi() */ void QS60MainAppUi::HandleCommandL(TInt command) { - if (qApp) - QT_TRYCATCH_LEAVING(qApp->symbianHandleCommand(command)); + if (qApp) { + QSymbianEvent event(QSymbianEvent::CommandEvent, command); + QT_TRYCATCH_LEAVING(qApp->symbianProcessEvent(&event)); + } } /*! @@ -151,8 +154,10 @@ void QS60MainAppUi::HandleResourceChangeL(TInt type) { CAknAppUi::HandleResourceChangeL(type); - if (qApp) - QT_TRYCATCH_LEAVING(qApp->symbianResourceChange(type)); + if (qApp) { + QSymbianEvent event(QSymbianEvent::ResourceChangeEvent, type); + QT_TRYCATCH_LEAVING(qApp->symbianProcessEvent(&event)); + } } /*! @@ -164,16 +169,18 @@ void QS60MainAppUi::HandleResourceChangeL(TInt type) * If you override this function, you should call the base class implementation if you do not * handle the event. */ -void QS60MainAppUi::HandleWsEventL(const TWsEvent& event, CCoeControl *destination) +void QS60MainAppUi::HandleWsEventL(const TWsEvent& wsEvent, CCoeControl *destination) { int result = 0; - if (qApp) + if (qApp) { + QSymbianEvent event(&wsEvent); QT_TRYCATCH_LEAVING( - result = qApp->s60ProcessEvent(const_cast<TWsEvent*>(&event)) + result = qApp->symbianProcessEvent(&event) ); + } if (result <= 0) - CAknAppUi::HandleWsEventL(event, destination); + CAknAppUi::HandleWsEventL(wsEvent, destination); } |