[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:       2005-09-16 11:14:58
Message-ID: 1126869298.236347.20501.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 461062 by aacid:

fordwardport fix for bug 112271


 M  +12 -0     part.cpp  
 M  +1 -0      part.h  


--- trunk/KDE/kdegraphics/kpdf/part.cpp #461061:461062
@@ -46,6 +46,7 @@
 #include <knuminput.h>
 #include <kiconloader.h>
 #include <kio/netaccess.h>
+#include <kio/job.h>
 #include <kpopupmenu.h>
 #include <kprocess.h>
 #include <kstandarddirs.h>
@@ -85,6 +86,9 @@
 	: DCOPObject("kpdf"), KParts::ReadOnlyPart(parent, name), m_showMenuBarAction(0), \
m_showFullScreenAction(0),  m_actionsSearched(false), m_searchStarted(false)
 {
+	// connect the started signal to tell the job the mimetypes we like
+	connect(this, SIGNAL(started(KIO::Job *)), this, SLOT(setMimeTypes(KIO::Job *)));
+	
 	// load catalog for translation
 	KGlobal::locale()->insertCatalogue("kpdf");
 
@@ -442,6 +446,14 @@
     return b;
 }
 
+void Part::setMimeTypes(KIO::Job *job)
+{
+    if (job)
+    {
+        job->addMetaData("accept", "application/pdf, */*;q=0.5");
+    }
+}
+
 bool Part::closeURL()
 {
     if (!m_temporaryLocalFile.isNull())
--- trunk/KDE/kdegraphics/kpdf/part.h #461061:461062
@@ -114,6 +114,7 @@
 	void enableTOC(bool enable);
 	void psTransformEnded();
 	void cannotQuit();
+	void setMimeTypes(KIO::Job *job);
 
 public slots:
 	// connected to Shell action (and browserExtension), not local one


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

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