diff options
author | Michael Weghorn <m.weghorn@posteo.de> | 2024-08-26 14:18:46 +0200 |
---|---|---|
committer | Michael Weghorn <m.weghorn@posteo.de> | 2024-08-27 07:30:14 +0200 |
commit | ee472dcaedccad37de0ff326d6c79bdd9bbc9e52 (patch) | |
tree | 44231b7e5f16541a9c8b9e78191f870e1c39e62a /vcl | |
parent | c5cad121e5b68c2209fee2aa4611b1b609e2d4cf (diff) |
vcl: Drop logically dead "PrinterUpdate::nActiveJobs > 0" code
`PrinterUpdate::nActiveJobs` is initialized to 0 and
never increased, so cod paths for it being >= 0 are
logically dead.
Therefore, drop them and `PrinterUpdate::nActiveJobs` altogether.
Also drop the now unused `UpdateTimerHdl`.
`PrinterUpdate::jobStarted` that would have increased
`PrinterUpdate::nActiveJobs` was dropped in
commit 3564e11a41c8d3f06c8be387691d5997942e9738
Date: Sun Jul 30 23:20:36 2023 +0200
tdf#156230 remove now unused various bit and pieces
Change-Id: I431171094d4981552f641af89940d877147ffa71
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172398
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/unx/generic/print/genprnpsp.cxx | 39 |
1 files changed, 6 insertions, 33 deletions
diff --git a/vcl/unx/generic/print/genprnpsp.cxx b/vcl/unx/generic/print/genprnpsp.cxx index 9c00c6240206..c2beec916b56 100644 --- a/vcl/unx/generic/print/genprnpsp.cxx +++ b/vcl/unx/generic/print/genprnpsp.cxx @@ -1023,10 +1023,8 @@ namespace { class PrinterUpdate { static Idle* pPrinterUpdateIdle; - static int nActiveJobs; static void doUpdate(); - DECL_STATIC_LINK( PrinterUpdate, UpdateTimerHdl, Timer*, void ); public: static void update(SalGenericInstance const &rInstance); static void jobEnded(); @@ -1035,7 +1033,6 @@ public: } Idle* PrinterUpdate::pPrinterUpdateIdle = nullptr; -int PrinterUpdate::nActiveJobs = 0; void PrinterUpdate::doUpdate() { @@ -1045,18 +1042,6 @@ void PrinterUpdate::doUpdate() pInst->PostPrintersChanged(); } -IMPL_STATIC_LINK_NOARG( PrinterUpdate, UpdateTimerHdl, Timer*, void ) -{ - if( nActiveJobs < 1 ) - { - doUpdate(); - delete pPrinterUpdateIdle; - pPrinterUpdateIdle = nullptr; - } - else - pPrinterUpdateIdle->Start(); -} - void PrinterUpdate::update(SalGenericInstance const &rInstance) { if( Application::GetSettings().GetMiscSettings().GetDisablePrinting() ) @@ -1069,15 +1054,7 @@ void PrinterUpdate::update(SalGenericInstance const &rInstance) return; } - if( nActiveJobs < 1 ) - doUpdate(); - else if( ! pPrinterUpdateIdle ) - { - pPrinterUpdateIdle = new Idle("PrinterUpdateTimer"); - pPrinterUpdateIdle->SetPriority( TaskPriority::LOWEST ); - pPrinterUpdateIdle->SetInvokeHandler( LINK( nullptr, PrinterUpdate, UpdateTimerHdl ) ); - pPrinterUpdateIdle->Start(); - } + doUpdate(); } void SalGenericInstance::updatePrinterUpdate() @@ -1087,16 +1064,12 @@ void SalGenericInstance::updatePrinterUpdate() void PrinterUpdate::jobEnded() { - nActiveJobs--; - if( nActiveJobs < 1 ) + if( pPrinterUpdateIdle ) { - if( pPrinterUpdateIdle ) - { - pPrinterUpdateIdle->Stop(); - delete pPrinterUpdateIdle; - pPrinterUpdateIdle = nullptr; - doUpdate(); - } + pPrinterUpdateIdle->Stop(); + delete pPrinterUpdateIdle; + pPrinterUpdateIdle = nullptr; + doUpdate(); } } |