summaryrefslogtreecommitdiff
path: root/vcl/generic/print
diff options
context:
space:
mode:
authorTobias Madl <tobias.madl.dev@gmail.com>2014-11-11 08:49:58 +0000
committerTobias Madl <tobias.madl.dev@gmail.com>2014-12-09 12:34:55 +0000
commite3b098a8166d05494c8584ac0d099dae3531291f (patch)
tree0f482099fd8c8ba8512e9189523a258f9e2a311e /vcl/generic/print
parentf62c45f3aff7b5ee1438e0d2c5d975ecc06c6950 (diff)
changed timer to idle
Change-Id: Iac4b100e3eca456fdd19d67ff311a02c40dc060a
Diffstat (limited to 'vcl/generic/print')
-rw-r--r--vcl/generic/print/genprnpsp.cxx28
1 files changed, 14 insertions, 14 deletions
diff --git a/vcl/generic/print/genprnpsp.cxx b/vcl/generic/print/genprnpsp.cxx
index 910997ea00af..02d2ab9ab596 100644
--- a/vcl/generic/print/genprnpsp.cxx
+++ b/vcl/generic/print/genprnpsp.cxx
@@ -1274,7 +1274,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();
@@ -1285,7 +1285,7 @@ public:
static void jobEnded();
};
-Timer* PrinterUpdate::pPrinterUpdateTimer = NULL;
+Idle* PrinterUpdate::pPrinterUpdateIdle = NULL;
int PrinterUpdate::nActiveJobs = 0;
void PrinterUpdate::doUpdate()
@@ -1301,11 +1301,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;
}
@@ -1324,12 +1324,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();
}
}
@@ -1348,11 +1348,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();
}
}