From 24d6895bbb32b9f35e0f0ffea5c87c87dd8b0240 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Sat, 25 Oct 2008 00:33:06 +0200 Subject: [PATCH] Replace CExitWait with Ticker. Remove all CExitWait functionality and introduce no-op Ticker, because without it being inserted into CActiveScheduler input doesn't work. --- src/main/symbian/sdlexe.cpp | 42 +++++++++++++++++++----------------------- 1 file changed, 19 insertions(+), 23 deletions(-) diff --git a/src/main/symbian/sdlexe.cpp b/src/main/symbian/sdlexe.cpp index a34e2a0..e5ca58c 100644 --- a/src/main/symbian/sdlexe.cpp +++ b/src/main/symbian/sdlexe.cpp @@ -14,26 +14,21 @@ class CApaDocument; -class CExitWait : public CActive +class Ticker : public CActive { public: - CExitWait(); - ~CExitWait() { Cancel(); } + Ticker() : CActive(CActive::EPriorityIdle) + { + CActiveScheduler::Add(this); + SetActive(); + } + ~Ticker() { Cancel(); } private: - void RunL() { } - void DoCancel() { if(iStatusPtr != NULL) User::RequestComplete(iStatusPtr, KErrCancel); } - - TRequestStatus* iStatusPtr; + void RunL() {} + void DoCancel() {} }; -CExitWait::CExitWait() : CActive(CActive::EPriorityStandard) -{ - CActiveScheduler::Add(this); - SetActive(); - iStatusPtr = &iStatus; -} - //////////////////////////////////////////////////////////////////////// class CSDLWin : public CCoeControl @@ -53,7 +48,6 @@ CSDLWin::CSDLWin( const TRect& aRect ) ActivateL(); } - void CSDLWin::Draw(const TRect& /*aRect*/) const { } @@ -76,7 +70,7 @@ class CSDLAppUi : public CAknAppUi void HandleForegroundEventL(TBool aForeground); - CExitWait* iWait; + Ticker* iTicker; CSDLWin* iSDLWin; CSDL* iSdl; CIdle* iStarter; @@ -87,7 +81,7 @@ CSDLAppUi::~CSDLAppUi() if(iStarter) iStarter->Cancel(); delete iStarter; - delete iWait; + delete iTicker; delete iSdl; delete iSDLWin; } @@ -116,7 +110,7 @@ TBool CSDLAppUi::StartL(void* aThis) void CSDLAppUi::StartL() { - iWait = new CExitWait; + iTicker = new Ticker; iSdl->CallMainL(); Exit(); } @@ -129,7 +123,7 @@ void CSDLAppUi::HandleCommandL(int aCommand) case EAknSoftkeyExit: case EAknCmdExit: case EEikCmdExit: - if(iWait == NULL || !iWait->IsActive() || iSdl == NULL) + if(iSdl == NULL) { Exit(); } @@ -148,19 +142,21 @@ void CSDLAppUi::HandleCommandL(int aCommand) void CSDLAppUi::HandleWsEventL(const TWsEvent& aEvent, CCoeControl* aDestination) { - if(aEvent.Type() == KAknUidValueEndKeyCloseEvent) + if(iSdl) { - if(iWait != NULL && iWait->IsActive() && iSdl != NULL) + if(aEvent.Type() == KAknUidValueEndKeyCloseEvent) { TWsEvent event; event.SetType(EEventSwitchOff), event.SetTimeNow(); iSdl->AppendWsEvent(event); return; } + else + { + iSdl->AppendWsEvent(aEvent); + } } - if(iSdl && iWait) - iSdl->AppendWsEvent(aEvent); CAknAppUi::HandleWsEventL(aEvent, aDestination); } -- 2.11.4.GIT