include/svtools/filechangedchecker.hxx | 2 +- svtools/source/graphic/grfcache.cxx | 7 +++---- svtools/source/graphic/grfcache.hxx | 2 +- svtools/source/misc/filechangedchecker.cxx | 18 +++++++++--------- 4 files changed, 14 insertions(+), 15 deletions(-)
New commits: commit 930a2c4cc5a5895d44a01e1da5467c0387af69af Author: Tobias Madl <[email protected]> Date: Tue Nov 4 11:51:18 2014 +0000 Changed Idle Timers. into Idle Change-Id: I44e33e9e04893237578eb685516fa5ffe43e397f diff --git a/include/svtools/filechangedchecker.hxx b/include/svtools/filechangedchecker.hxx index acff32d..cea8d16 100644 --- a/include/svtools/filechangedchecker.hxx +++ b/include/svtools/filechangedchecker.hxx @@ -23,7 +23,7 @@ class SVT_DLLPUBLIC FileChangedChecker { private : - Timer mTimer; + Idle mIdle; OUString mFileName; TimeValue mLastModTime; ::boost::function0<void> mpCallback; diff --git a/svtools/source/graphic/grfcache.cxx b/svtools/source/graphic/grfcache.cxx index ca4347e..243eeb9 100644 --- a/svtools/source/graphic/grfcache.cxx +++ b/svtools/source/graphic/grfcache.cxx @@ -32,7 +32,6 @@ #include <rtl/crc.h> #include <boost/scoped_ptr.hpp> -#define RELEASE_TIMEOUT 10000 #define MAX_BMP_EXTENT 4096 static const char aHexData[] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' }; @@ -828,9 +827,9 @@ GraphicCache::GraphicCache( sal_uLong nDisplayCacheSize, sal_uLong nMaxObjDispla mnMaxObjDisplaySize ( nMaxObjDisplayCacheSize ), mnUsedDisplaySize ( 0UL ) { - maReleaseTimer.SetTimeoutHdl( LINK( this, GraphicCache, ReleaseTimeoutHdl ) ); - maReleaseTimer.SetTimeout( RELEASE_TIMEOUT ); - maReleaseTimer.Start(); + maReleaseIdle.SetIdleHdl( LINK( this, GraphicCache, ReleaseTimeoutHdl ) ); + maReleaseIdle.SetPriority( VCL_IDLE_PRIORITY_LOWEST ); + maReleaseIdle.Start(); } GraphicCache::~GraphicCache() diff --git a/svtools/source/graphic/grfcache.hxx b/svtools/source/graphic/grfcache.hxx index ddb6f6b..e8259e7 100644 --- a/svtools/source/graphic/grfcache.hxx +++ b/svtools/source/graphic/grfcache.hxx @@ -39,7 +39,7 @@ private: typedef std::list< GraphicCacheEntry* > GraphicCacheEntryList; typedef std::list< GraphicDisplayCacheEntry* > GraphicDisplayCacheEntryList; - Timer maReleaseTimer; + Idle maReleaseIdle; GraphicCacheEntryList maGraphicCache; GraphicDisplayCacheEntryList maDisplayCache; sal_uLong mnReleaseTimeoutSeconds; diff --git a/svtools/source/misc/filechangedchecker.cxx b/svtools/source/misc/filechangedchecker.cxx index 9d8a713..33d5008 100644 --- a/svtools/source/misc/filechangedchecker.cxx +++ b/svtools/source/misc/filechangedchecker.cxx @@ -12,7 +12,7 @@ #include <svtools/filechangedchecker.hxx> FileChangedChecker::FileChangedChecker(const OUString& rFilename, const ::boost::function0<void>& rCallback) : - mTimer(), + mIdle(), mFileName(rFilename), mLastModTime(), mpCallback(rCallback) @@ -20,8 +20,8 @@ FileChangedChecker::FileChangedChecker(const OUString& rFilename, const ::boost: // Get the curren last file modified Status getCurrentModTime(mLastModTime); - // associate the callback function for the timer - mTimer.SetTimeoutHdl(LINK(this, FileChangedChecker, TimerHandler)); + // associate the callback function for the Idle + mIdle.SetIdleHdl(LINK(this, FileChangedChecker, TimerHandler)); //start the timer resetTimer(); @@ -29,12 +29,12 @@ FileChangedChecker::FileChangedChecker(const OUString& rFilename, const ::boost: void FileChangedChecker::resetTimer() { - //Start the timer if its not active - if(!mTimer.IsActive()) - mTimer.Start(); + //Start the Idle if its not active + if(!mIdle.IsActive()) + mIdle.Start(); - // Set a timeout of 3 seconds - mTimer.SetTimeout(3000); + // Set lowest Priority + mIdle.SetPriority(VCL_IDLE_PRIORITY_LOWEST); } bool FileChangedChecker::getCurrentModTime(TimeValue& o_rValue) const @@ -85,7 +85,7 @@ IMPL_LINK_NOARG(FileChangedChecker, TimerHandler) mpCallback(); } - // Reset the timer in any case + // Reset the Idle in any case resetTimer(); return 0; } _______________________________________________ Libreoffice-commits mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
