Bug 439724

Summary: Check first if ghostscript is installed before generating a preview which cannot be displayed or printed anyway
Product: [Applications] okular Reporter: postix <postix>
Component: generalAssignee: Okular developers <okular-devel>
Status: REPORTED ---    
Severity: normal CC: postix
Priority: NOR    
Version First Reported In: 21.04.3   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description postix 2021-07-10 14:49:16 UTC
SUMMARY

On openSUSE by default there's no ghostscript installed (due to security concerns).
While this is an different issue, Okular always first tries to generate a preview, which, depending on the size of the document, may take some time.
In the end after wasting many resources it notifies the user that it cannot proceed since ghostscript is missing.

IMHO it would make sense to perform the check for ghostscript in the first place and if successful, generate the preview.


STEPS TO REPRODUCE:
1. Open document
2. File -> Print preview
OR
2. File -> Print


SOFTWARE/OS VERSIONS
Operating System: openSUSE Tumbleweed 20210707
KDE Plasma Version: 5.22.2
KDE Frameworks Version: 5.83.0
Qt Version: 5.15.2
Kernel Version: 5.13.0-1-default (64-bit)