• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.10.0 API Reference
  • KDE Home
  • Contact Us
 

KDEWebKit

  • kdewebkit
kwebpage.cpp
Go to the documentation of this file.
1 /*
2  * This file is part of the KDE project.
3  *
4  * Copyright (C) 2008 Dirk Mueller <mueller@kde.org>
5  * Copyright (C) 2008 Urs Wolfer <uwolfer @ kde.org>
6  * Copyright (C) 2008 Michael Howell <mhowell123@gmail.com>
7  * Copyright (C) 2009,2010 Dawit Alemayehu <adawit@kde.org>
8  *
9  * This library is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU Library General Public
11  * License as published by the Free Software Foundation; either
12  * version 2 of the License, or (at your option) any later version.
13  *
14  * This library is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17  * Library General Public License for more details.
18  *
19  * You should have received a copy of the GNU Library General Public License
20  * along with this library; see the file COPYING.LIB. If not, write to
21  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
22  * Boston, MA 02110-1301, USA.
23  *
24  */
25 
26 // Own
27 #include "kwebpage.h"
28 #include "kwebwallet.h"
29 
30 // Local
31 #include "kwebpluginfactory.h"
32 
33 // KDE
34 #include <kaction.h>
35 #include <kfiledialog.h>
36 #include <kprotocolmanager.h>
37 #include <kjobuidelegate.h>
38 #include <krun.h>
39 #include <kstandarddirs.h>
40 #include <kstandardshortcut.h>
41 #include <kurl.h>
42 #include <kdebug.h>
43 #include <kshell.h>
44 #include <kmimetypetrader.h>
45 #include <klocalizedstring.h>
46 #include <ktemporaryfile.h>
47 #include <kio/accessmanager.h>
48 #include <kio/job.h>
49 #include <kio/copyjob.h>
50 #include <kio/jobuidelegate.h>
51 #include <kio/renamedialog.h>
52 #include <kio/scheduler.h>
53 #include <kparts/browseropenorsavequestion.h>
54 
55 // Qt
56 #include <QtCore/QPointer>
57 #include <QtCore/QFileInfo>
58 #include <QtCore/QCoreApplication>
59 #include <QtWebKit/QWebFrame>
60 #include <QtNetwork/QNetworkReply>
61 
62 
63 #define QL1S(x) QLatin1String(x)
64 #define QL1C(x) QLatin1Char(x)
65 
66 static void reloadRequestWithoutDisposition (QNetworkReply* reply)
67 {
68  QNetworkRequest req (reply->request());
69  req.setRawHeader("x-kdewebkit-ignore-disposition", "true");
70 
71  QWebFrame* frame = qobject_cast<QWebFrame*> (req.originatingObject());
72  if (!frame)
73  return;
74 
75  frame->load(req);
76 }
77 
78 static bool isMimeTypeAssociatedWithSelf(const KService::Ptr &offer)
79 {
80  if (!offer)
81  return false;
82 
83  kDebug(800) << offer->desktopEntryName();
84 
85  const QString& appName = QCoreApplication::applicationName();
86 
87  if (appName == offer->desktopEntryName() || offer->exec().trimmed().startsWith(appName))
88  return true;
89 
90  // konqueror exception since it uses kfmclient to open html content...
91  if (appName == QL1S("konqueror") && offer->exec().trimmed().startsWith(QL1S("kfmclient")))
92  return true;
93 
94  return false;
95 }
96 
97 static void extractMimeType(const QNetworkReply* reply, QString& mimeType)
98 {
99  mimeType.clear();
100  const KIO::MetaData& metaData = reply->attribute(static_cast<QNetworkRequest::Attribute>(KIO::AccessManager::MetaData)).toMap();
101  if (metaData.contains(QL1S("content-type")))
102  mimeType = metaData.value(QL1S("content-type"));
103 
104  if (!mimeType.isEmpty())
105  return;
106 
107  if (!reply->hasRawHeader("Content-Type"))
108  return;
109 
110  const QString value (QL1S(reply->rawHeader("Content-Type").simplified().constData()));
111  const int index = value.indexOf(QL1C(';'));
112  mimeType = ((index == -1) ? value : value.left(index));
113 }
114 
115 static bool downloadResource (const KUrl& srcUrl, const QString& suggestedName = QString(),
116  QWidget* parent = 0, const KIO::MetaData& metaData = KIO::MetaData())
117 {
118  const QString fileName = suggestedName.isEmpty() ? srcUrl.fileName() : suggestedName;
119  // convert filename to URL using fromPath to avoid trouble with ':' in filenames (#184202)
120  KUrl destUrl = KFileDialog::getSaveFileName(KUrl::fromPath(fileName), QString(), parent);
121  if (!destUrl.isValid())
122  return false;
123 
124  // Using KIO::copy rather than file_copy, to benefit from "dest already exists" dialogs.
125  KIO::Job *job = KIO::copy(srcUrl, destUrl);
126 
127  if (!metaData.isEmpty())
128  job->setMetaData(metaData);
129 
130  job->addMetaData(QL1S("MaxCacheSize"), QL1S("0")); // Don't store in http cache.
131  job->addMetaData(QL1S("cache"), QL1S("cache")); // Use entry from cache if available.
132  job->ui()->setWindow((parent ? parent->window() : 0));
133  job->ui()->setAutoErrorHandlingEnabled(true);
134  return true;
135 }
136 
137 static bool isReplyStatusOk(const QNetworkReply* reply)
138 {
139  if (!reply || reply->error() != QNetworkReply::NoError)
140  return false;
141 
142  // Check HTTP status code only for http and webdav protocols...
143  const QString scheme = reply->url().scheme();
144  if (scheme.startsWith(QLatin1String("http"), Qt::CaseInsensitive) ||
145  scheme.startsWith(QLatin1String("webdav"), Qt::CaseInsensitive)) {
146  bool ok = false;
147  const int statusCode = reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt(&ok);
148  if (!ok || statusCode < 200 || statusCode > 299)
149  return false;
150  }
151 
152  return true;
153 }
154 
155 class KWebPage::KWebPagePrivate
156 {
157 public:
158  KWebPagePrivate(KWebPage* page)
159  : q(page)
160  , inPrivateBrowsingMode(false)
161  {
162  }
163 
164  QWidget* windowWidget()
165  {
166  return (window ? window.data() : q->view());
167  }
168 
169  void _k_copyResultToTempFile(KJob* job)
170  {
171  KIO::FileCopyJob* cJob = qobject_cast<KIO::FileCopyJob *>(job);
172  if (cJob && !cJob->error() ) {
173  // Same as KRun::foundMimeType but with a different URL
174  (void)KRun::runUrl(cJob->destUrl(), mimeType, window);
175  }
176  }
177 
178  void _k_receivedContentType(KIO::Job* job, const QString& mimetype)
179  {
180  KIO::TransferJob* tJob = qobject_cast<KIO::TransferJob*>(job);
181  if (tJob && !tJob->error()) {
182  tJob->putOnHold();
183  KIO::Scheduler::publishSlaveOnHold();
184  // Get suggested file name...
185  mimeType = mimetype;
186  const QString suggestedFileName (tJob->queryMetaData(QL1S("content-disposition-filename")));
187  // kDebug(800) << "suggested filename:" << suggestedFileName << ", mimetype:" << mimetype;
188  (void) downloadResource(tJob->url(), suggestedFileName, window, tJob->metaData());
189  }
190  }
191 
192  void _k_contentTypeCheckFailed(KJob* job)
193  {
194  KIO::TransferJob* tJob = qobject_cast<KIO::TransferJob*>(job);
195  // On error simply call downloadResource which will probably fail as well.
196  if (tJob && tJob->error()) {
197  (void)downloadResource(tJob->url(), QString(), window, tJob->metaData());
198  }
199  }
200 
201  KWebPage* q;
202  QPointer<QWidget> window;
203  QString mimeType;
204  QPointer<KWebWallet> wallet;
205  bool inPrivateBrowsingMode;
206 };
207 
208 static void setActionIcon(QAction* action, const QIcon& icon)
209 {
210  if (action) {
211  action->setIcon(icon);
212  }
213 }
214 
215 static void setActionShortcut(QAction* action, const KShortcut& shortcut)
216 {
217  if (action) {
218  action->setShortcuts(shortcut.toList());
219  }
220 }
221 
222 KWebPage::KWebPage(QObject *parent, Integration flags)
223  :QWebPage(parent), d(new KWebPagePrivate(this))
224 {
225  // KDE KParts integration for <embed> tag...
226  if (!flags || (flags & KPartsIntegration))
227  setPluginFactory(new KWebPluginFactory(this));
228 
229  QWidget *parentWidget = qobject_cast<QWidget*>(parent);
230  d->window = (parentWidget ? parentWidget->window() : 0);
231 
232  // KDE IO (KIO) integration...
233  if (!flags || (flags & KIOIntegration)) {
234  KIO::Integration::AccessManager *manager = new KIO::Integration::AccessManager(this);
235  // Disable QtWebKit's internal cache to avoid duplication with the one in KIO...
236  manager->setCache(0);
237  manager->setWindow(d->window);
238  manager->setEmitReadyReadOnMetaDataChange(true);
239  setNetworkAccessManager(manager);
240  }
241 
242  // KWallet integration...
243  if (!flags || (flags & KWalletIntegration)) {
244  setWallet(new KWebWallet(0, (d->window ? d->window->winId() : 0) ));
245  }
246 
247  setActionIcon(action(Back), KIcon("go-previous"));
248  setActionIcon(action(Forward), KIcon("go-next"));
249  setActionIcon(action(Reload), KIcon("view-refresh"));
250  setActionIcon(action(Stop), KIcon("process-stop"));
251  setActionIcon(action(Cut), KIcon("edit-cut"));
252  setActionIcon(action(Copy), KIcon("edit-copy"));
253  setActionIcon(action(Paste), KIcon("edit-paste"));
254  setActionIcon(action(Undo), KIcon("edit-undo"));
255  setActionIcon(action(Redo), KIcon("edit-redo"));
256  setActionIcon(action(SelectAll), KIcon("edit-select-all"));
257  setActionIcon(action(InspectElement), KIcon("view-process-all"));
258  setActionIcon(action(OpenLinkInNewWindow), KIcon("window-new"));
259  setActionIcon(action(OpenFrameInNewWindow), KIcon("window-new"));
260  setActionIcon(action(OpenImageInNewWindow), KIcon("window-new"));
261  setActionIcon(action(CopyLinkToClipboard), KIcon("edit-copy"));
262  setActionIcon(action(CopyImageToClipboard), KIcon("edit-copy"));
263  setActionIcon(action(ToggleBold), KIcon("format-text-bold"));
264  setActionIcon(action(ToggleItalic), KIcon("format-text-italic"));
265  setActionIcon(action(ToggleUnderline), KIcon("format-text-underline"));
266  setActionIcon(action(DownloadLinkToDisk), KIcon("document-save"));
267  setActionIcon(action(DownloadImageToDisk), KIcon("document-save"));
268 
269  settings()->setWebGraphic(QWebSettings::MissingPluginGraphic, KIcon("preferences-plugin").pixmap(32, 32));
270  settings()->setWebGraphic(QWebSettings::MissingImageGraphic, KIcon("image-missing").pixmap(32, 32));
271  settings()->setWebGraphic(QWebSettings::DefaultFrameIconGraphic, KIcon("applications-internet").pixmap(32, 32));
272 
273  setActionShortcut(action(Back), KStandardShortcut::back());
274  setActionShortcut(action(Forward), KStandardShortcut::forward());
275  setActionShortcut(action(Reload), KStandardShortcut::reload());
276  setActionShortcut(action(Stop), KShortcut(QKeySequence(Qt::Key_Escape)));
277  setActionShortcut(action(Cut), KStandardShortcut::cut());
278  setActionShortcut(action(Copy), KStandardShortcut::copy());
279  setActionShortcut(action(Paste), KStandardShortcut::paste());
280  setActionShortcut(action(Undo), KStandardShortcut::undo());
281  setActionShortcut(action(Redo), KStandardShortcut::redo());
282  setActionShortcut(action(SelectAll), KStandardShortcut::selectAll());
283 }
284 
285 KWebPage::~KWebPage()
286 {
287  delete d;
288 }
289 
290 bool KWebPage::isExternalContentAllowed() const
291 {
292  KIO::AccessManager *manager = qobject_cast<KIO::AccessManager*>(networkAccessManager());
293  if (manager)
294  return manager->isExternalContentAllowed();
295  return true;
296 }
297 
298 KWebWallet *KWebPage::wallet() const
299 {
300  return d->wallet;
301 }
302 
303 void KWebPage::setAllowExternalContent(bool allow)
304 {
305  KIO::AccessManager *manager = qobject_cast<KIO::AccessManager*>(networkAccessManager());
306  if (manager)
307  manager->setExternalContentAllowed(allow);
308 }
309 
310 void KWebPage::setWallet(KWebWallet* wallet)
311 {
312  // Delete the current wallet if this object is its parent...
313  if (d->wallet && this == d->wallet->parent())
314  delete d->wallet;
315 
316  d->wallet = wallet;
317 
318  if (d->wallet)
319  d->wallet->setParent(this);
320 }
321 
322 
323 void KWebPage::downloadRequest(const QNetworkRequest& request)
324 {
325  KIO::TransferJob* job = KIO::get(request.url());
326  connect(job, SIGNAL(mimetype(KIO::Job*,QString)),
327  this, SLOT(_k_receivedContentType(KIO::Job*,QString)));
328  connect(job, SIGNAL(result(KJob*)),
329  this, SLOT(_k_receivedContentTypeResult(KJob*)));
330 
331  job->setMetaData(request.attribute(static_cast<QNetworkRequest::Attribute>(KIO::AccessManager::MetaData)).toMap());
332  job->addMetaData(QL1S("MaxCacheSize"), QL1S("0")); // Don't store in http cache.
333  job->addMetaData(QL1S("cache"), QL1S("cache")); // Use entry from cache if available.
334  job->ui()->setWindow(d->windowWidget());
335 }
336 
337 void KWebPage::downloadUrl(const KUrl &url)
338 {
339  downloadRequest(QNetworkRequest(url));
340 }
341 
342 void KWebPage::downloadResponse(QNetworkReply *reply)
343 {
344  Q_ASSERT(reply);
345 
346  if (!reply)
347  return;
348 
349  // Put the job on hold only for the protocols we know about (read: http).
350  KIO::Integration::AccessManager::putReplyOnHold(reply);
351 
352  QString mimeType;
353  KIO::MetaData metaData;
354 
355  if (handleReply(reply, &mimeType, &metaData)) {
356  return;
357  }
358 
359  const KUrl replyUrl (reply->url());
360 
361  // Ask KRun to handle the response when mimetype is unknown
362  if (mimeType.isEmpty()) {
363  (void)new KRun(replyUrl, d->windowWidget(), 0 , replyUrl.isLocalFile());
364  return;
365  }
366 
367  // Ask KRun::runUrl to handle the response when mimetype is inode/*
368  if (mimeType.startsWith(QL1S("inode/"), Qt::CaseInsensitive) &&
369  KRun::runUrl(replyUrl, mimeType, d->windowWidget(), false, false,
370  metaData.value(QL1S("content-disposition-filename")))) {
371  return;
372  }
373 }
374 
375 QString KWebPage::sessionMetaData(const QString &key) const
376 {
377  QString value;
378 
379  KIO::Integration::AccessManager *manager = qobject_cast<KIO::Integration::AccessManager *>(networkAccessManager());
380  if (manager)
381  value = manager->sessionMetaData().value(key);
382 
383  return value;
384 }
385 
386 QString KWebPage::requestMetaData(const QString &key) const
387 {
388  QString value;
389 
390  KIO::Integration::AccessManager *manager = qobject_cast<KIO::Integration::AccessManager *>(networkAccessManager());
391  if (manager)
392  value = manager->requestMetaData().value(key);
393 
394  return value;
395 }
396 
397 void KWebPage::setSessionMetaData(const QString &key, const QString &value)
398 {
399  KIO::Integration::AccessManager *manager = qobject_cast<KIO::Integration::AccessManager *>(networkAccessManager());
400  if (manager)
401  manager->sessionMetaData()[key] = value;
402 }
403 
404 void KWebPage::setRequestMetaData(const QString &key, const QString &value)
405 {
406  KIO::Integration::AccessManager *manager = qobject_cast<KIO::Integration::AccessManager *>(networkAccessManager());
407  if (manager)
408  manager->requestMetaData()[key] = value;
409 }
410 
411 void KWebPage::removeSessionMetaData(const QString &key)
412 {
413  KIO::Integration::AccessManager *manager = qobject_cast<KIO::Integration::AccessManager *>(networkAccessManager());
414  if (manager)
415  manager->sessionMetaData().remove(key);
416 }
417 
418 void KWebPage::removeRequestMetaData(const QString &key)
419 {
420  KIO::Integration::AccessManager *manager = qobject_cast<KIO::Integration::AccessManager *>(networkAccessManager());
421  if (manager)
422  manager->requestMetaData().remove(key);
423 }
424 
425 QString KWebPage::userAgentForUrl(const QUrl& _url) const
426 {
427  const KUrl url(_url);
428  const QString userAgent = KProtocolManager::userAgentForHost((url.isLocalFile() ? QL1S("localhost") : url.host()));
429 
430  if (userAgent == KProtocolManager::defaultUserAgent())
431  return QWebPage::userAgentForUrl(_url);
432 
433  return userAgent;
434 }
435 
436 static void setDisableCookieJarStorage(QNetworkAccessManager* manager, bool status)
437 {
438  if (manager) {
439  KIO::Integration::CookieJar *cookieJar = manager ? qobject_cast<KIO::Integration::CookieJar*>(manager->cookieJar()) : 0;
440  if (cookieJar) {
441  //kDebug(800) << "Store cookies ?" << !status;
442  cookieJar->setDisableCookieStorage(status);
443  }
444  }
445 }
446 
447 bool KWebPage::acceptNavigationRequest(QWebFrame *frame, const QNetworkRequest &request, NavigationType type)
448 {
449  kDebug(800) << "url:" << request.url() << ", type:" << type << ", frame:" << frame;
450 
451  if (frame && d->wallet && type == QWebPage::NavigationTypeFormSubmitted)
452  d->wallet->saveFormData(frame);
453 
454  // Make sure nothing is cached when private browsing mode is enabled...
455  if (settings()->testAttribute(QWebSettings::PrivateBrowsingEnabled)) {
456  if (!d->inPrivateBrowsingMode) {
457  setDisableCookieJarStorage(networkAccessManager(), true);
458  setSessionMetaData(QL1S("no-cache"), QL1S("true"));
459  d->inPrivateBrowsingMode = true;
460  }
461  } else {
462  if (d->inPrivateBrowsingMode) {
463  setDisableCookieJarStorage(networkAccessManager(), false);
464  removeSessionMetaData(QL1S("no-cache"));
465  d->inPrivateBrowsingMode = false;
466  }
467  }
468 
469  /*
470  If the navigation request is from the main frame, set the cross-domain
471  meta-data value to the current url for proper integration with KCookieJar...
472  */
473  if (frame == mainFrame() && type != QWebPage::NavigationTypeReload)
474  setSessionMetaData(QL1S("cross-domain"), request.url().toString());
475 
476  return QWebPage::acceptNavigationRequest(frame, request, type);
477 }
478 
479 bool KWebPage::handleReply(QNetworkReply* reply, QString* contentType, KIO::MetaData* metaData)
480 {
481  // Reply url...
482  const KUrl replyUrl (reply->url());
483 
484  // Get suggested file name...
485  const KIO::MetaData& data = reply->attribute(static_cast<QNetworkRequest::Attribute>(KIO::AccessManager::MetaData)).toMap();
486  const QString suggestedFileName = data.value(QL1S("content-disposition-filename"));
487  if (metaData) {
488  *metaData = data;
489  }
490 
491  // Get the mime-type...
492  QString mimeType;
493  extractMimeType(reply, mimeType);
494  if (contentType) {
495  *contentType = mimeType;
496  }
497 
498  // Let the calling function deal with handling empty or inode/* mimetypes...
499  if (mimeType.isEmpty() || mimeType.startsWith(QL1S("inode/"), Qt::CaseInsensitive)) {
500  return false;
501  }
502 
503  // Convert executable text files to plain text...
504  if (KParts::BrowserRun::isTextExecutable(mimeType))
505  mimeType = QL1S("text/plain");
506 
507  //kDebug(800) << "Content-disposition:" << suggestedFileName;
508  //kDebug(800) << "Got unsupported content of type:" << mimeType << "URL:" << replyUrl;
509  //kDebug(800) << "Error code:" << reply->error() << reply->errorString();
510 
511  if (isReplyStatusOk(reply)) {
512  while (true) {
513  KParts::BrowserOpenOrSaveQuestion::Result result;
514  KParts::BrowserOpenOrSaveQuestion dlg(d->windowWidget(), replyUrl, mimeType);
515  dlg.setSuggestedFileName(suggestedFileName);
516  dlg.setFeatures(KParts::BrowserOpenOrSaveQuestion::ServiceSelection);
517  result = dlg.askOpenOrSave();
518 
519  switch (result) {
520  case KParts::BrowserOpenOrSaveQuestion::Open:
521  // Handle Post operations that return content...
522  if (reply->operation() == QNetworkAccessManager::PostOperation) {
523  d->mimeType = mimeType;
524  QFileInfo finfo (suggestedFileName.isEmpty() ? replyUrl.fileName() : suggestedFileName);
525  KTemporaryFile tempFile;
526  tempFile.setSuffix(QL1C('.') + finfo.suffix());
527  tempFile.setAutoRemove(false);
528  tempFile.open();
529  KUrl destUrl;
530  destUrl.setPath(tempFile.fileName());
531  KIO::Job *job = KIO::file_copy(replyUrl, destUrl, 0600, KIO::Overwrite);
532  job->ui()->setWindow(d->windowWidget());
533  job->ui()->setAutoErrorHandlingEnabled(true);
534  connect(job, SIGNAL(result(KJob*)),
535  this, SLOT(_k_copyResultToTempFile(KJob*)));
536  return true;
537  }
538 
539  // Ask before running any executables...
540  if (KParts::BrowserRun::allowExecution(mimeType, replyUrl)) {
541  KService::Ptr offer = dlg.selectedService();
542  // HACK: The check below is necessary to break an infinite
543  // recursion that occurs whenever this function is called as a result
544  // of receiving content that can be rendered by the app using this engine.
545  // For example a text/html header that containing a content-disposition
546  // header is received by the app using this class.
547  if (isMimeTypeAssociatedWithSelf(offer)) {
548  reloadRequestWithoutDisposition(reply);
549  } else {
550  KUrl::List list;
551  list.append(replyUrl);
552  bool success = false;
553  // kDebug(800) << "Suggested file name:" << suggestedFileName;
554  if (offer) {
555  success = KRun::run(*offer, list, d->windowWidget() , false, suggestedFileName);
556  } else {
557  success = KRun::displayOpenWithDialog(list, d->windowWidget(), false, suggestedFileName);
558  if (!success)
559  break;
560  }
561  // For non KIO apps and cancelled Open With dialog, remove slave on hold.
562  if (!success || (offer && !offer->categories().contains(QL1S("KDE")))) {
563  KIO::SimpleJob::removeOnHold(); // Remove any slave-on-hold...
564  }
565  }
566  return true;
567  }
568  // TODO: Instead of silently failing when allowExecution fails, notify
569  // the user why the requested action cannot be fulfilled...
570  return false;
571  case KParts::BrowserOpenOrSaveQuestion::Save:
572  // Do not download local files...
573  if (!replyUrl.isLocalFile()) {
574  QString downloadCmd (reply->property("DownloadManagerExe").toString());
575  if (!downloadCmd.isEmpty()) {
576  downloadCmd += QLatin1Char(' ');
577  downloadCmd += KShell::quoteArg(replyUrl.url());
578  if (!suggestedFileName.isEmpty()) {
579  downloadCmd += QLatin1Char(' ');
580  downloadCmd += KShell::quoteArg(suggestedFileName);
581  }
582  // kDebug(800) << "download command:" << downloadCmd;
583  if (KRun::runCommand(downloadCmd, view()))
584  return true;
585  }
586  if (!downloadResource(replyUrl, suggestedFileName, d->windowWidget()))
587  break;
588  }
589  return true;
590  case KParts::BrowserOpenOrSaveQuestion::Cancel:
591  default:
592  KIO::SimpleJob::removeOnHold(); // Remove any slave-on-hold...
593  return true;
594  }
595  }
596  } else {
597  KService::Ptr offer = KMimeTypeTrader::self()->preferredService(mimeType);
598  if (isMimeTypeAssociatedWithSelf(offer)) {
599  reloadRequestWithoutDisposition(reply);
600  return true;
601  }
602  }
603 
604  return false;
605 }
606 
607 #include "kwebpage.moc"
608 
This file is part of the KDE documentation.
Documentation copyright © 1996-2013 The KDE developers.
Generated on Sat Feb 9 2013 12:25:55 by doxygen 1.8.2 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KDEWebKit

Skip menu "KDEWebKit"
  • Main Page
  • Namespace List
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdelibs-4.10.0 API Reference

Skip menu "kdelibs-4.10.0 API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal