blob: 1b28ebe0166aaef36606034f34af070b88ff2cf5 (
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
|
$NetBSD: patch-ao,v 1.1 2003/04/10 13:13:25 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,11 @@ 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 +531,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 +652,7 @@ void KPSWidget::readSettings()
if( !intConfig->platformFonts() )
arguments << "-dNOPLATFONTS";
- arguments << "-dNOPAUSE" << "-dQUIET" << "-dSAFER";
+ arguments << "-dNOPAUSE" << "-dQUIET" << "-dSAFER" << "-dPARANOIDSAFER";
setGhostscriptArguments( arguments );
|