diff options
author | Jennifer Liebel <jliebel94@gmail.com> | 2014-11-17 09:18:52 +0000 |
---|---|---|
committer | Tobias Madl <tobias.madl.dev@gmail.com> | 2014-12-09 12:34:58 +0000 |
commit | d843f3de731667a298a83fc66637c7f983f3b24d (patch) | |
tree | 7858b40511f16654d93828676991d8a4b84a044a /sfx2 | |
parent | 821ae0fb9fa63e0171f987d5ec210ec121978b8f (diff) |
changed timers to idle
Change-Id: I92f40d3dad133347f1b8db0b025b624d3305f885
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/appl/appcfg.cxx | 17 | ||||
-rw-r--r-- | sfx2/source/appl/newhelp.cxx | 13 | ||||
-rw-r--r-- | sfx2/source/appl/newhelp.hxx | 2 |
3 files changed, 15 insertions, 17 deletions
diff --git a/sfx2/source/appl/appcfg.cxx b/sfx2/source/appl/appcfg.cxx index e4bf24273e28..2a8c7a36ce06 100644 --- a/sfx2/source/appl/appcfg.cxx +++ b/sfx2/source/appl/appcfg.cxx @@ -83,7 +83,7 @@ using namespace ::com::sun::star::beans; class SfxEventAsyncer_Impl : public SfxListener { SfxEventHint aHint; - Timer* pTimer; + Idle* pIdle; public: @@ -98,9 +98,9 @@ public: void SfxEventAsyncer_Impl::Notify( SfxBroadcaster&, const SfxHint& rHint ) { const SfxSimpleHint* pHint = dynamic_cast<const SfxSimpleHint*>(&rHint); - if( pHint && pHint->GetId() == SFX_HINT_DYING && pTimer->IsActive() ) + if( pHint && pHint->GetId() == SFX_HINT_DYING && pIdle->IsActive() ) { - pTimer->Stop(); + pIdle->Stop(); delete this; } } @@ -112,24 +112,23 @@ SfxEventAsyncer_Impl::SfxEventAsyncer_Impl( const SfxEventHint& rHint ) { if( rHint.GetObjShell() ) StartListening( *rHint.GetObjShell() ); - pTimer = new Timer; - pTimer->SetTimeoutHdl( LINK(this, SfxEventAsyncer_Impl, TimerHdl) ); - pTimer->SetTimeout( 0 ); - pTimer->Start(); + pIdle = new Idle; + pIdle->SetIdleHdl( LINK(this, SfxEventAsyncer_Impl, TimerHdl) ); + pIdle->SetPriority( VCL_IDLE_PRIORITY_HIGHEST ); + pIdle->Start(); } SfxEventAsyncer_Impl::~SfxEventAsyncer_Impl() { - delete pTimer; + delete pIdle; } IMPL_LINK(SfxEventAsyncer_Impl, TimerHdl, Timer*, pAsyncTimer) { - (void)pAsyncTimer; // unused variable SfxObjectShellRef xRef( aHint.GetObjShell() ); pAsyncTimer->Stop(); #ifdef DBG_UTIL diff --git a/sfx2/source/appl/newhelp.cxx b/sfx2/source/appl/newhelp.cxx index 152e6e480100..77265a2bfa41 100644 --- a/sfx2/source/appl/newhelp.cxx +++ b/sfx2/source/appl/newhelp.cxx @@ -538,10 +538,9 @@ IndexTabPage_Impl::IndexTabPage_Impl(vcl::Window* pParent, SfxHelpIndexWindow_Im m_pOpenBtn->SetClickHdl( LINK( this, IndexTabPage_Impl, OpenHdl ) ); Link aTimeoutLink = LINK( this, IndexTabPage_Impl, TimeoutHdl ); - aFactoryTimer.SetTimeoutHdl( aTimeoutLink ); - aFactoryTimer.SetTimeout( 300 ); + aFactoryIdle.SetIdleHdl( aTimeoutLink ); + aFactoryIdle.SetPriority(VCL_IDLE_PRIORITY_LOWER); aKeywordTimer.SetTimeoutHdl( aTimeoutLink ); - aFactoryTimer.SetTimeout( 300 ); } IndexTabPage_Impl::~IndexTabPage_Impl() @@ -711,7 +710,7 @@ IMPL_LINK_NOARG(IndexTabPage_Impl, OpenHdl) IMPL_LINK( IndexTabPage_Impl, TimeoutHdl, Timer*, pTimer ) { - if ( &aFactoryTimer == pTimer ) + if ( &aFactoryIdle == pTimer ) InitializeIndex(); else if ( &aKeywordTimer == pTimer && !sKeyword.isEmpty() ) aKeywordLink.Call( this ); @@ -723,7 +722,7 @@ void IndexTabPage_Impl::ActivatePage() if ( !bIsActivated ) { bIsActivated = true; - aFactoryTimer.Start(); + aFactoryIdle.Start(); } if ( !m_pIdxWin->WasCursorLeftOrRight() ) @@ -757,7 +756,7 @@ void IndexTabPage_Impl::SetFactory( const OUString& rFactory ) sFactory = sNewFactory; ClearIndex(); if ( bIsActivated ) - aFactoryTimer.Start(); + aFactoryIdle.Start(); } } @@ -781,7 +780,7 @@ void IndexTabPage_Impl::SetKeyword( const OUString& rKeyword ) if ( m_pIndexCB->GetEntryCount() > 0 ) aKeywordTimer.Start(); else if ( !bIsActivated ) - aFactoryTimer.Start(); + aFactoryIdle.Start(); } diff --git a/sfx2/source/appl/newhelp.hxx b/sfx2/source/appl/newhelp.hxx index 233a317fdd77..e3f5202872c3 100644 --- a/sfx2/source/appl/newhelp.hxx +++ b/sfx2/source/appl/newhelp.hxx @@ -121,7 +121,7 @@ private: IndexBox_Impl* m_pIndexCB; PushButton* m_pOpenBtn; - Timer aFactoryTimer; + Idle aFactoryIdle; Timer aKeywordTimer; Link aKeywordLink; |