[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdegraphics/kpdf
From:       Albert Astals Cid <tsdgeos () terra ! es>
Date:       2006-01-18 22:01:18
Message-ID: 1137621678.333769.14092.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 499859 by aacid:

fordwardport r499855
Make non-exisant ps file loading fail gracefully


 M  +17 -12    part.cpp  


--- trunk/KDE/kdegraphics/kpdf/part.cpp #499858:499859
@@ -364,20 +364,25 @@
         QString app = KStandardDirs::findExe( "ps2pdf" );
         if ( !app.isNull() )
         {
-            KTempFile tf( QString::null, ".pdf" );
-            if ( tf.status() == 0 )
-            {
-                tf.close();
-                m_temporaryLocalFile = tf.name();
+            if ( QFile::exists(m_file) )
+	    {
+                KTempFile tf( QString::null, ".pdf" );
+                if ( tf.status() == 0 )
+                {
+                    tf.close();
+                    m_temporaryLocalFile = tf.name();
 
-                KProcess *p = new KProcess;
-                *p << app;
-                *p << m_file << m_temporaryLocalFile;
-                m_pageView->showText(i18n("Converting from ps to pdf..."), 0);
-                connect(p, SIGNAL(processExited(KProcess *)), this, SLOT(psTransformEnded()));
-                p -> start();
-                return true;
+                    KProcess *p = new KProcess;
+                    *p << app;
+                    *p << m_file << m_temporaryLocalFile;
+                    m_pageView->showText(i18n("Converting from ps to pdf..."), 0);
+                    connect(p, SIGNAL(processExited(KProcess *)), this, SLOT(psTransformEnded()));
+                    p -> start();
+                    return true;
+                }
+                else return false;
             }
+            else return false;
         }
         else
         {
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic