Summary: | loading non-existing postscript file fails | ||
---|---|---|---|
Product: | [Unmaintained] kpdf | Reporter: | Tommi Uimonen <tuimonen> |
Component: | general | Assignee: | Albert Astals Cid <aacid> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | NOR | ||
Version: | 0.5 | ||
Target Milestone: | --- | ||
Platform: | Debian testing | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: |
Description
Tommi Uimonen
2006-01-17 20:38:16 UTC
SVN commit 499855 by aacid: Make non-exisant ps file loading fail gracefully BUGS: 120343 M +17 -12 part.cpp --- branches/KDE/3.5/kdegraphics/kpdf/part.cpp #499854:499855 @@ -362,20 +362,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 { |