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

List:       kde-core-devel
Subject:    [PATCH] KPDF crashes on .PS documents
From:       George Staikos <staikos () kde ! org>
Date:       2005-02-24 4:48:46
Message-ID: 200502232348.46533.staikos () kde ! org
[Download RAW message or body]

This is especially annoying since there are those out there who ship 
off .pdf files that are simply renamed .ps files. (yes, I've seen it...)  We 
shouldn't be crashing here.  Only problem is that introduces an i18n, so we 
could either ignore the messagebox for this release, get it translated 
quickly, or just exit().  Comments?

-- 
George Staikos
KDE Developer				http://www.kde.org/
Staikos Computing Services Inc.		http://www.staikos.net/

["kpdf-no-crashy.patch" (text/x-diff)]

Index: document.cpp
===================================================================
RCS file: /home/kde/kdegraphics/kpdf/core/document.cpp,v
retrieving revision 1.33
diff -u -3 -p -r1.33 document.cpp
--- document.cpp	12 Feb 2005 17:15:20 -0000	1.33
+++ document.cpp	24 Feb 2005 04:46:44 -0000
@@ -140,8 +140,11 @@ bool KPDFDocument::openDocument( const Q
     QString mimeName = mime->name();
     if ( mimeName == "application/pdf" )
         generator = new PDFGenerator( this );
-    else if ( mimeName == "application/postscript" )
+    else if ( mimeName == "application/postscript" ) {
         kdError() << "PS generator not available" << endl;
+        KMessageBox::sorry(0L, i18n("Postscript is unsupported."));
+        return false;
+    }
     else
     {
         kdWarning() << "Unknown mimetype '" << mimeName << "'." << endl;


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

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