summaryrefslogtreecommitdiff
path: root/graphics/kdegraphics3/patches/patch-ao
blob: 2c821c7c990e25c450592fbf1e705ac1bef1bacf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
$NetBSD: patch-ao,v 1.2 2003/05/05 12:28:27 markd Exp $

--- kghostview/kpswidget.cpp.orig	Mon Sep 16 09:12:40 2002
+++ kghostview/kpswidget.cpp
@@ -309,10 +309,11 @@ void KPSWidget::setGhostscriptArguments(
     }
 }
 
-void KPSWidget::setFileName( const QString& fileName )
+void KPSWidget::setFileName( const QString& fileName, bool usePipe )
 {
-    if( _fileName != fileName )
+    if(( _fileName != fileName ) || (_usePipe != usePipe))
     {
+        _usePipe = usePipe;
 	_fileName = fileName;
 	stopInterpreter();
 	_ghostscriptDirty = true;
@@ -508,8 +509,12 @@ void KPSWidget::startInterpreter()
     for( ; it != _ghostscriptArguments.end(); ++it )
 	*_process << (*it);
     
-    if( _fileName.isEmpty() )
-	*_process << "-";
+    if( _usePipe )
+        *_process <<
+        // The following two lines are their to ensure that we are allowed to read _fileName
+        "-dDELAYSAFER" << "-sInputFile="+_fileName << "-c" <<
+        "<< /PermitFileReading [ InputFile ] /PermitFileWriting [] /PermitFileControl [] >> setuserparams .locksafe" <<
+	"-";
     else
 	*_process << _fileName << "-c" << "quit";
 
@@ -527,7 +532,7 @@ void KPSWidget::startInterpreter()
     // Finally fire up the interpreter.
     kdDebug(4500) << "KPSWidget: starting interpreter" << endl;
     if( _process->start( KProcess::NotifyOnExit, 
-              _fileName.isEmpty() ? KProcess::All : KProcess::AllOutput ) ) 
+              _usePipe ? KProcess::All : KProcess::AllOutput ) ) 
     {
 	_interpreterBusy = true;
 	setCursor( waitCursor );
@@ -648,7 +653,7 @@ void KPSWidget::readSettings()
     if( !intConfig->platformFonts() )
 	arguments << "-dNOPLATFONTS";
     
-    arguments << "-dNOPAUSE" << "-dQUIET" << "-dSAFER";
+    arguments << "-dNOPAUSE" << "-dQUIET" << "-dSAFER" << "-dPARANOIDSAFER";
 
     setGhostscriptArguments( arguments );