fordwardport fix for bug 112271

svn path=/trunk/KDE/kdegraphics/kpdf/; revision=461062
remotes/origin/kpdf
Albert Astals Cid 21 years ago
parent 9ae8acd6ef
commit f292dd1abd
  1. 12
      part.cpp
  2. 1
      part.h

@ -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 @@ 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())

@ -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

Loading…
Cancel
Save