diff --git a/part.cpp b/part.cpp index 357025875..c9dd740f2 100644 --- a/part.cpp +++ b/part.cpp @@ -46,6 +46,7 @@ #include #include #include +#include #include #include #include @@ -85,6 +86,9 @@ Part::Part(QWidget *parentWidget, const char *widgetName, : 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 @@ bool Part::openURL(const KURL &url) 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()) diff --git a/part.h b/part.h index c81a9a989..9e2f8bf60 100644 --- a/part.h +++ b/part.h @@ -114,6 +114,7 @@ protected slots: void enableTOC(bool enable); void psTransformEnded(); void cannotQuit(); + void setMimeTypes(KIO::Job *job); public slots: // connected to Shell action (and browserExtension), not local one