[Libreoffice-commits] core.git: Branch 'feature/priorities' - vcl/generic

Tobias Madl tobias.madl.dev at gmail.com
Tue Nov 11 00:50:48 PST 2014


 vcl/generic/print/genprnpsp.cxx |   28 ++++++++++++++--------------
 1 file changed, 14 insertions(+), 14 deletions(-)

New commits:
commit 0337c0ebcbd36e699785a9871c86e7f80dcb2b00
Author: Tobias Madl <tobias.madl.dev at gmail.com>
Date:   Tue Nov 11 08:49:58 2014 +0000

    changed timer to idle
    
    Change-Id: Iac4b100e3eca456fdd19d67ff311a02c40dc060a

diff --git a/vcl/generic/print/genprnpsp.cxx b/vcl/generic/print/genprnpsp.cxx
index d215a1d..c15fcdb 100644
--- a/vcl/generic/print/genprnpsp.cxx
+++ b/vcl/generic/print/genprnpsp.cxx
@@ -1271,7 +1271,7 @@ bool PspSalPrinter::StartJob( const OUString* i_pFileName, const OUString& i_rJo
 
 class PrinterUpdate
 {
-    static Timer* pPrinterUpdateTimer;
+    static Idle*  pPrinterUpdateIdle;
     static int    nActiveJobs;
 
     static void doUpdate();
@@ -1282,7 +1282,7 @@ public:
     static void jobEnded();
 };
 
-Timer* PrinterUpdate::pPrinterUpdateTimer = NULL;
+Idle* PrinterUpdate::pPrinterUpdateIdle = NULL;
 int PrinterUpdate::nActiveJobs = 0;
 
 void PrinterUpdate::doUpdate()
@@ -1298,11 +1298,11 @@ IMPL_STATIC_LINK_NOINSTANCE( PrinterUpdate, UpdateTimerHdl, void*, EMPTYARG )
     if( nActiveJobs < 1 )
     {
         doUpdate();
-        delete pPrinterUpdateTimer;
-        pPrinterUpdateTimer = NULL;
+        delete pPrinterUpdateIdle;
+        pPrinterUpdateIdle = NULL;
     }
     else
-        pPrinterUpdateTimer->Start();
+        pPrinterUpdateIdle->Start();
 
     return 0;
 }
@@ -1321,12 +1321,12 @@ void PrinterUpdate::update(SalGenericInstance &rInstance)
 
     if( nActiveJobs < 1 )
         doUpdate();
-    else if( ! pPrinterUpdateTimer )
+    else if( ! pPrinterUpdateIdle )
     {
-        pPrinterUpdateTimer = new Timer();
-        pPrinterUpdateTimer->SetTimeout( 500 );
-        pPrinterUpdateTimer->SetTimeoutHdl( STATIC_LINK( NULL, PrinterUpdate, UpdateTimerHdl ) );
-        pPrinterUpdateTimer->Start();
+        pPrinterUpdateIdle = new Idle();
+        pPrinterUpdateIdle->SetPriority( VCL_IDLE_PRIORITY_LOWEST );
+        pPrinterUpdateIdle->SetIdleHdl( STATIC_LINK( NULL, PrinterUpdate, UpdateTimerHdl ) );
+        pPrinterUpdateIdle->Start();
     }
 }
 
@@ -1345,11 +1345,11 @@ void PrinterUpdate::jobEnded()
     nActiveJobs--;
     if( nActiveJobs < 1 )
     {
-        if( pPrinterUpdateTimer )
+        if( pPrinterUpdateIdle )
         {
-            pPrinterUpdateTimer->Stop();
-            delete pPrinterUpdateTimer;
-            pPrinterUpdateTimer = NULL;
+            pPrinterUpdateIdle->Stop();
+            delete pPrinterUpdateIdle;
+            pPrinterUpdateIdle = NULL;
             doUpdate();
         }
     }


More information about the Libreoffice-commits mailing list