diff options
author | Tobias Madl <tobias.madl.dev@gmail.com> | 2014-11-10 12:19:19 +0000 |
---|---|---|
committer | Tobias Madl <tobias.madl.dev@gmail.com> | 2014-12-09 12:34:53 +0000 |
commit | 75cc10b9fe9a67c4f796686696246d476c156afc (patch) | |
tree | dbe67a71513589f7ab9c037fde60b14df4c1c7b4 /sd | |
parent | f212779ac3d9df4a6ee6b394437e8ddd957d12f6 (diff) |
changed timer to idle
Change-Id: I46c2ebfae3a62d65ada50410187712ccf4c9c91e
Diffstat (limited to 'sd')
-rw-r--r-- | sd/source/ui/framework/configuration/ConfigurationUpdater.cxx | 19 | ||||
-rw-r--r-- | sd/source/ui/framework/configuration/ConfigurationUpdater.hxx | 2 |
2 files changed, 8 insertions, 13 deletions
diff --git a/sd/source/ui/framework/configuration/ConfigurationUpdater.cxx b/sd/source/ui/framework/configuration/ConfigurationUpdater.cxx index 10ea9201038f..2972f9311215 100644 --- a/sd/source/ui/framework/configuration/ConfigurationUpdater.cxx +++ b/sd/source/ui/framework/configuration/ConfigurationUpdater.cxx @@ -36,9 +36,6 @@ using ::sd::framework::FrameworkHelper; using ::std::vector; namespace { -static const sal_Int32 snShortTimeout (100); -static const sal_Int32 snNormalTimeout (1000); -static const sal_Int32 snLongTimeout (10000); static const sal_Int32 snShortTimeoutCountThreshold (1); static const sal_Int32 snNormalTimeoutCountThreshold (5); } @@ -70,21 +67,21 @@ ConfigurationUpdater::ConfigurationUpdater ( mbUpdatePending(false), mbUpdateBeingProcessed(false), mnLockCount(0), - maUpdateTimer(), + maUpdateIdle(), mnFailedUpdateCount(0), mpResourceManager(rpResourceManager) { // Prepare the timer that is started when after an update the current // and the requested configuration differ. With the timer we try // updates until the two configurations are the same. - maUpdateTimer.SetTimeout(snNormalTimeout); - maUpdateTimer.SetTimeoutHdl(LINK(this,ConfigurationUpdater,TimeoutHandler)); + maUpdateIdle.SetPriority(VCL_IDLE_PRIORITY_LOWEST); + maUpdateIdle.SetIdleHdl(LINK(this,ConfigurationUpdater,TimeoutHandler)); SetControllerManager(rxControllerManager); } ConfigurationUpdater::~ConfigurationUpdater (void) { - maUpdateTimer.Stop(); + maUpdateIdle.Stop(); } void ConfigurationUpdater::SetControllerManager( @@ -218,13 +215,11 @@ void ConfigurationUpdater::CheckUpdateSuccess (void) if ( ! AreConfigurationsEquivalent(mxCurrentConfiguration, mxRequestedConfiguration)) { if (mnFailedUpdateCount <= snShortTimeoutCountThreshold) - maUpdateTimer.SetTimeout(snShortTimeout); - else if (mnFailedUpdateCount < snNormalTimeoutCountThreshold) - maUpdateTimer.SetTimeout(snNormalTimeout); + maUpdateIdle.SetPriority(VCL_IDLE_PRIORITY_LOW); else - maUpdateTimer.SetTimeout(snLongTimeout); + maUpdateIdle.SetPriority(VCL_IDLE_PRIORITY_LOWEST); ++mnFailedUpdateCount; - maUpdateTimer.Start(); + maUpdateIdle.Start(); } else { diff --git a/sd/source/ui/framework/configuration/ConfigurationUpdater.hxx b/sd/source/ui/framework/configuration/ConfigurationUpdater.hxx index feb6ad686efc..382fac6c97db 100644 --- a/sd/source/ui/framework/configuration/ConfigurationUpdater.hxx +++ b/sd/source/ui/framework/configuration/ConfigurationUpdater.hxx @@ -131,7 +131,7 @@ private: This is used to overcome problems with resources that become available asynchronously. */ - Timer maUpdateTimer; + Idle maUpdateIdle; /** The number of failed updates (those after which the current configuration is not equivalent to the requested configuration) is |