File 0001-Inform-users-about-the-okular-spectre-package-in-the.patch of Package okular

From d628fb9e647c1333a7b4a6574bf459f89e9e54a1 Mon Sep 17 00:00:00 2001
From: Fabian Vogt <fabian@ritter-vogt.de>
Date: Wed, 16 Sep 2020 16:29:53 +0200
Subject: [PATCH] Inform users about the okular-spectre package in the print
 preview

---
 part/fileprinterpreview.cpp | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/part/fileprinterpreview.cpp b/part/fileprinterpreview.cpp
index 6bac0cc..b06046d 100644
--- a/part/fileprinterpreview.cpp
+++ b/part/fileprinterpreview.cpp
@@ -92,6 +92,12 @@ void FilePrinterPreviewPrivate::getPart()
     }
 
     KService::List::ConstIterator it = offers.constBegin();
+    if (filename.endsWith(QStringLiteral(".ps")) && it == offers.constEnd()) {
+        failMessage = new QLabel(i18n("Ghostscript is needed for the print preview, but it has security issues and is not installed by default.\n"
+                                      "If you only open trusted documents, you can install the 'okular-spectre' package."), q);
+        return;
+    }
+
     while (!factory && it != offers.constEnd()) {
         KPluginLoader loader(**it);
         factory = loader.factory();
-- 
2.29.2
openSUSE Build Service is sponsored by