[konqueror] /: Remove the web archiving plugin

Volker Krause null at kde.org
Sun Sep 15 12:18:17 BST 2019


Git commit 6e876efb99ac27d1d22f3340d064ac7a8c1ba9d7 by Volker Krause.
Committed on 15/09/2019 at 11:18.
Pushed by vkrause into branch 'master'.

Remove the web archiving plugin

Summary: It's only implemented for KHTML and depends heavily on DOM access API.

Reviewers: dfaure, stefanocrocco

Reviewed By: dfaure

Subscribers: kde-doc-english

Tags: #documentation

Maniphest Tasks: T11543

Differential Revision: https://phabricator.kde.org/D23958

M  +1    -18   doc/konqueror/index.docbook
M  +0    -1    konqueror.categories
M  +0    -1    plugins/CMakeLists.txt
D  +-    --    plugins/webarchiver/16-actions-webarchiver.png
D  +-    --    plugins/webarchiver/22-actions-webarchiver.png
D  +0    -41   plugins/webarchiver/CMakeLists.txt
D  +0    -3    plugins/webarchiver/Messages.sh
D  +0    -1372 plugins/webarchiver/archivedialog.cpp
D  +0    -274  plugins/webarchiver/archivedialog.h
D  +0    -124  plugins/webarchiver/archiveviewbase.ui
D  +0    -144  plugins/webarchiver/plugin_webarchiver.cpp
D  +0    -138  plugins/webarchiver/plugin_webarchiver.desktop
D  +0    -40   plugins/webarchiver/plugin_webarchiver.h
D  +0    -11   plugins/webarchiver/plugin_webarchiver.rc
D  +0    -117  plugins/webarchiver/webarchivecreator.cpp
D  +0    -55   plugins/webarchiver/webarchivecreator.h
D  +0    -67   plugins/webarchiver/webarchivethumbnail.desktop

https://commits.kde.org/konqueror/6e876efb99ac27d1d22f3340d064ac7a8c1ba9d7

diff --git a/doc/konqueror/index.docbook b/doc/konqueror/index.docbook
index ec87319a7..27323e34a 100644
--- a/doc/konqueror/index.docbook
+++ b/doc/konqueror/index.docbook
@@ -1710,14 +1710,6 @@ e-mail to a friend telling her about this wonderful new site.</para>
 <guimenuitem>Copy Image</guimenuitem> copies the &URL; of the picture 
 to the clipboard.</para>
 
-<para>To save a complete web page, including images, select <guimenuitem>
-Archive Web Page...</guimenuitem> from the <guimenu>Tools</guimenu> menu. 
-Note that this feature is provided by a <link linkend="konq-plugin">plugin 
-</link> and may not have been installed on your system. The web page will be 
-saved as a single file with a <literal role="extension">.war</literal> 
-extension and can be opened by <mousebutton>left</mousebutton> clicking 
-on the filename in &konqueror; running in File Manager mode.</para>
-
 <para>Printing a copy of the page you are viewing is easily done with the
 Menubar <menuchoice><guimenu>File</guimenu>
 <guimenuitem>Print...</guimenuitem></menuchoice> or <guimenuitem>Print
@@ -2251,7 +2243,7 @@ are listed in the dialog.</para>
 <title>Browser Mode</title>
 <!-- 
 FIXME 16.12
-KHTML:  Auto Refresh, HTML Settings, Minitools-Bookmarklets, Translate (disabled), Document Relations, Web Archiver, Search Bar
+KHTML:  Auto Refresh, HTML Settings, Minitools-Bookmarklets, Translate (disabled), Document Relations, Search Bar
 kwebkitpart for kf5 in extragear/base in branch frameworks
 WebKit only HTML Settings and Translate (disabled)
 WebEngine -> no extensions
@@ -2382,15 +2374,6 @@ The following menu items show a list of popular browsers such as <guimenuitem>Fi
 </listitem>
 </varlistentry>
 -->
-<varlistentry>
-<term>Archive Web Page (KHTML view only)</term>
-<listitem><para>Invoked with <menuchoice><guimenu>Tools</guimenu><guisubmenu>
-Archive Web Page</guisubmenu></menuchoice>, this tool creates an archive 
-(<literal role="extension">.war</literal> ) file containing the web page being 
-viewed including the images. <mousebutton>Left</mousebutton> click on the 
-archive file name to view the saved page.
-</para></listitem>
-</varlistentry>
 
 <varlistentry>
 <term>Auto Refresh (KHTML view only)</term>
diff --git a/konqueror.categories b/konqueror.categories
index 23498c31b..6ae0d8012 100644
--- a/konqueror.categories
+++ b/konqueror.categories
@@ -1,4 +1,3 @@
 org.kde.webenginepart webenginepart IDENTIFIER [WEBENGINEPART_LOG]
 org.kde.konqueror konqueror IDENTIFIER [KONQUEROR_LOG]
 org.kde.konqueror.minitools minitools (konqueror plugin) IDENTIFIER [MINITOOLSPLUGIN_LOG]
-org.kde.konqueror.webarchiver webarchiver (konqueror plugin) IDENTIFIER [WEBARCHIVERPLUGIN_LOG]
diff --git a/plugins/CMakeLists.txt b/plugins/CMakeLists.txt
index 643eca1d7..0193454d4 100644
--- a/plugins/CMakeLists.txt
+++ b/plugins/CMakeLists.txt
@@ -8,7 +8,6 @@ add_subdirectory( kimgalleryplugin )
 add_subdirectory( dirfilter )
 # TODO add_subdirectory( uachanger )
 add_subdirectory( babelfish )
-add_subdirectory( webarchiver )
 
 if (Qt5TextToSpeech_FOUND)
    add_subdirectory(ttsplugin)
diff --git a/plugins/webarchiver/16-actions-webarchiver.png b/plugins/webarchiver/16-actions-webarchiver.png
deleted file mode 100644
index 0f5b62ef4..000000000
Binary files a/plugins/webarchiver/16-actions-webarchiver.png and /dev/null differ
diff --git a/plugins/webarchiver/22-actions-webarchiver.png b/plugins/webarchiver/22-actions-webarchiver.png
deleted file mode 100644
index 536c73594..000000000
Binary files a/plugins/webarchiver/22-actions-webarchiver.png and /dev/null differ
diff --git a/plugins/webarchiver/CMakeLists.txt b/plugins/webarchiver/CMakeLists.txt
deleted file mode 100644
index 3487ecaa9..000000000
--- a/plugins/webarchiver/CMakeLists.txt
+++ /dev/null
@@ -1,41 +0,0 @@
-add_definitions(-DTRANSLATION_DOMAIN=\"webarchiver\")
-find_package(KF5 REQUIRED COMPONENTS KIO Archive KHtml)
-
-set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}  ${KDE4_ENABLE_EXCEPTIONS}")
-########### next target ###############
-
-set(webarchiverplugin_PART_SRCS plugin_webarchiver.cpp archivedialog.cpp )
-
-ecm_qt_declare_logging_category(webarchiverplugin_PART_SRCS HEADER webarchiverdebug.h IDENTIFIER WEBARCHIVERPLUGIN_LOG CATEGORY_NAME org.kde.konqueror.webarchiver)
-ki18n_wrap_ui(webarchiverplugin_PART_SRCS archiveviewbase.ui )
-
-add_library(webarchiverplugin MODULE ${webarchiverplugin_PART_SRCS})
-
-target_link_libraries(webarchiverplugin KF5::KHtml KF5::KDELibs4Support KF5::KIOCore KF5::Archive)
-install(TARGETS webarchiverplugin  DESTINATION ${KDE_INSTALL_PLUGINDIR} )
-
-
-########### next target ###############
-
-set(webarchivethumbnail_PART_SRCS webarchivecreator.cpp )
-
-add_library(webarchivethumbnail MODULE ${webarchivethumbnail_PART_SRCS})
-
-target_link_libraries(webarchivethumbnail KF5::KHtml KF5::KIOCore)
-
-install(TARGETS webarchivethumbnail  DESTINATION ${KDE_INSTALL_PLUGINDIR} )
-
-
-########### install files ###############
-
-install( FILES plugin_webarchiver.rc plugin_webarchiver.desktop  DESTINATION  ${KDE_INSTALL_DATADIR}/khtml/kpartplugins )
-install( FILES webarchivethumbnail.desktop  DESTINATION  ${KDE_INSTALL_KSERVICES5DIR} )
-
-ecm_install_icons(
-    ICONS
-        16-actions-webarchiver.png
-        22-actions-webarchiver.png
-    DESTINATION ${KDE_INSTALL_ICONDIR}
-    THEME hicolor
-)
-
diff --git a/plugins/webarchiver/Messages.sh b/plugins/webarchiver/Messages.sh
deleted file mode 100644
index ae4a4e04a..000000000
--- a/plugins/webarchiver/Messages.sh
+++ /dev/null
@@ -1,3 +0,0 @@
-#! /bin/sh
-$EXTRACTRC *.rc *.ui >> rc.cpp
-$XGETTEXT *.cpp -o $podir/webarchiver.pot
diff --git a/plugins/webarchiver/archivedialog.cpp b/plugins/webarchiver/archivedialog.cpp
deleted file mode 100644
index 979570fbc..000000000
--- a/plugins/webarchiver/archivedialog.cpp
+++ /dev/null
@@ -1,1372 +0,0 @@
-/*
-   Copyright (C) 2001 Andreas Schlapbach <schlpbch at iam.unibe.ch>
-   Copyright (C) 2003 Antonio Larrosa <larrosa at kde.org>
-   Copyright (C) 2008 Matthias Grimrath <maps4711 at gmx.de>
-
-   This program is free software; you can redistribute it and/or
-   modify it under the terms of the GNU General Public
-   License as published by the Free Software Foundation; either
-   version 2 of the License, or (at your option) any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program; see the file COPYING.  If not, write to
-   the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-   Boston, MA 02111-1307, USA.
-*/
-
-// The DOM-tree is recursed twice. The first run gathers all URLs while the second
-// run writes out all HTML frames and CSS stylesheets. These two distinct runs are
-// necessary, because some frames and/or stylesheets may be dropped (for example
-// a frame currently not displayed or deemed insecure). In that case an URL that
-// points to such a frame/stylesheet has to be removed. Since the URL may be mentioned
-// earlier before recursing to the to-be-removed frame, two runs are necessary to get
-// a complete list of URLs that should be archived.
-
-// Changelog
-// * replace dynamic_cast<> and ->inherits() with qobject_cast<>
-// * use QHash instead of QMap; get rid of Ordered<> class
-// * fixed crash / assertion on Konqueror exit after a webpage was archived
-//   See comment about KHTMLView parent widget in plugin_webarchiver.cpp
-// * Using KDE4/Qt4 QUrl::equals() and QUrl::fragment() to compare Urls
-// * KHTML stores comment with a trailing '-'. Looks like some off-by-one bug.
-// * Add mimetype indicating suffix to downloaded files.
-
-// DONE CSS mentioned in <link> elements that are not parsed by Konqueror did not get their
-//      href='' resolved/removed
-
-// TODO if href= etc links in a frameset refer to frames currently displayed, make links relative
-//      to archived page instead of absolute
-// TODO KDE4 webarchiver: look at m_bPreserveWS
-// TODO KDE4 webarchiver: look at closing tags
-// TODO check if PartFrameData::framesWithName get a 'KHTMLPart *' if any
-// TODO KHTMLPart::frames(): Is it possible to have NULL pointers in returned list?
-// TODO If downloaded object need no data conversion, use KIO::file_copy or signal data()
-// TODO KDE4 check what KHTMLPart is doing on job->addMetaData()
-// TODO KDE4 use HTMLScriptElementImpl::charset() to get charset="" attribute of <link> elements
-
-#include "archivedialog.h"
-
-#include <cassert>
-
-#include <QTextCodec>
-#include <QTextDocument>
-
-#include <ktar.h>
-#include <kauthorized.h>
-#include <kcharsets.h>
-#include <kmimetype.h>
-#include <kmessagebox.h>
-#include <kstringhandler.h>
-#include <kstandardguiitem.h>
-#include <KUrlAuthorized>
-
-#include <khtml_part.h>
-
-#include <kio/job.h>
-
-#include <dom/css_rule.h>
-#include <dom/css_stylesheet.h>
-#include <dom/css_value.h>
-
-#include "webarchiverdebug.h"
-
-// Set to true if you have a patched http-io-slave that has
-// improved offline-browsing functionality.
-static const bool patchedHttpSlave = false;
-
-#define CONTENT_TYPE "<meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\" />"
-
-//
-// Qt 4.x offers a @c foreach pseudo keyword. This is however slightly slower than FOR_ITER
-// because @c foreach makes a shared copy of the container.
-//
-#define FOR_ITER(type,var,it) for (type::iterator it(var.begin()), it##end(var.end()); it != it##end; ++it)
-#define FOR_CONST_ITER(type,var,it) for (type::const_iterator it(var.begin()), it##end(var.end()); it != it##end; ++it)
-#define FOR_ITER_TEMPLATE(type,var,it) for (typename type::iterator it(var.begin()), it##end(var.end()); it != it##end; ++it)
-
-static const mode_t archivePerms = S_IFREG | 0644;
-
-typedef QList<KParts::ReadOnlyPart *> ROPartList;
-
-//
-// functions needed for storing certain DOM elements in a QHash<>
-//
-namespace DOM
-{
-
-inline uint qHash(const CSSStyleSheet &a)
-{
-    return ::qHash(static_cast<void *>(a.handle()));
-}
-
-inline bool operator==(const DOM::CSSStyleSheet &a, const DOM::CSSStyleSheet &b)
-{
-    return a.handle() == b.handle();
-}
-
-inline uint qHash(const Node &a)
-{
-    return ::qHash(static_cast<void *>(a.handle()));
-}
-
-}// namespace DOM
-
-//
-// elems with 'type' attr: object, param, link, script, style
-//
-
-// TODO convert to bsearch? probably more time and memory efficient
-ArchiveDialog::NonCDataAttr::NonCDataAttr()
-{
-    static const char *const non_cdata[] = {
-        "id", "dir", "shape", "tabindex", "align", "nohref", "clear"
-        // Unfinished...
-    };
-    for (int i = 0; i != (sizeof(non_cdata) / sizeof(non_cdata[0])); ++i) {
-        insert(non_cdata[i]);
-    }
-}
-
-// TODO lazy init?
-ArchiveDialog::NonCDataAttr ArchiveDialog::non_cdata_attr;
-
-ArchiveDialog::RecurseData::RecurseData(KHTMLPart *_part, QTextStream *_textStream, PartFrameData *pfd)
-    : part(_part), textStream(_textStream), partFrameData(pfd), document(_part->htmlDocument()),
-      baseSeen(false)
-{
-    Q_ASSERT(!document.isNull());
-}
-
-static KHTMLPart *isArchivablePart(KParts::ReadOnlyPart *part)
-{
-    KHTMLPart *cp = qobject_cast<KHTMLPart *>(part);
-    if (! cp) {
-        return nullptr;
-    }
-    DOM::HTMLDocument domdoc(cp->htmlDocument());
-    if (domdoc.isNull()) {
-        return nullptr;
-    }
-    return cp;
-}
-
-ArchiveDialog::ArchiveDialog(QWidget *parent, const QString &filename, KHTMLPart *part)
-    : KDialog(parent), m_top(part), m_job(nullptr), m_uniqId(2), m_tarBall(nullptr), m_filename(filename), m_widget(nullptr)
-{
-    setCaption(i18nc("@title:window", "Web Archiver"));
-    setButtons(KDialog::Ok | KDialog::Cancel);
-    setButtonGuiItem(KDialog::Ok, KStandardGuiItem::close());
-    setModal(false);
-    enableButtonOk(false);
-    setDefaultButton(KDialog::NoDefault);
-
-    m_widget = new ArchiveViewBase(this);
-    {
-        QTreeWidgetItem *twi = m_widget->progressView->headerItem();
-        twi->setText(0, i18n("Status"));
-        twi->setText(1, i18n("Url"));
-    }
-    setMainWidget(m_widget);
-
-    QUrl srcURL = part->url();
-    m_widget->urlLabel->setText(QStringLiteral("<a href=\"") + srcURL.url() + "\">" +
-                                KStringHandler::csqueeze(srcURL.toDisplayString(), 80) + "</a>");
-    m_widget->targetLabel->setText(QStringLiteral("<a href=\"") + filename + "\">" +
-                                   KStringHandler::csqueeze(filename, 80) + "</a>");
-
-    //if(part->document().ownerDocument().isNull())
-    //   m_document = part->document();
-    //else
-    //   m_document = part->document().ownerDocument();
-
-    m_tarBall = new KTar(filename, QStringLiteral("application/x-gzip"));
-    m_archiveTime = QDateTime::currentDateTime();
-}
-
-ArchiveDialog::~ArchiveDialog()
-{
-    // TODO cancel outstanding download jobs?
-    qCDebug(WEBARCHIVERPLUGIN_LOG) << "destroying";
-    if (m_job) {
-        m_job->kill();
-        m_job = nullptr;
-    }
-    delete m_tarBall; m_tarBall = nullptr;
-}
-
-void ArchiveDialog::archive()
-{
-    if (m_tarBall->open(QIODevice::WriteOnly)) {
-
-        obtainURLs();
-
-        // Assign unique tarname to URLs
-        // Split m_url2tar into Stylesheets / non stylesheets
-        m_objects.clear();
-        assert(static_cast<ssize_t>(m_url2tar.size()) - static_cast<ssize_t>(m_cssURLs.size()) >= 0);
-//         m_objects.reserve(m_url2tar.size() - m_cssURLs.size());
-
-        FOR_ITER(UrlTarMap, m_url2tar, u2t_it) {
-            const QUrl &url = u2t_it.key();
-            DownloadInfo &info = u2t_it.value();
-
-            assert(info.tarName.isNull());
-//             info.tarName = uniqTarName( url.fileName(), 0 );
-
-            // To able to append mimetype hinting suffixes to tarnames, for instance adding '.gif' to a
-            // webbug '87626734' adding the name to the url-to-tarname map is deferred.
-            // This cannot be done with CSS because CSS may reference each other so when URLS
-            // of the first CSS are changed all tarnames need to be there.
-            //
-            if (m_cssURLs.find(url) == m_cssURLs.end()) {
-                m_objects.append(u2t_it);
-            } else {
-                info.tarName = uniqTarName(url.fileName(), nullptr);
-            }
-        }
-
-        QProgressBar *pb = m_widget->progressBar;
-        pb->setMaximum(m_url2tar.count() + 1);
-        pb->setValue(0);
-
-        m_objects_it = m_objects.begin();
-        downloadObjects();
-
-    } else {
-        const QString title = i18nc("@title:window", "Unable to Open Web-Archive");
-        const QString text = i18n("Unable to open \n %1 \n for writing.", m_tarBall->fileName());
-        KMessageBox::sorry(nullptr, text, title);
-    }
-}
-
-void ArchiveDialog::downloadObjects()
-{
-
-    if (m_objects_it == m_objects.end()) {
-
-        m_styleSheets_it = m_cssURLs.begin();
-        downloadStyleSheets();
-
-    } else {
-
-        m_dlurl2tar_it = (*m_objects_it);
-        const QUrl &url    = m_dlurl2tar_it.key();
-        DownloadInfo &info = m_dlurl2tar_it.value();
-        assert(m_dlurl2tar_it != m_url2tar.end());
-
-        Q_ASSERT(m_job == nullptr);
-        m_job = startDownload(url, info.part);
-        connect(m_job, SIGNAL(result(KJob*)), SLOT(slotObjectFinished(KJob*)));
-    }
-}
-
-void ArchiveDialog::slotObjectFinished(KJob *_job)
-{
-    KIO::StoredTransferJob *job = qobject_cast<KIO::StoredTransferJob *>(_job);
-    Q_ASSERT(job == m_job);
-    m_job = nullptr;
-    const QUrl &url    = m_dlurl2tar_it.key();
-    DownloadInfo &info = m_dlurl2tar_it.value();
-
-    assert(info.tarName.isNull());
-    bool error = job->error();
-    if (!error) {
-        const QString &mimetype(job->mimetype());
-        info.tarName = uniqTarName(appendMimeTypeSuffix(url.fileName(), mimetype), nullptr);
-
-        QByteArray data(job->data());
-        const QString &tarName = info.tarName;
-
-//         qCDebug(WEBARCHIVERPLUGIN_LOG) << "downloaded " << url.toDisplayString() << "size=" << data.size() << "mimetype" << mimetype;
-        error = ! m_tarBall->writeFile(tarName, data, archivePerms, QString::null, QString::null,
-                                       m_archiveTime, m_archiveTime, m_archiveTime);
-        if (error) {
-            qCDebug(WEBARCHIVERPLUGIN_LOG) << "Error writing to archive file";
-            finishedArchiving(true);
-            return;
-        }
-    } else {
-        info.tarName.clear();
-        qCDebug(WEBARCHIVERPLUGIN_LOG) << "download error for url='" << url;
-    }
-
-    endProgressInfo(error);
-    ++m_objects_it;
-    downloadObjects();
-}
-
-void ArchiveDialog::downloadStyleSheets()
-{
-    if (m_styleSheets_it == m_cssURLs.end()) {
-
-        saveWebpages();
-
-    } else {
-
-//         QTimer::singleShot(3000, this, SLOT(slotDownloadStyleSheetsDelay()));
-        const QUrl &url = m_styleSheets_it.key();
-        m_dlurl2tar_it = m_url2tar.find(url);
-        assert(m_dlurl2tar_it != m_url2tar.end());
-        DownloadInfo &info = m_dlurl2tar_it.value();
-
-        Q_ASSERT(m_job == nullptr);
-        m_job = startDownload(url, info.part);
-        connect(m_job, SIGNAL(result(KJob*)), SLOT(slotStyleSheetFinished(KJob*)));
-    }
-}
-
-void ArchiveDialog::slotStyleSheetFinished(KJob *_job)
-{
-    KIO::StoredTransferJob *job = qobject_cast<KIO::StoredTransferJob *>(_job);
-    Q_ASSERT(job == m_job);
-    m_job = nullptr;
-    const QUrl &url    = m_dlurl2tar_it.key();
-    DownloadInfo &info = m_dlurl2tar_it.value();
-
-    bool error = job->error();
-    if (! error) {
-        QByteArray data(job->data());
-        const QString &tarName = info.tarName;
-
-        URLsInStyleSheet::Iterator uss_it = m_URLsInStyleSheet.find(m_styleSheets_it.value());
-        assert(uss_it != m_URLsInStyleSheet.end());
-
-        DOM::DOMString ds(uss_it.key().charset());
-        QString cssCharSet(ds.string());
-        bool ok;
-        QTextCodec *codec = KCharsets::charsets()->codecForName(cssCharSet, ok);
-        qCDebug(WEBARCHIVERPLUGIN_LOG) << "translating URLs in CSS" << url << "charset=" << cssCharSet << " found=" << ok;
-        assert(codec);
-        QString css_text = codec->toUnicode(data);
-        data.clear();
-        // Do *NOT* delete 'codec'!  These are allocated by Qt
-
-        changeCSSURLs(css_text, uss_it.value());
-        data = codec->fromUnicode(css_text);
-        css_text.clear();
-
-        error = ! m_tarBall->writeFile(tarName, data, archivePerms, QString::null, QString::null,
-                                       m_archiveTime, m_archiveTime, m_archiveTime);
-        if (error) {
-            qCDebug(WEBARCHIVERPLUGIN_LOG) << "Error writing to archive file";
-            finishedArchiving(true);
-            return;
-        }
-    } else {
-        info.tarName.clear();
-        qCDebug(WEBARCHIVERPLUGIN_LOG) << "download error for css url='" << url;
-    }
-
-    endProgressInfo(error);
-    ++m_styleSheets_it;
-    downloadStyleSheets();
-}
-
-KIO::Job *ArchiveDialog::startDownload(const QUrl &url, KHTMLPart *part)
-{
-    QTreeWidgetItem *twi = new QTreeWidgetItem;
-    twi->setText(0, i18n("Downloading"));
-    twi->setText(1, url.toDisplayString());
-    QTreeWidget *tw = m_widget->progressView;
-    tw->insertTopLevelItem(0, twi);
-
-    KIO::Job *job = KIO::storedGet(url, KIO::NoReload, KIO::HideProgressInfo);
-
-    // Use entry from cache only. Avoids re-downloading. Requires modified kio_http slave.
-    job->addMetaData(QStringLiteral("cache"), patchedHttpSlave ? "cacheonly" : "cache");
-
-    // This is a duplication of the code in loader.cpp: Loader::servePendingRequests()
-
-    //job->addMetaData("accept", req->object->accept());
-    job->addMetaData(QStringLiteral("referrer"), part->url().url());
-    job->addMetaData(QStringLiteral("cross-domain"), part->toplevelURL().url());
-
-    return job;
-}
-
-void ArchiveDialog::endProgressInfo(bool error)
-{
-    QTreeWidget *tw = m_widget->progressView;
-    tw->topLevelItem(0)->setText(0, error ? i18n("Error") : i18n("OK"));
-    QProgressBar *pb = m_widget->progressBar;
-    pb->setValue(pb->value() + 1);
-}
-
-void ArchiveDialog::saveWebpages()
-{
-    bool error = saveTopFrame();
-    if (error) {
-        qCDebug(WEBARCHIVERPLUGIN_LOG) << "Error writing to archive file";
-        finishedArchiving(true);
-        return;
-    }
-    QProgressBar *pb = m_widget->progressBar;
-    pb->setValue(pb->value() + 1);
-
-//     KMessageBox::information(0, i18n( "Archiving webpage completed." ), QString::null, QString::null, false);
-    finishedArchiving(false);
-}
-
-void ArchiveDialog::finishedArchiving(bool tarerror)
-{
-    if (tarerror) {
-        KMessageBox::error(this, i18n("I/O error occurred while writing to web archive file %1.", m_tarBall->fileName()));
-    }
-    m_tarBall->close();
-
-    m_widget->progressView->sortItems(0, Qt::AscendingOrder);
-    setDefaultButton(KDialog::Ok);
-    setEscapeButton(KDialog::Ok);
-    enableButtonOk(true);
-    enableButtonCancel(false);
-}
-
-void ArchiveDialog::slotButtonClicked(int)
-{
-    deleteLater();  // Keep memory consumption low
-}
-
-// This is the mess you get because C++ lacks a lambda generator
-//
-// The whole purpose of the Get* classes is to parametrize what
-// attribute of a KHTMLPart object should be fetched.
-//
-// GetName and GetURL are used for the 'class FuncObj' parameter
-// class in the template function filterFrameMappings below
-struct GetFromPart {
-    const KHTMLPart *child;
-
-    GetFromPart(const KHTMLPart *_child) : child(_child) { }
-};
-
-struct GetName : public GetFromPart {
-    GetName(const KHTMLPart *child) : GetFromPart(child) { }
-
-    operator QString()
-    {
-        return child->objectName();
-    }
-};
-struct GetURL : public GetFromPart {
-    GetURL(const KHTMLPart *child) : GetFromPart(child) { }
-
-    operator QUrl()
-    {
-        return child->url();
-    }
-};
-
-template< class Id2Part, class FuncObj >
-static void filterFrameMappings(KHTMLPart *part, Id2Part &result)
-{
-    Id2Part existing_frames;
-
-    // TODO this can probably be optimized: no temp of existing, directly store to be removed parts.
-    ROPartList childParts(part->frames());
-    FOR_ITER(ROPartList, childParts, child_it) {
-        // TODO It is not clear from browsing the source code of KHTML if *child_it may be NULL
-        Q_ASSERT(*child_it);
-        KHTMLPart *cp = isArchivablePart(*child_it);
-        if (cp) {
-            existing_frames.insert(FuncObj(cp), cp);
-        }
-    }
-
-    typedef QList< typename Id2Part::Iterator > IdRemoveList;
-    IdRemoveList beRemoved;
-
-    FOR_ITER_TEMPLATE(Id2Part, result, it) {
-        typename Id2Part::Iterator exists_it = existing_frames.find(it.key());
-        if (exists_it == existing_frames.end()) {
-            beRemoved.append(it);
-        } else {
-            it.value() = exists_it.value();
-        }
-    }
-    FOR_ITER_TEMPLATE(IdRemoveList, beRemoved, rem_it) {
-        qCDebug(WEBARCHIVERPLUGIN_LOG) << "removing insecure(?) frame='" << (*rem_it).key();
-        result.erase((*rem_it));
-    }
-}
-
-template void filterFrameMappings< ArchiveDialog::Name2Part, GetName >(KHTMLPart *, ArchiveDialog::Name2Part &);
-template void filterFrameMappings< ArchiveDialog::URL2Part, GetURL >(KHTMLPart *, ArchiveDialog::URL2Part &);
-
-/**
- * Recursively traverses the DOM-Tree extracting all URLs that need to be downloaded
- */
-void ArchiveDialog::obtainURLs()
-{
-    m_url2tar.clear();
-    m_tarName2part.clear();
-    m_framesInPart.clear();
-    m_cssURLs.clear();
-    m_URLsInStyleSheet.clear();
-    m_URLsInStyleElement.clear();
-    m_topStyleSheets.clear();
-
-    obtainURLsLower(m_top, 0);
-
-    FOR_ITER(FramesInPart, m_framesInPart, fip_it) {
-        KHTMLPart     *part = fip_it.key();
-        PartFrameData &pfd  = fip_it.value();
-
-        // Remove all frames obtained from the DOM tree parse
-        // that do not have a corresponding KHTMLPart as a direct child.
-
-        // Do NOT use KHTMLPart::findFrame()! This one searches recursively all subframes as well!
-        filterFrameMappings< Name2Part, GetName >(part, pfd.framesWithName);
-        filterFrameMappings< URL2Part, GetURL >(part, pfd.framesWithURLOnly);
-    }
-    assert(! m_framesInPart.empty());
-#if 0
-    FOR_ITER(CSSURLSet, m_cssURLs, it) {
-        qCDebug(WEBARCHIVERPLUGIN_LOG) << "to be downloaded stylesheet='" << it.key();
-    }
-    FOR_ITER(URLsInStyleSheet, m_URLsInStyleSheet, ss2u_it) {
-        qCDebug(WEBARCHIVERPLUGIN_LOG) << "raw URLs in sheet='" << ss2u_it.key().href();
-        FOR_ITER(RawHRef2FullURL, ss2u_it.data(), c2f_it) {
-            qCDebug(WEBARCHIVERPLUGIN_LOG) << "   url='" << c2f_it.key() << "' -> '" << c2f_it.data().toDisplayString();
-        }
-    }
-    FOR_ITER(URLsInStyleElement, m_URLsInStyleElement, e2u_it) {
-        qCDebug(WEBARCHIVERPLUGIN_LOG) << "raw URLs in style-element:";
-        FOR_ITER(RawHRef2FullURL, e2u_it.data(), c2f_it) {
-            qCDebug(WEBARCHIVERPLUGIN_LOG) << "   url='" << c2f_it.key() << "' -> '" << c2f_it.data().toDisplayString();
-        }
-    }
-#endif
-}
-
-void ArchiveDialog::obtainStyleSheetURLsLower(DOM::CSSStyleSheet css, RecurseData &data)
-{
-
-    //qCDebug(WEBARCHIVERPLUGIN_LOG) << "stylesheet title='" << styleSheet.title().string() << "' "
-    //                "type='" << styleSheet.type().string();
-
-    RawHRef2FullURL &raw2full = m_URLsInStyleSheet.insert(css, RawHRef2FullURL()).value();
-
-    DOM::CSSRuleList crl = css.cssRules();
-    for (int j = 0; j != static_cast<int>(crl.length()); ++j) {
-
-        DOM::CSSRule cr = crl.item(j);
-        switch (cr.type()) {
-
-        case DOM::CSSRule::STYLE_RULE: {
-            const DOM::CSSStyleRule &csr = static_cast<DOM::CSSStyleRule &>(cr);
-
-            //qCDebug(WEBARCHIVERPLUGIN_LOG) << "found selector '" << csr.selectorText();
-            parseStyleDeclaration(css.baseUrl(), csr.style(), raw2full, data);
-        } break;
-
-        case DOM::CSSRule::IMPORT_RULE: {
-            const DOM::CSSImportRule &cir = static_cast<DOM::CSSImportRule &>(cr);
-
-            DOM::CSSStyleSheet importSheet = cir.styleSheet();
-            if (importSheet.isNull()) {
-
-                // Given stylesheet was not downloaded / parsed by KHTML
-                // Remove that URL from the stylesheet
-                qCDebug(WEBARCHIVERPLUGIN_LOG) << "stylesheet: invalid @import url('" << cir.href() << "')";
-
-                raw2full.insert(cir.href().string(), QUrl());
-
-            } else {
-
-                qCDebug(WEBARCHIVERPLUGIN_LOG) << "stylesheet: @import url('" << cir.href() << "') found";
-
-                QString href = cir.href().string();
-                Q_ASSERT(!href.isNull());
-
-                QUrl fullURL  = importSheet.baseUrl();
-                bool inserted = insertHRefFromStyleSheet(href, raw2full, fullURL, data);
-                if (inserted) {
-                    m_cssURLs.insert(fullURL, importSheet);
-                    obtainStyleSheetURLsLower(importSheet, data);
-                }
-            }
-        } break;
-
-        default:
-            qCDebug(WEBARCHIVERPLUGIN_LOG) << " unknown/unsupported rule=" << cr.type();
-        }
-    }
-}
-
-void ArchiveDialog::obtainURLsLower(KHTMLPart *part, int level)
-{
-    //QString indent;
-    //indent.fill(' ', level*2);
-
-    QString htmlFileName = (level == 0) ? QStringLiteral("index.html") : part->url().fileName();
-
-    // Add .html extension if not found already.  This works around problems with frames,
-    // where the frame is for example "framead.php".  The http-io-slave gets the mimetype
-    // from the webserver, but files in a tar archive do not have such metadata.  The result
-    // is that Konqueror asks "save 'adframe.php' to file?" without this measure.
-    htmlFileName = appendMimeTypeSuffix(htmlFileName, QStringLiteral("text/html"));
-
-    // If level == 0, the m_tarName2part map is empty and so uniqTarName will return "index.html" unchanged.
-    uniqTarName(htmlFileName, part);
-
-    assert(m_framesInPart.find(part) == m_framesInPart.end());
-    FramesInPart::Iterator fip_it = m_framesInPart.insert(part, PartFrameData());
-
-    RecurseData data(part, nullptr, &(fip_it.value()));
-    data.document.documentElement();
-    obtainPartURLsLower(data.document.documentElement(), 1, data);
-    {
-        // Limit lifetime of @c childParts
-        ROPartList childParts(part->frames());
-        FOR_ITER(ROPartList, childParts, child_it) {
-            KHTMLPart *cp = isArchivablePart(*child_it);
-            if (cp) {
-                obtainURLsLower(cp, level + 1);
-            }
-        }
-    }
-
-    DOM::StyleSheetList styleSheetList = data.document.styleSheets();
-    //qCDebug(WEBARCHIVERPLUGIN_LOG) << "# of stylesheets=" << styleSheetList.length();
-    for (int i = 0; i != static_cast<int>(styleSheetList.length()); ++i) {
-        DOM::StyleSheet ss = styleSheetList.item(i);
-        if (ss.isCSSStyleSheet()) {
-            DOM::CSSStyleSheet &css = static_cast<DOM::CSSStyleSheet &>(ss);
-
-            QString href = css.href().string();
-            if (! href.isNull()) {
-                QString href  = css.href().string();
-                QUrl fullUrl  = css.baseUrl();
-                qCDebug(WEBARCHIVERPLUGIN_LOG) << "top-level stylesheet='" << href;
-                bool inserted = insertTranslateURL(fullUrl, data);
-                if (inserted) {
-                    m_cssURLs.insert(fullUrl, css);
-                }
-            } else {
-                DOM::Node node = css.ownerNode();
-                if (! node.isNull()) {
-                    assert(! m_topStyleSheets.contains(node));
-                    qCDebug(WEBARCHIVERPLUGIN_LOG) << "top-level inline stylesheet '" << node.nodeName();
-                    // TODO I think there can be more than one <style> area...
-                    assert(href.isNull());
-                    m_topStyleSheets.insert(node, css);
-
-                } else {
-                    qCDebug(WEBARCHIVERPLUGIN_LOG) << "found loose style sheet '" << node.nodeName();
-                    assert(0); // FIXME for testing only
-                }
-            }
-            obtainStyleSheetURLsLower(css, data);
-        }
-    }
-}
-
-void ArchiveDialog::obtainPartURLsLower(const DOM::Node &pNode, int level, RecurseData &data)
-{
-    const QString nodeName = pNode.nodeName().string().toUpper();
-
-    QString indent;
-    indent.fill(' ', level * 2);
-
-    if (!pNode.isNull() && (pNode.nodeType() == DOM::Node::ELEMENT_NODE)) {
-        const DOM::Element &element = static_cast<const DOM::Element &>(pNode);
-
-        if (const_cast<DOM::Element &>(element).hasAttribute("STYLE")) {
-            RawHRef2FullURL &raw2full = m_URLsInStyleElement.insert(element, RawHRef2FullURL()).value();
-            parseStyleDeclaration(data.part->url(), const_cast<DOM::Element &>(element).style(),
-                                  raw2full, data);
-        }
-
-        if (nodeName == QLatin1String("BASE")) {
-            data.baseSeen = true;
-        }
-
-        ExtractURLs eurls(nodeName, element);
-        const AttrList::iterator invalid = eurls.attrList.end();
-
-        if (eurls.frameName != invalid) {
-
-            // If a frame tag has a name tag, the src attribute will be overwritten
-            // This ensures the current selected frame is saved and not the default
-            // frame given by the original 'src' attribute
-            data.partFrameData->framesWithName.insert((*eurls.frameName).value, nullptr);
-
-        } else if (eurls.frameURL != invalid) {
-
-            // URL has no 'name' attribute.  This frame cannot(?) change, so 'src' should
-            // identify it unambigously
-            QUrl _frameURL = absoluteURL((*eurls.frameURL).value, data);
-            if (!urlCheckFailed(data.part, _frameURL)) {
-                data.partFrameData->framesWithURLOnly.insert(QUrl(_frameURL.url()), nullptr);
-            }
-
-        } else {
-            // Ignore empty frame tags
-        }
-
-        if (eurls.transURL != invalid) {
-            // Kills insecure/invalid links. Frames are treated separately.
-            insertTranslateURL(absoluteURL(parseURL((*eurls.transURL).value), data), data);
-        }
-
-        // StyleSheet-URLs are compared against the internal stylesheets data structures
-        // Treatment is similar to frames
-    }
-
-    if (! pNode.isNull()) {
-        DOM::Node child = pNode.firstChild();
-        while (! child.isNull()) {
-            obtainPartURLsLower(child, level + 1, data);
-            child = child.nextSibling();
-        }
-    }
-}
-
-// Kill insecure/invalid links. Frames are treated separately.
-
-bool ArchiveDialog::insertTranslateURL(const QUrl &fullURL, RecurseData &data)
-{
-    if (!urlCheckFailed(data.part, fullURL)) {
-//         qCDebug(WEBARCHIVERPLUGIN_LOG) << "adding '" << fullURL << "' to to-be-downloaded URLs";
-        m_url2tar.insert(fullURL, DownloadInfo(QString::null, data.part));
-        return true;
-    } else {
-        qCDebug(WEBARCHIVERPLUGIN_LOG) << "URL check failed on '" << fullURL << "' -- skipping";
-        return false;
-    }
-}
-
-bool ArchiveDialog::insertHRefFromStyleSheet(const QString &hrefRaw, RawHRef2FullURL &raw2full,
-        const QUrl &fullURL, RecurseData &data)
-{
-    bool inserted = insertTranslateURL(fullURL, data);
-
-#if 0
-    if (inserted) {
-        qCDebug(WEBARCHIVERPLUGIN_LOG) << "stylesheet: found url='"
-                      << fullURL.toDisplayString() << "' hrefRaw='" << hrefRaw;
-    } else {
-        qCDebug(WEBARCHIVERPLUGIN_LOG) << "stylesheet: killing insecure/invalid url='"
-                      << fullURL.toDisplayString() << "' hrefRaw='" << hrefRaw;
-    }
-#endif
-
-    raw2full.insert(hrefRaw, inserted ? fullURL : QUrl());
-    return inserted;
-}
-
-void ArchiveDialog::parseStyleDeclaration(const QUrl &baseURL, DOM::CSSStyleDeclaration decl,
-        RawHRef2FullURL &raw2full, RecurseData &data /*, bool verbose*/)
-{
-    for (int k = 0; k != static_cast<int>(decl.length()); ++k) {
-        DOM::DOMString item  = decl.item(k);
-        DOM::DOMString val   = decl.getPropertyValue(item);
-        //DOM::CSSValue  csval = decl.getPropertyCSSValue(item);
-
-//         qCDebug(WEBARCHIVERPLUGIN_LOG) << "style declaration " << item << ":" << val << ";";
-
-        QString href = extractCSSURL(val.string());
-        if (href != QString::null) {
-
-//             qCDebug(WEBARCHIVERPLUGIN_LOG) << "URL in CSS " << item << ":" << val << ";";
-
-            // TODO Would like to use khtml::parseURL to remove \r, \n and similar
-            QString parsedURL = parseURL(href);
-
-//             qCDebug(WEBARCHIVERPLUGIN_LOG) << "found URL='" << val << "' extracted='" << parsedURL << "'";
-            insertHRefFromStyleSheet(href, raw2full, QUrl(baseURL).resolved(QUrl(parsedURL)), data);
-        }
-    }
-}
-
-/* Saves all frames, starting from top */
-
-bool ArchiveDialog::saveTopFrame()
-{
-    m_part2tarName.clear();
-
-    FOR_ITER(TarName2Part, m_tarName2part, t2p_it) {
-        if (t2p_it.value() != nullptr) {
-            m_part2tarName.insert(t2p_it.value(), t2p_it.key());
-        }
-    }
-
-    return saveFrame(m_top, 0);
-}
-
-bool ArchiveDialog::saveFrame(KHTMLPart *part, int level)
-{
-
-    // Rebuild HTML file from 'part' and write to tar archive
-
-    QByteArray rawtext;
-    {
-        FramesInPart::Iterator fip_it = m_framesInPart.find(part);
-        assert(fip_it != m_framesInPart.end());
-        PartFrameData *pfd = &(fip_it.value());
-
-        //
-        // Overloading madness: Note the @c &rawtext : If you accidentally write @c rawtext
-        // it still compiles but it uses a different ctor that does not write to @c rawtext
-        // but initializes @c textStream with @c rawtext
-        //
-        QTextStream textStream(&rawtext, QIODevice::WriteOnly);
-        textStream.setCodec(QTextCodec::codecForMib(106));       // 106 == UTF-8
-        RecurseData data(part, &textStream, pfd);
-        saveHTMLPart(data);
-    } // @c textStream destroyed and flushed
-
-    Part2TarName::Iterator p2tn_it = m_part2tarName.find(part);
-    assert(p2tn_it != m_part2tarName.end());
-    const QString &tarName = p2tn_it.value();
-
-    qCDebug(WEBARCHIVERPLUGIN_LOG) << "writing part='" << part->url() << "' to tarfile='" << tarName
-                  << "' size=" << rawtext.size();
-    bool error = ! m_tarBall->writeFile(tarName, rawtext, archivePerms, QString::null, QString::null,
-                                        m_archiveTime, m_archiveTime, m_archiveTime);
-    if (error) {
-        return true;
-    }
-
-    // Recursively handle all frames / subparts
-    {
-        // Limit lifetime of @c childParts
-        ROPartList childParts(part->frames());
-        FOR_ITER(ROPartList, childParts, child_it) {
-            KHTMLPart *cp = isArchivablePart(*child_it);
-            if (cp) {
-                error = saveFrame(cp, level + 1);
-                if (error) {
-                    return true;
-                }
-            }
-        }
-    }
-
-    return false;
-}
-
-// Saves the frame given in @c data.part
-
-void ArchiveDialog::saveHTMLPart(RecurseData &data)
-{
-    QTextStream &textStream(*data.textStream);
-    // Add a doctype
-    DOM::DocumentType t(data.document.doctype());
-    if (! t.isNull()) {
-        DOM::DOMString name(t.name());
-        DOM::DOMString publicId(t.publicId());
-
-        if (!name.isEmpty() && !publicId.isEmpty()) {
-            textStream << "<!DOCTYPE " << name.string() << " PUBLIC \"" << publicId.string() << "\"";
-            DOM::DOMString systemId(t.systemId());
-            if (!systemId.isEmpty()) {
-                textStream << " \"" << systemId.string() << "\"";
-            }
-            textStream << ">\n";
-        }
-    }
-
-    textStream << "<!-- saved from: " << data.part->url().toDisplayString() << " -->\n";
-
-    try {
-        saveHTMLPartLower(data.document.documentElement(), 1, data);
-    } catch (...) {
-        qCDebug(WEBARCHIVERPLUGIN_LOG) << "exception";
-        Q_ASSERT(0);
-    }
-}
-
-void ArchiveDialog::saveHTMLPartLower(const DOM::Node &pNode, int level, RecurseData &data)
-{
-    const QString nodeName(pNode.nodeName().string().toUpper());
-
-    //QString indent;
-    //indent.fill(' ', level*2);
-
-    bool skipElement   = false;
-    bool fullEmptyTags = false;
-    bool hasChildren   = const_cast<DOM::Node &>(pNode).hasChildNodes();
-    QString text = QLatin1String("");
-
-    bool isElement = !pNode.isNull() && (pNode.nodeType() == DOM::Node::ELEMENT_NODE);
-
-    //qCDebug(WEBARCHIVERPLUGIN_LOG) << indent << "nodeName=" << nodeName << " toString()='" << pNode.toString() << "'";
-    if (isElement) {
-        const DOM::Element &element = static_cast<const DOM::Element &>(pNode);
-        URLsInStyleElement::Iterator style_it = m_URLsInStyleElement.find(element);
-        bool hasStyle = (style_it != m_URLsInStyleElement.end());
-
-        if ((nodeName == QLatin1String("META")) && hasAttrWithValue(element, QStringLiteral("HTTP-EQUIV"), QStringLiteral("CONTENT-TYPE"))) {
-            // Skip content-type meta tag, we provide our own.
-            skipElement = true;
-        } else if ((nodeName == QLatin1String("NOFRAMES")) && !hasChildren) {
-            skipElement = true;
-        } else {
-
-            // translate URLs of stylesheets, jscript, images ...
-
-            ExtractURLs eurls(nodeName, element);
-
-            AttrList::Iterator filterOut1 = eurls.attrList.end();
-            AttrList::Iterator filterOut2 = eurls.attrList.end();
-            const AttrList::Iterator invalid = eurls.attrList.end();
-
-            // make URLs in hyperref links absolute
-            if (eurls.absURL != invalid) {
-                QUrl baseurl = absoluteURL(QLatin1String(""), data);
-                QUrl newurl = QUrl(baseurl).resolved(QUrl(parseURL((*eurls.absURL).value)));
-                if (urlCheckFailed(data.part, newurl)) {
-                    (*eurls.absURL).value = QLatin1String("");
-                    qCDebug(WEBARCHIVERPLUGIN_LOG) << "removing invalid/insecure href='" << newurl << "'";
-                } else {
-                    //
-                    // KUrl::htmlRef() calls internally fragment()->toPercent()->toLatin1()->fromLatin1()->fromPercent()
-                    // This is slow of course and there would be only a difference if there is some suburl.
-                    // Since we discard any urls with suburls for security reasons QUrl::fragment() is sufficient.
-                    //
-                    if (newurl.hasFragment() && baseurl.matches(newurl, QUrl::RemoveFragment)) {
-                        (*eurls.absURL).value = QStringLiteral("#") + newurl.fragment();
-                    } else {
-                        (*eurls.absURL).value = newurl.url();
-                    }
-                }
-            }
-
-            // make URLs of embedded objects local to tarfile
-            if (eurls.transURL != invalid) {
-                // NOTE This is a bit inefficient, because the URL is computed twice, here and when obtaining all
-                // URLs first. However it is necessary, because two URLs that look different in the HTML frames (for
-                // example absolute and relative) may resolve to the same absolute URL
-                QUrl fullURL = absoluteURL(parseURL((*eurls.transURL).value), data);
-                UrlTarMap::Iterator it = m_url2tar.find(fullURL);
-                if (it == m_url2tar.end()) {
-
-                    (*eurls.transURL).value = QLatin1String("");
-                    qCDebug(WEBARCHIVERPLUGIN_LOG) << "removing invalid/insecure link='" << fullURL << "'";
-
-                } else {
-//                     assert( !it.value().tarName.isNull() );
-                    (*eurls.transURL).value = it.value().tarName;
-                }
-            }
-
-            // Check stylesheet <link>s
-            if (eurls.cssURL != invalid) {
-
-                QUrl fullURL = absoluteURL((*eurls.cssURL).value, data);
-                UrlTarMap::Iterator it = m_url2tar.find(fullURL);
-
-                if (it == m_url2tar.end()) {
-
-                    qCDebug(WEBARCHIVERPLUGIN_LOG) << "removing invalid/insecure CSS link='" << fullURL << "'";
-                    (*eurls.cssURL).value = QLatin1String("");
-
-                } else {
-//                     assert( !it.value().tarName.isNull() );
-                    (*eurls.cssURL).value = it.value().tarName;
-                }
-            }
-
-            // Check for a frame with a name
-            if (eurls.frameName != invalid) {
-                Name2Part &n2f = data.partFrameData->framesWithName;
-                Name2Part::Iterator n2f_part = n2f.find((*eurls.frameName).value);
-
-                if (n2f_part == n2f.end()) {
-
-                    // KHTML ignores this frame tag, so remove it here
-                    filterOut1 = eurls.frameName;
-                    filterOut2 = eurls.frameURL;
-
-                    qCDebug(WEBARCHIVERPLUGIN_LOG) << "emptying frame=" << (*eurls.frameName).value;
-
-                } else {
-
-                    // Always add a 'src' attribute.  If it's not there, add one
-                    if (eurls.frameURL == invalid) {
-                        eurls.attrList.prepend(AttrElem(QStringLiteral("src"), QString::null));
-                        eurls.frameURL = eurls.attrList.begin();
-
-                        // NOTE Now that we changed the list, pray the older iterators of 'attrList' still work...
-                    }
-                    Part2TarName::Iterator p2tn_it = m_part2tarName.find(n2f_part.value());
-                    Q_ASSERT(p2tn_it != m_part2tarName.end());
-                    (*eurls.frameURL).value = p2tn_it.value();
-
-                    qCDebug(WEBARCHIVERPLUGIN_LOG) << "setting frame='" << (*eurls.frameName).value << "' to src='"
-                                  << (*eurls.frameURL).value;
-                }
-
-            } else if (eurls.frameURL != invalid) {
-
-                URL2Part &u2f = data.partFrameData->framesWithURLOnly;
-                QUrl fullURL = absoluteURL((*eurls.frameURL).value, data);
-                URL2Part::Iterator u2f_part = u2f.find(fullURL);
-
-                if (u2f_part == u2f.end()) {
-
-                    // KHTML ignores this frame tag, so remove it here
-                    filterOut1 = eurls.frameURL;
-
-                    qCDebug(WEBARCHIVERPLUGIN_LOG) << "emptying frame='" << (*eurls.frameURL).value << "'";
-
-                } else {
-
-                    Part2TarName::Iterator p2tn_it = m_part2tarName.find(u2f_part.value());
-                    Q_ASSERT(p2tn_it != m_part2tarName.end());
-                    (*eurls.frameURL).value = p2tn_it.value();
-
-                    qCDebug(WEBARCHIVERPLUGIN_LOG) << "setting frame='" << fullURL << "' to src='"
-                                  << (*eurls.frameURL).value;
-                }
-            }
-
-            // Remove <base href=... > attribute
-            if (nodeName == QLatin1String("BASE")) {
-                filterOut1 = getAttribute(eurls.attrList, QStringLiteral("href"));
-                data.baseSeen = true;
-            }
-
-            // Insert <head> tag if not found
-            if (nodeName == QLatin1String("HTML")) {
-                if (!hasChildNode(pNode, QStringLiteral("HEAD"))) {
-                    text += "<head>" CONTENT_TYPE "</head>\n";
-                }
-                fullEmptyTags = true;
-                // Always write out full closing tags for some tags
-            } else if (nodeName == QLatin1String("HEAD") || nodeName == QLatin1String("FRAME") || nodeName == QLatin1String("IFRAME") || nodeName == QLatin1String("A") ||
-                       nodeName == QLatin1String("DIV") || nodeName == QLatin1String("SPAN")) {
-                fullEmptyTags = true;
-            }
-
-            text += "<" + nodeName.toLower();
-
-            // Write attributes
-            for (AttrList::ConstIterator i = eurls.attrList.begin(); i != eurls.attrList.end(); ++i) {
-                QString attr  = (*i).name.toLower();
-                QString value = (*i).value;
-                if ((i != filterOut1) && (i != filterOut2)) {
-                    if (hasStyle && (attr == QLatin1String("style"))) {
-//                         qCDebug(WEBARCHIVERPLUGIN_LOG) << "translating URLs in element:";
-//                         qCDebug(WEBARCHIVERPLUGIN_LOG) << "value=" << value;
-                        changeCSSURLs(value, style_it.value());
-//                         qCDebug(WEBARCHIVERPLUGIN_LOG) << "value=" << value;
-                    }
-                    if (non_cdata_attr.find(attr) == non_cdata_attr.end()) {
-                        value = escapeHTML(value);
-                    }
-                    text += " " + attr + "=\"" + value + "\"";
-                }
-            }
-
-            // Take care for self-contained tags like <hr />.  This code is needed to close such
-            // tags later with '/>'. 'fullEmptyTags == true' means to always write an explicit
-            // closing tag, e.g. <script></script>
-            if (fullEmptyTags || hasChildren) {
-                text += QLatin1String(">");
-            }
-
-            if (nodeName == QLatin1String("HEAD")) {
-                text += CONTENT_TYPE "\n";
-            }
-        }
-    } else {
-        const QString &nodeValue(pNode.nodeValue().string());
-        if (!(nodeValue.isEmpty())) {
-            // Don't escape < > in JS or CSS
-            DOM::Node parentNode = pNode.parentNode();
-            QString parentNodeName = parentNode.nodeName().string().toUpper();
-            if (parentNodeName == QLatin1String("STYLE")) {
-                text = pNode.nodeValue().string(); //analyzeInternalCSS(baseURL, pNode.nodeValue().string());
-
-                Node2StyleSheet::Iterator topcss_it = m_topStyleSheets.find(parentNode);
-                if (topcss_it != m_topStyleSheets.end()) {
-                    URLsInStyleSheet::ConstIterator uss_it = m_URLsInStyleSheet.constFind(*topcss_it);
-                    m_topStyleSheets.erase(topcss_it);  // for safety
-                    assert(uss_it != m_URLsInStyleSheet.constEnd());
-
-                    qCDebug(WEBARCHIVERPLUGIN_LOG) << "translating URLs in <style> area.";
-                    changeCSSURLs(text, uss_it.value());
-
-                } else {
-                    qCDebug(WEBARCHIVERPLUGIN_LOG) << "found style area '" << nodeName << "', but KHMTL didn't feel like parsing it";
-                }
-
-            } else if (parentNodeName == QLatin1String("SCRIPT")) {
-                text = pNode.nodeValue().string();
-            } else {
-                if (pNode.nodeType() == DOM::Node::COMMENT_NODE) {
-                    text = QStringLiteral("<!--");
-                    text += nodeValue.toHtmlEscaped();  // No need to escape " as well
-                    text += QLatin1String("-->");
-                } else {
-                    text = escapeHTML(nodeValue);
-                }
-            }
-        }
-    }
-
-    (*data.textStream) << text;
-
-    if (! pNode.isNull()) {
-        DOM::Node child = pNode.firstChild();
-        while (! child.isNull()) {
-            saveHTMLPartLower(child, level + 1, data);
-            child = child.nextSibling();
-        }
-    }
-
-    if (isElement && !skipElement) {
-        if (fullEmptyTags || hasChildren) {
-            text = "</" + nodeName.toLower() + ">";
-        } else {
-            text = QStringLiteral(" />"); // close self-contained tags
-        }
-        (*data.textStream) << text;
-    }
-}
-
-QString ArchiveDialog::extractCSSURL(const QString &text)
-{
-    if (text.startsWith(QLatin1String("url(")) && text.endsWith(QLatin1String(")"))) {
-        return text.mid(4, text.length() - 5);
-    } else {
-        return QString::null;
-    }
-}
-
-QString &ArchiveDialog::changeCSSURLs(QString &text, const RawHRef2FullURL &raw2full)
-{
-    FOR_CONST_ITER(RawHRef2FullURL, raw2full, r2f_it) {
-        const QString &raw  = r2f_it.key();
-        const QUrl &fullURL = r2f_it.value();
-        if (fullURL.isValid()) {
-            UrlTarMap::Iterator utm_it = m_url2tar.find(fullURL);
-            if (utm_it != m_url2tar.end()) {
-                const QString &tarName = utm_it.value().tarName;
-//                 assert(! tarName.isNull());
-
-                qCDebug(WEBARCHIVERPLUGIN_LOG) << "changeCSSURLs: url=" << raw << " -> " << tarName;
-                text.replace(raw, tarName);
-            } else {
-                qCDebug(WEBARCHIVERPLUGIN_LOG) << "changeCSSURLs: raw URL not found in tar map";
-                text.replace(raw, QLatin1String(""));
-            }
-        } else {
-            qCDebug(WEBARCHIVERPLUGIN_LOG) << "changeCSSURLs: emptying invalid raw URL";
-            text.replace(raw, QLatin1String(""));
-        }
-    }
-    return text;
-}
-
-ArchiveDialog::ExtractURLs::ExtractURLs(const QString &nodeName, const DOM::Element &element)
-{
-
-    DOM::NamedNodeMap attrs = element.attributes();
-    int lmap = static_cast<int>(attrs.length());    // More than 2^31 attributes? hardly...
-    for (int j = 0; j != lmap; ++j) {
-        DOM::Attr attr = static_cast<DOM::Attr>(attrs.item(j));
-        attrList.append(AttrElem(attr.name().string(), attr.value().string()));
-    }
-
-    AttrList::Iterator rel        = attrList.end();
-    AttrList::Iterator href       = attrList.end();
-    AttrList::Iterator src        = attrList.end();
-    AttrList::Iterator name       = attrList.end();
-    AttrList::Iterator background = attrList.end();
-    AttrList::Iterator invalid    = attrList.end();
-    for (AttrList::Iterator i = attrList.begin(); i != attrList.end(); ++i) {
-        QString attrName  = (*i).name.toUpper();
-        if (attrName == QLatin1String("REL")) {
-            rel = i;
-        } else if (attrName == QLatin1String("HREF")) {
-            href = i;
-        } else if (attrName == QLatin1String("BACKGROUND")) {
-            background = i;
-        } else if (attrName == QLatin1String("SRC")) {
-            src = i;
-        } else if (attrName == QLatin1String("NAME")) {
-            name = i;
-        }
-    }
-
-    //
-    // Check attributes
-    //
-    transURL  =
-        absURL    =
-            frameURL  =
-                frameName =
-                    cssURL    = attrList.end();
-    if ((nodeName == QLatin1String("A")) && (href != invalid)) {
-        absURL = href;
-    } else if ((nodeName == QLatin1String("LINK")) && (rel != invalid) && (href != invalid)) {
-        QString relUp = (*rel).value.toUpper();
-        if (relUp == QLatin1String("STYLESHEET")) {
-            cssURL = href;
-        } else if (relUp == QLatin1String("SHORTCUT ICON")) {
-            transURL = href;
-        } else {
-            absURL = href;
-        }
-    } else if (nodeName == QLatin1String("FRAME") || nodeName == QLatin1String("IFRAME")) {
-        if (src != invalid) {
-            frameURL = src;
-        }
-        if (name != invalid) {
-            frameName = name;
-        }
-    } else if ((nodeName == QLatin1String("IMG") || nodeName == QLatin1String("INPUT") || nodeName == QLatin1String("SCRIPT")) && (src != invalid)) {
-        transURL = src;
-    } else if ((nodeName == QLatin1String("BODY") || nodeName == QLatin1String("TABLE") || nodeName == QLatin1String("TH") || nodeName == QLatin1String("TD")) &&
-               (background != invalid)) {
-        qCDebug(WEBARCHIVERPLUGIN_LOG) << "found background URL " << (*background).value;
-        transURL = background;
-    }
-}
-
-bool ArchiveDialog::hasAttrWithValue(const DOM::Element &elem, const QString &attrName, const QString &attrValue)
-{
-    DOM::Attr attr = const_cast<DOM::Element &>(elem).getAttributeNode(attrName);
-
-    if (!attr.isNull()) {
-        return attr.value().string().toUpper() == attrValue;
-    } else {
-        return false;
-    }
-}
-
-bool ArchiveDialog::hasChildNode(const DOM::Node &pNode, const QString &nodeName)
-{
-    DOM::Node child;
-    try {
-        // We might throw a DOM exception
-        child = pNode.firstChild();
-    } catch (...) {
-        // No children, stop recursion here
-        child = DOM::Node();
-    }
-
-    while (!child.isNull()) {
-        if (child.nodeName().string().toUpper() == nodeName) {
-            return true;
-        }
-        child = child.nextSibling();
-    }
-    return false;
-}
-
-ArchiveDialog::AttrList::Iterator ArchiveDialog::getAttribute(AttrList &attrList, const QString &attr)
-{
-    FOR_ITER(AttrList, attrList, it) {
-        if ((*it).name == attr) {
-            return it;
-        }
-    }
-    return attrList.end();
-}
-
-QUrl ArchiveDialog::absoluteURL(const QString &partURL, RecurseData &data)
-{
-    if (data.baseSeen) {
-        return QUrl(data.document.completeURL(partURL).string());
-    } else {
-        return QUrl(data.part->url()).resolved(QUrl(partURL));
-    }
-}
-
-// TODO Should be khtml::parseURL
-QString ArchiveDialog::parseURL(const QString &rawurl)
-{
-    QString result = rawurl;
-    return result.replace(QRegExp("[\\x0000-\\x000D]"), QLatin1String(""));
-}
-
-QString ArchiveDialog::uniqTarName(const QString &suggestion, KHTMLPart *part)
-{
-
-    QString result = suggestion;
-
-    // Name clash -> add unique id
-    while (result.isEmpty() || m_tarName2part.contains(result)) {
-        result = QString::number(m_uniqId++) + suggestion;
-    }
-    m_tarName2part.insert(result, part);
-
-    return result;
-}
-
-bool ArchiveDialog::urlCheckFailed(KHTMLPart *part, const QUrl &fullURL)
-{
-    if (!fullURL.isValid()) {
-        return true;
-    }
-
-    QString prot = fullURL.scheme();
-    bool protFile = (prot == QLatin1String("file"));
-    if (part->onlyLocalReferences() && !protFile) {
-        return true;
-    }
-
-    bool protHttp = (prot == QLatin1String("http")) || (prot == QLatin1String("https"));
-    if (!protFile && !protHttp) {
-        return true;
-    }
-
-    if (! KUrlAuthorized::authorizeUrlAction(QStringLiteral("redirect"), part->url(), fullURL) ||
-            ! KUrlAuthorized::authorizeUrlAction(QStringLiteral("open"), part->url(), fullURL)) {
-        return true;
-    }
-
-    return false;
-}
-
-QString ArchiveDialog::escapeHTML(const QString &in)
-{
-    return in.toHtmlEscaped().replace('"', QLatin1String("""));
-}
-
-QString ArchiveDialog::appendMimeTypeSuffix(QString filename, const QString &mimetype)
-{
-    KMimeType::Ptr mimeType = KMimeType::mimeType(mimetype, KMimeType::ResolveAliases);
-    if (mimeType.isNull() || (mimeType == KMimeType::defaultMimeTypePtr())) {
-        qCDebug(WEBARCHIVERPLUGIN_LOG) << "mimetype" << mimetype << "unknown here, returning unchanged";
-        return filename;
-    }
-    const QStringList &patterns = mimeType->patterns();
-    FOR_CONST_ITER(QStringList, patterns, pat_it) {
-        // Lets hope all patterns are '*.xxx'
-        QString suffix(*pat_it);
-        int pos = suffix.lastIndexOf('*');
-        if (pos < 0) {
-            qCDebug(WEBARCHIVERPLUGIN_LOG) << "Illegal mime pattern '" << suffix << "for" << mimeType;
-            Q_ASSERT(0);
-            continue;
-        }
-        suffix = suffix.mid(pos + 1);
-        if (filename.endsWith(suffix, Qt::CaseInsensitive)) {
-//             qCDebug(WEBARCHIVERPLUGIN_LOG) << filename << "has already good suffix" << suffix;
-            return filename;    // already has good suffix
-        }
-    }
-    //
-    // @c filename has no known suffix, append one
-    //
-    if (! patterns.isEmpty()) {
-        QString suffix(*patterns.constBegin());
-        suffix.replace('*', QString::null);
-        filename += suffix;
-        qCDebug(WEBARCHIVERPLUGIN_LOG) << "appended missing mimetype suffix, returning" << filename;
-    } else {
-        qCDebug(WEBARCHIVERPLUGIN_LOG) << "mimetype" << mimetype << " has no pattern list, this is bad";
-        Q_ASSERT(0);
-    }
-    return filename;
-}
diff --git a/plugins/webarchiver/archivedialog.h b/plugins/webarchiver/archivedialog.h
deleted file mode 100644
index 1511a35d2..000000000
--- a/plugins/webarchiver/archivedialog.h
+++ /dev/null
@@ -1,274 +0,0 @@
-/*
-   Copyright (C) 2003 Antonio Larrosa <larrosa at kde.org>
-   Copyright (C) 2008 Matthias Grimrath <maps4711 at gmx.de>
-
-   This program is free software; you can redistribute it and/or
-   modify it under the terms of the GNU General Public
-   License as published by the Free Software Foundation; either
-   version 2 of the License, or (at your option) any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program; see the file COPYING.  If not, write to
-   the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-   Boston, MA 02111-1307, USA.
-*/
-
-#ifndef _ARCHIVEDIALOG_H_
-#define _ARCHIVEDIALOG_H_
-
-#include <kdialog.h>
-#include <kio/job_base.h>
-
-#include <qlinkedlist.h>
-
-#include <dom/dom_core.h>
-#include <dom/html_document.h>
-
-#include "ui_archiveviewbase.h"
-
-class QWidget;
-class KHTMLPart;
-class ArchiveViewBase;
-class QUrl;
-class KTar;
-class QTextStream;
-
-class ArchiveViewBase : public QWidget, public Ui::ArchiveViewBase
-{
-public:
-    ArchiveViewBase(QWidget *parent) : QWidget(parent)
-    {
-        setupUi(this);
-    }
-};
-
-/// Does all the hard work of downloading, manipulating and storing of
-/// HTML files and inlined images, stylesheets ...
-class ArchiveDialog : public KDialog
-{
-    Q_OBJECT
-public:
-    ArchiveDialog(QWidget *parent, const QString &targetFilename, KHTMLPart *part);
-    ~ArchiveDialog() override;
-
-    void archive();
-
-protected:
-    /// Holds attributes that are not #CDATA
-    class NonCDataAttr : public QSet<QString>
-    {
-    public:
-        NonCDataAttr();
-    };
-
-    static NonCDataAttr non_cdata_attr;
-
-    KIO::Job *startDownload(const QUrl &url, KHTMLPart *part);
-
-public:
-
-    // Frame handling
-
-    typedef QHash<QString, KHTMLPart *> Name2Part;
-private:
-    typedef QHash<QUrl,    KHTMLPart *> URL2Part;
-
-    struct PartFrameData {
-        Name2Part framesWithName;
-        URL2Part  framesWithURLOnly;
-    };
-
-    typedef QHash< KHTMLPart *, PartFrameData > FramesInPart;
-    typedef QHash< QString, KHTMLPart * >       TarName2Part;
-    typedef QHash< KHTMLPart *, QString >       Part2TarName;
-
-    // Stylesheets
-
-    typedef QHash< QUrl, DOM::CSSStyleSheet >            CSSURLSet;
-    typedef QHash< QString, QUrl >                       RawHRef2FullURL;
-    typedef QHash< DOM::CSSStyleSheet, RawHRef2FullURL > URLsInStyleSheet;
-    typedef QHash< DOM::Element, RawHRef2FullURL >       URLsInStyleElement;
-    typedef QHash< DOM::Node, DOM::CSSStyleSheet >       Node2StyleSheet;
-
-    // Recursive parsing and processing
-
-    /// Databag to hold information that is gathered during recursive traversal of the DOM tree
-    struct RecurseData {
-        KHTMLPart *const     part;
-        QTextStream *const   textStream;
-        PartFrameData *const partFrameData;
-        DOM::HTMLDocument    document;
-        bool                 baseSeen;
-
-        RecurseData(KHTMLPart *_part, QTextStream *_textStream, PartFrameData *pfd);
-    };
-
-    struct DownloadInfo {
-        QString tarName;
-        KHTMLPart *part;
-
-        DownloadInfo(const QString &_tarName = QString::null, KHTMLPart *_part = nullptr)
-            : tarName(_tarName), part(_part) { }
-    };
-
-    typedef QMap< QUrl, DownloadInfo >     UrlTarMap;
-    typedef QList< UrlTarMap::Iterator > DownloadList;
-
-    struct AttrElem {
-        QString name;
-        QString value;
-
-        AttrElem() { }
-        AttrElem(const QString &_n, const QString &_v) : name(_n), value(_v) { }
-    };
-    typedef QLinkedList< AttrElem >  AttrList;
-
-    /**
-     * Looks for URL contained in attributes.
-     */
-    struct ExtractURLs {
-        ExtractURLs(const QString &nodeName, const DOM::Element &element);
-
-        AttrList attrList;              /// copy of the attribute of @p element
-        AttrList::iterator absURL;      /// for links ala <a href= ... >
-        AttrList::iterator transURL;    /// for embedded objects like <img src=...>, favicons, background-images...
-        AttrList::iterator frameURL;    /// if @p element contains a frameURL
-        AttrList::iterator frameName;   /// if it is frame tag with a name element
-        AttrList::iterator cssURL;      /// for URLs that specify CSS
-    };
-
-private:
-    void downloadObjects();
-    void downloadStyleSheets();
-    void saveWebpages();
-    void finishedArchiving(bool tarerror);
-
-    void endProgressInfo(bool error);
-
-    void obtainURLs();
-    void obtainURLsLower(KHTMLPart *part, int level);
-    void obtainPartURLsLower(const DOM::Node &pNode, int level, RecurseData &data);
-    void obtainStyleSheetURLsLower(DOM::CSSStyleSheet styleSheet, RecurseData &data);
-
-    bool insertTranslateURL(const QUrl &fullURL, RecurseData &data);
-    bool insertHRefFromStyleSheet(const QString &hrefRaw, RawHRef2FullURL &raw2full,
-                                  const QUrl &fullURL, RecurseData &data);
-    void parseStyleDeclaration(const QUrl &baseURL, DOM::CSSStyleDeclaration decl,
-                               RawHRef2FullURL &urls, RecurseData &data /*, bool verbose = false*/);
-
-    bool saveTopFrame();
-    bool saveFrame(KHTMLPart *part, int level);
-    void saveHTMLPart(RecurseData &data);
-    void saveHTMLPartLower(const DOM::Node &pNode, int indent, RecurseData &data);
-
-    QString  extractCSSURL(const QString &text);
-    QString &changeCSSURLs(QString &text, const RawHRef2FullURL &raw2full);
-
-    static bool hasAttrWithValue(const DOM::Element &elem, const QString &attrName, const QString &attrValue);
-    static bool hasChildNode(const DOM::Node &pNode, const QString &nodeName);
-    static AttrList::Iterator getAttribute(AttrList &attrList, const QString &attr);
-    
-    static bool hasSubUrl(const QUrl &url);
-
-    /**
-     * completes a potentially partial URL in a HTML document (like <img href="...")
-     * to a fully qualified one.
-     *
-     * It uses the URL of the document or the URL given in the <base ...>
-     * element, depending on if and where a &ltbase ...> appears on the document.
-     *
-     * Always use this method to get full URLs from href's or similar.
-     *
-     * Suppose the URL of the webpage is http://host.nowhere/. The head looks like this
-     * <pre>
-     * <head>
-     *   <link rel="stylesheet" href="style1.css" type="text/css" />
-     *   <base href="http://some.place/" />
-     *   <link rel="stylesheet" href="style2.css" type="text/css" />
-     * </head>
-     * </pre>
-     *
-     * The full URL of "style1.css" is http://host.nowhere/style1.css, whereas
-     * "style2.css" will become http://some.place/style2.css
-     *
-     * @return fully qualified URL of @p partURL relative to the HTML document in @c data.part
-     */
-    static QUrl absoluteURL(const QString &partURL, RecurseData &data);
-
-    /**
-     * TODO KDE4 is this in KHTML function available now?
-     * Functionality taken from khtml/css/csshelper.cpp:parseURL
-     *
-     * Filters a href in an element inside the HTML body.  This handles
-     * quirks in browsers that filter out \\n, \\r in URLs.
-     */
-    static QString parseURL(const QString &rawurl);
-
-    /**
-     * Creates unique filenames to be used in the tar archive
-     */
-    QString uniqTarName(const QString &suggestion, KHTMLPart *part);
-
-    /**
-     * Taken from khtml/misc/loader.cpp DOCLOAD_SECCHECK
-     *
-     * Would be better on the public interface of KHTMLPart (or similar)
-     *
-     * Checks if an embedded link like <img src="..." should be loaded
-     */
-    static bool urlCheckFailed(KHTMLPart *part, const QUrl &fullURL);
-
-    /**
-     * Escapes HTML characters. Does not forget " as @ref Qt::escape() does.
-     */
-    QString escapeHTML(const QString &in);
-
-    /**
-     * Adds a suffix that hints at the mimetypes if such a suffix is not
-     * present already. If there is no such mimetype in the KDE database
-     * @p filename is returned unchanged.
-     * 'filename' -> 'filename.gif'
-     * 'picture.jpg' -> 'picture.jpg'
-     *
-     * NOTE This function is rather slow
-     */
-    QString appendMimeTypeSuffix(QString filename, const QString &mimetype);
-
-private:
-    KHTMLPart       *m_top;
-
-    FramesInPart     m_framesInPart;
-
-    UrlTarMap           m_url2tar;
-    TarName2Part        m_tarName2part;
-    Part2TarName        m_part2tarName;
-    CSSURLSet           m_cssURLs;
-    URLsInStyleSheet    m_URLsInStyleSheet;
-    URLsInStyleElement  m_URLsInStyleElement;
-    Node2StyleSheet     m_topStyleSheets;
-
-    KIO::Job              *m_job;
-    CSSURLSet::Iterator    m_styleSheets_it;
-    DownloadList           m_objects;
-    DownloadList::Iterator m_objects_it;
-    UrlTarMap::Iterator    m_dlurl2tar_it;
-
-    int              m_uniqId;
-    KTar            *m_tarBall;
-    QDateTime           m_archiveTime;
-    QString          m_filename;
-
-    ArchiveViewBase    *m_widget;
-
-private slots:
-    void slotObjectFinished(KJob *job);
-    void slotStyleSheetFinished(KJob *job);
-    void slotButtonClicked(int button) override;
-};
-
-#endif // _ARCHIVEDIALOG_H_
diff --git a/plugins/webarchiver/archiveviewbase.ui b/plugins/webarchiver/archiveviewbase.ui
deleted file mode 100644
index 6e8e7bc66..000000000
--- a/plugins/webarchiver/archiveviewbase.ui
+++ /dev/null
@@ -1,124 +0,0 @@
-<ui version="4.0" >
- <class>ArchiveViewBase</class>
- <widget class="QWidget" name="ArchiveViewBase" >
-  <property name="geometry" >
-   <rect>
-    <x>0</x>
-    <y>0</y>
-    <width>600</width>
-    <height>483</height>
-   </rect>
-  </property>
-  <property name="windowTitle" >
-   <string>Web Archiver</string>
-  </property>
-  <layout class="QVBoxLayout" >
-   <item>
-    <layout class="QGridLayout" >
-     <property name="leftMargin" >
-      <number>0</number>
-     </property>
-     <property name="topMargin" >
-      <number>0</number>
-     </property>
-     <property name="rightMargin" >
-      <number>0</number>
-     </property>
-     <property name="bottomMargin" >
-      <number>0</number>
-     </property>
-     <item row="1" column="1" >
-      <widget class="QLabel" name="targetLabel" >
-       <property name="sizePolicy" >
-        <sizepolicy vsizetype="Minimum" hsizetype="Expanding" >
-         <horstretch>0</horstretch>
-         <verstretch>0</verstretch>
-        </sizepolicy>
-       </property>
-       <property name="text" >
-        <string>Local File</string>
-       </property>
-       <property name="wordWrap" >
-        <bool>false</bool>
-       </property>
-       <property name="openExternalLinks" >
-        <bool>true</bool>
-       </property>
-       <property name="textInteractionFlags" >
-        <set>Qt::LinksAccessibleByMouse</set>
-       </property>
-      </widget>
-     </item>
-     <item row="1" column="0" >
-      <widget class="QLabel" name="textLabel1_2" >
-       <property name="text" >
-        <string>To:</string>
-       </property>
-       <property name="wordWrap" >
-        <bool>false</bool>
-       </property>
-      </widget>
-     </item>
-     <item row="0" column="0" >
-      <widget class="QLabel" name="textLabel1" >
-       <property name="text" >
-        <string>Archiving:</string>
-       </property>
-       <property name="wordWrap" >
-        <bool>false</bool>
-       </property>
-      </widget>
-     </item>
-     <item row="0" column="1" >
-      <widget class="QLabel" name="urlLabel" >
-       <property name="sizePolicy" >
-        <sizepolicy vsizetype="Minimum" hsizetype="Expanding" >
-         <horstretch>0</horstretch>
-         <verstretch>0</verstretch>
-        </sizepolicy>
-       </property>
-       <property name="text" >
-        <string>Original URL</string>
-       </property>
-       <property name="wordWrap" >
-        <bool>false</bool>
-       </property>
-       <property name="openExternalLinks" >
-        <bool>true</bool>
-       </property>
-       <property name="textInteractionFlags" >
-        <set>Qt::LinksAccessibleByMouse</set>
-       </property>
-      </widget>
-     </item>
-    </layout>
-   </item>
-   <item>
-    <widget class="QProgressBar" name="progressBar" />
-   </item>
-   <item>
-    <widget class="QTreeWidget" name="progressView" >
-     <property name="rootIsDecorated" >
-      <bool>false</bool>
-     </property>
-     <property name="columnCount" >
-      <number>2</number>
-     </property>
-     <column>
-      <property name="text" >
-       <string>1</string>
-      </property>
-     </column>
-     <column>
-      <property name="text" >
-       <string>2</string>
-      </property>
-     </column>
-    </widget>
-   </item>
-  </layout>
- </widget>
- <layoutdefault spacing="6" margin="11" />
- <resources/>
- <connections/>
-</ui>
diff --git a/plugins/webarchiver/plugin_webarchiver.cpp b/plugins/webarchiver/plugin_webarchiver.cpp
deleted file mode 100644
index 70369baf3..000000000
--- a/plugins/webarchiver/plugin_webarchiver.cpp
+++ /dev/null
@@ -1,144 +0,0 @@
-/* This file is part of Webarchiver
- *  Copyright (C) 2001 by Andreas Schlapbach <schlpbch at iam.unibe.ch>
- *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Library General Public
- *  License as published by the Free Software Foundation; either
- *  version 2 of the License, or (at your option) any later version.
- *
- *  This library is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- *  Library General Public License for more details.
- *
- *  You should have received a copy of the GNU Library General Public License
- *  along with this library; see the file COPYING.LIB.  If not, write to
- *  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- *  Boston, MA 02110-1301, USA.
- **/
-
-/* $Id$ */
-
-/*
- * There are two recursions within this code:
- * - Recursively create DOM-Tree for referenced links which get recursively
- *   converted to HTML
- *
- * => This code has the potential to download whole sites to a TarGz-Archive
- */
-
-//#define DEBUG_WAR
-
-#include "plugin_webarchiver.h"
-
-#include <QDir>
-#include <QFile>
-#include <QIcon>
-#include <QUrl>
-
-
-#include <kcomponentdata.h>
-
-#include <kfiledialog.h>
-#include <kmessagebox.h>
-#include <KLocalizedString>
-#include <khtmlview.h>
-#include <khtml_part.h>
-#include <kpluginfactory.h>
-#include <kactioncollection.h>
-#include <kstandardguiitem.h>
-#include <QStandardPaths>
-#include "archivedialog.h"
-
-K_PLUGIN_FACTORY(PluginWebArchiverFactory, registerPlugin<PluginWebArchiver>();)
-
-PluginWebArchiver::PluginWebArchiver(QObject *parent,
-                                     const QVariantList &)
-    : Plugin(parent)
-{
-    QAction *a = actionCollection()->addAction(QStringLiteral("archivepage"));
-    a->setText(i18n("Archive &Web Page..."));
-    a->setIcon(QIcon::fromTheme(QStringLiteral("webarchiver")));
-    connect(a, SIGNAL(triggered()), this, SLOT(slotSaveToArchive()));
-}
-
-PluginWebArchiver::~PluginWebArchiver()
-{
-}
-
-void PluginWebArchiver::slotSaveToArchive()
-{
-    // ## Unicode ok?
-    if (!parent() || !parent()->inherits("KHTMLPart")) {
-        return;
-    }
-    KHTMLPart *part = qobject_cast<KHTMLPart *>(parent());
-
-    QString archiveName = QString::fromUtf8(part->htmlDocument().title().string().toUtf8());
-
-    if (archiveName.isEmpty()) {
-        archiveName = i18n("Untitled");
-    }
-
-    KConfig config(QStringLiteral("webarchiverrc"), KConfig::SimpleConfig);
-    KConfigGroup configGroup = config.group("Recent");
-
-    archiveName = archiveName.simplified();
-    archiveName.replace(QLatin1String("\\s:"), QLatin1String(" "));      // what is this intended to do?
-    archiveName.replace(QLatin1String("?"), QLatin1String(""));
-    archiveName.replace(QLatin1String(":"), QLatin1String(""));
-    archiveName.replace(QLatin1String("/"), QLatin1String(""));
-    // Replace space with underscore, proposed Frank Pieczynski <pieczy at knuut.de>
-    archiveName = archiveName.replace(QRegExp("\\s+"), QStringLiteral("_"));
-
-    QString lastCWD = configGroup.readPathEntry("savedialogcwd",
-                      QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation));
-    archiveName = lastCWD + "/" + archiveName + ".war";
-
-    QUrl url = KFileDialog::getSaveUrl(QUrl::fromLocalFile(archiveName), i18n("*.war *.tgz|Web Archives"), part->widget(),
-                                       i18n("Save Page as Web-Archive"));
-
-    if (url.isEmpty()) {
-        return;
-    }
-
-    if (!url.isValid()) {
-        const QString title = i18nc("@title:window", "Invalid URL");
-        const QString text = i18n("The URL\n%1\nis not valid.", url.toString());
-        KMessageBox::sorry(part->widget(), text, title);
-        return;
-    }
-
-    lastCWD = url.adjusted(QUrl::RemoveFilename).toLocalFile();
-    if (! lastCWD.isNull()) {
-        configGroup.writePathEntry("savedialogcwd", lastCWD);
-        config.sync();
-    }
-
-    const QFile file(url.path());
-    if (file.exists()) {
-        const QString title = i18nc("@title:window", "File Exists");
-        const QString text = i18n("Do you really want to overwrite:\n%1?", url.toDisplayString());
-        if (KMessageBox::Continue != KMessageBox::warningContinueCancel(part->widget(), text, title, KStandardGuiItem::overwrite())) {
-            return;
-        }
-    }
-
-    //
-    // It is very important to make the archive dialog a child of the KHTMLPart!
-    // If not crashes due to dangling refs will happen. For example if Konqueror quits
-    // while archiving runs @c part becomes invalid. Furthermore the various @ref QHash<>
-    // members of @ref ArchiveDialog contain DOM elements that use ref counting. Upon
-    // exit of Konqueror @c part gets destroyed *before* our @ref ArchiveDialog . Since
-    // our running ArchiveDialog keeps the DOM ref counts up KHTML triggers an assertion
-    // in KHTMLGlobal
-    //
-    // In contrast if @ref ArchiveDialog is a child of the part view Qt ensures that all
-    // child dialogs are destroyed _before_ @c part is destroyed.
-    //
-    ArchiveDialog *dialog = new ArchiveDialog(part->view(), url.path(), part);
-    dialog->show();
-    dialog->archive();
-}
-
-#include "plugin_webarchiver.moc"
diff --git a/plugins/webarchiver/plugin_webarchiver.desktop b/plugins/webarchiver/plugin_webarchiver.desktop
deleted file mode 100644
index 65351c99b..000000000
--- a/plugins/webarchiver/plugin_webarchiver.desktop
+++ /dev/null
@@ -1,138 +0,0 @@
-[Desktop Entry]
-X-KDE-Library=webarchiver
-X-KDE-PluginInfo-Author=Andreas Schlapbach
-X-KDE-PluginInfo-Email=schlpbch at iam.unibe.ch
-X-KDE-PluginInfo-Name=webarchiver
-X-KDE-PluginInfo-Version=3.3
-X-KDE-PluginInfo-Website=
-X-KDE-PluginInfo-Category=Tools
-X-KDE-PluginInfo-Depends=
-X-KDE-PluginInfo-License=GPL
-X-KDE-PluginInfo-EnabledByDefault=true
-Name=Web Archiver
-Name[ar]=مؤرشف الويب
-Name[ast]=Archivador web
-Name[bg]=Архивиране на страници
-Name[bs]=Veb arhivar
-Name[ca]=Arxivador de webs
-Name[ca at valencia]=Arxivador de webs
-Name[cs]=Webový archivátor
-Name[da]=Webarkivering
-Name[de]=Web-Archivierung
-Name[el]=Αρχειοθέτης ιστοσελίδας
-Name[en_GB]=Web Archiver
-Name[es]=Archivador web
-Name[et]=Veebiarhiveerija
-Name[eu]=Web artxibatzailea
-Name[fi]=Web-arkistoija
-Name[fr]=Archiveur Web
-Name[ga]=Cartlannaí Gréasáin
-Name[gl]=Arquivador web
-Name[he]=ארכיוני רשת
-Name[hne]=वेब आर्काइवर
-Name[hr]=Arhiviranje weba
-Name[hu]=Webarchiváló
-Name[ia]=Archivator web
-Name[id]=Pengarsip Web
-Name[is]=Vefsíðusafnari
-Name[it]=Archiviatore web
-Name[ja]=ウェブアーカイバ
-Name[kk]=Веб-архивтеуіш
-Name[km]=កម្មវិធី​ទុក​បណ្ដាញ​ជា​​​ប័ណ្ណសារ
-Name[ko]=웹 보관 도구
-Name[ku]=Arşîvgerê Torê
-Name[lt]=Žiniatinklių puslapių archyvavimo priemonė
-Name[lv]=Tīmekļa arhivators
-Name[mr]=वेब संग्रहकर्ता
-Name[ms]=Pengarkib Web
-Name[nb]=Vevarkivar
-Name[nds]=Nettarchiv-Maker
-Name[nl]=Webarchiveerder
-Name[nn]=Nettsidearkivering
-Name[oc]=Web
-Name[pa]=ਵੈਬ ਅਕਾਇਵਰ
-Name[pl]=Archiwizator sieciowy
-Name[pt]=Arquivos Web
-Name[pt_BR]=Arquivador de páginas da Internet
-Name[ro]=Arhivator web
-Name[ru]=Архиватор веб-страниц
-Name[sk]=Webový archivátor
-Name[sl]=Spletni pakirnik
-Name[sr]=Веб архивар
-Name[sr at ijekavian]=Веб архивар
-Name[sr at ijekavianlatin]=Veb arhivar
-Name[sr at latin]=Veb arhivar
-Name[sv]=Webbarkiverare
-Name[tg]=Бойгони интернетӣ
-Name[th]=เครื่องมือสร้างแฟ้มจัดเก็บหน้าเว็บ
-Name[tr]=Web Arşivleyici
-Name[ug]=تور ئارخىپى
-Name[uk]=Вебархіватор
-Name[wa]=Årtchiveu d' waibe
-Name[x-test]=xxWeb Archiverxx
-Name[zh_CN]=Web 存档
-Name[zh_TW]=網頁歸檔器
-Comment=Creates archives of websites
-Comment[ar]=ينشئ أرشيفات لمواقع الويب
-Comment[ast]=Crea archivos de sitios web
-Comment[bg]=Създаване на архиви на сайтове
-Comment[bs]=Pravi arhive veb sajtova
-Comment[ca]=Crea arxius de llocs web
-Comment[ca at valencia]=Crea arxius de llocs web
-Comment[cs]=Vytvoří archiv z webových stránek
-Comment[da]=Kan arkivere websider
-Comment[de]=Erstellt ein Archiv von Webseiten
-Comment[el]=Δημιουργεί αρχειοθήκες από ιστοσελίδες
-Comment[en_GB]=Creates archives of websites
-Comment[es]=Crea archivos de sitios web
-Comment[et]=Võimaldab luua veebilehekülgede arhiive
-Comment[eu]=Webguneen artxiboak sortzen ditu
-Comment[fi]=Luo arkistoja verkkosivuista
-Comment[fr]=Crée des archives de sites Web
-Comment[ga]=Cruthaigh cartlann de shuímh Ghréasáin
-Comment[gl]=Crea arquivos de páxinas web
-Comment[he]=יוצר ארכיבים של אתרי אינטרנט
-Comment[hne]=वेबसाइट मन के अभिलेखागार बनाथे 
-Comment[hr]=Stvara arhive web stranica
-Comment[hu]=Weboldalak archívumának készítése
-Comment[ia]=Il crea archivos de sitos web
-Comment[id]=Menciptakan arsip situs web
-Comment[is]=Býr til safnskrár með vefsvæðum
-Comment[it]=Crea archivi di siti web
-Comment[ja]=ウェブサイトのアーカイブを作成します
-Comment[kk]=Вебсайттарының архивін құру
-Comment[km]=បង្កើត​ប័ណ្ណសារ​តំបន់​បណ្ដាញ
-Comment[ko]=웹 사이트의 보관 파일 만들기
-Comment[ku]=Arşîvên malperan diafirîne
-Comment[lt]=Sukuria archyvus iš žiniatinklio puslapių
-Comment[lv]=Izveido tīmekļa lapu arhīvus
-Comment[mr]=वेबसाइटचा संग्रह तयार करतो
-Comment[nb]=Lager arkiver av nettsteder
-Comment[nds]=Stellt Archiven ut Nettsieden op
-Comment[nl]=Maakt archieven van websites aan
-Comment[nn]=Lag arkiv av nettsider
-Comment[pa]=ਵੈੱਬ ਸਾਈਟਾਂ ਦਾ ਅਕਾਇਵ ਬਣਾਓ
-Comment[pl]=Tworzy archiwa dla stron internetowych
-Comment[pt]=Cria arquivos de páginas web
-Comment[pt_BR]=Cria arquivos de páginas da Internet
-Comment[ro]=Crează arhive ale siturilor web
-Comment[ru]=Создаёт архивы с содержимым веб-сайтов
-Comment[sk]=Vytvorí archív z webových stránok
-Comment[sl]=Ustvari arhive spletnih strani
-Comment[sr]=Прави архиве веб сајтова
-Comment[sr at ijekavian]=Прави архиве веб сајтова
-Comment[sr at ijekavianlatin]=Pravi arhive veb sajtova
-Comment[sr at latin]=Pravi arhive veb sajtova
-Comment[sv]=Skapar arkiv av webbplatser
-Comment[tg]=Бойгонии саҳифаҳои интернетро эҷод мекунад
-Comment[th]=สร้างแฟ้มจัดเก็บหน้าเว็บต่าง ๆ
-Comment[tr]=Sitelerin arşivlerini oluşturur
-Comment[ug]=تور بېكەتنىڭ ئارخىپىنى قۇرىدۇ
-Comment[uk]=Створює архіви вебсайтів
-Comment[wa]=Ahive des årtchives des waibes
-Comment[x-test]=xxCreates archives of websitesxx
-Comment[zh_CN]=创建网站的归档
-Comment[zh_TW]=建立網站的歸檔
-Icon=webarchiver
-X-KDE-ParentApp=konqueror
-DocPath=konq-plugins/webarchiver/index.html
diff --git a/plugins/webarchiver/plugin_webarchiver.h b/plugins/webarchiver/plugin_webarchiver.h
deleted file mode 100644
index d4906ec7d..000000000
--- a/plugins/webarchiver/plugin_webarchiver.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/* This file is part of Webarchiver
- *  Copyright (C) 2001 by Andreas Schlapbach <schlpbch at iam.unibe.ch>
- *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Library General Public
- *  License as published by the Free Software Foundation; either
- *  version 2 of the License, or (at your option) any later version.
- *
- *  This library is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- *  Library General Public License for more details.
- *
- *  You should have received a copy of the GNU Library General Public License
- *  along with this library; see the file COPYING.LIB.  If not, write to
- *  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- *  Boston, MA 02110-1301, USA.
- **/
-
-/* $Id$ */
-
-#ifndef plugin_webarchiver_h
-#define plugin_webarchiver_h
-
-#include <kparts/plugin.h>
-
-class PluginWebArchiver : public KParts::Plugin
-{
-    Q_OBJECT
-
-public:
-    PluginWebArchiver(QObject *parent,
-                      const QVariantList &);
-    ~PluginWebArchiver() override;
-
-public slots:
-    void slotSaveToArchive();
-};
-
-#endif
diff --git a/plugins/webarchiver/plugin_webarchiver.rc b/plugins/webarchiver/plugin_webarchiver.rc
deleted file mode 100644
index 635998224..000000000
--- a/plugins/webarchiver/plugin_webarchiver.rc
+++ /dev/null
@@ -1,11 +0,0 @@
-<!DOCTYPE gui SYSTEM "kpartgui.dtd">
-<gui name="webarchiver" library="webarchiverplugin" version="2" translationDomain="webarchiver">
-<MenuBar>
- <Menu name="tools"><text>&Tools</text>
-  <Action name="archivepage"/>
- </Menu>
-</MenuBar>
-<ToolBar name="extraToolBar"><text>Extra Toolbar</text>
-  <Action name="archivepage"/>
-</ToolBar>
-</gui>
diff --git a/plugins/webarchiver/webarchivecreator.cpp b/plugins/webarchiver/webarchivecreator.cpp
deleted file mode 100644
index 7868e9994..000000000
--- a/plugins/webarchiver/webarchivecreator.cpp
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
-   Copyright (C) 2001 Malte Starostik <malte at kde.org>
-
-   This program is free software; you can redistribute it and/or
-   modify it under the terms of the GNU General Public
-   License as published by the Free Software Foundation; either
-   version 2 of the License, or (at your option) any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program; see the file COPYING.  If not, write to
-   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-   Boston, MA 02110-1301, USA.
-*/
-
-// $Id$
-
-#include "webarchivecreator.h"
-
-#include <time.h>
-
-#include <QPixmap>
-#include <QImage>
-#include <QPainter>
-#include <QApplication>
-#include <QTimerEvent>
-#include <QAbstractEventDispatcher>
-#include <khtml_part.h>
-
-extern "C"
-{
-    Q_DECL_EXPORT ThumbCreator *new_creator()
-    {
-        return new WebArchiveCreator;
-    }
-}
-
-WebArchiveCreator::WebArchiveCreator()
-    : m_html(nullptr)
-{
-}
-
-WebArchiveCreator::~WebArchiveCreator()
-{
-    delete m_html;
-}
-
-bool WebArchiveCreator::create(const QString &path, int width, int height, QImage &img)
-{
-    if (!m_html) {
-        m_html = new KHTMLPart;
-        connect(m_html, SIGNAL(completed()), SLOT(slotCompleted()));
-        m_html->setJScriptEnabled(false);
-        m_html->setJavaEnabled(false);
-        m_html->setPluginsEnabled(false);
-    }
-    QUrl url;
-    url.setScheme(QStringLiteral("tar"));
-    url.setPath(path + '/' + QStringLiteral("index.html"));
-    m_html->openUrl(url);
-    m_completed = false;
-    int timerId = startTimer(5000);
-    while (!m_completed) {
-        qApp->processEvents(QEventLoop::WaitForMoreEvents);
-    }
-    killTimer(timerId);
-
-    // render the HTML page on a bigger pixmap and use smoothScale,
-    // looks better than directly scaling with the QPainter (malte)
-    QSize pixSize;
-    if (width > 400 || height > 600) {
-        if (height * 3 > width * 4) {
-            pixSize = QSize(width, width * 4 / 3);
-        } else {
-            pixSize = QSize(height * 3 / 4, height);
-        }
-    } else {
-        pixSize = QSize(400, 600);
-    }
-    QPixmap pix(pixSize);
-    // light-grey background, in case loadind the page failed
-    pix.fill(QColor(245, 245, 245));
-
-    int borderX = pix.width() / width,
-        borderY = pix.height() / height;
-    QRect rc(borderX, borderY, pix.width() - borderX * 2, pix.height() - borderY *
-             2);
-
-    QPainter p;
-    p.begin(&pix);
-    m_html->paint(&p, rc);
-    p.end();
-
-    img = pix.toImage();
-    return true;
-}
-
-void WebArchiveCreator::timerEvent(QTimerEvent *)
-{
-    m_html->closeUrl();
-    m_completed = true;
-}
-
-void WebArchiveCreator::slotCompleted()
-{
-    m_completed = true;
-}
-
-ThumbCreator::Flags WebArchiveCreator::flags() const
-{
-    return DrawFrame;
-}
-
diff --git a/plugins/webarchiver/webarchivecreator.h b/plugins/webarchiver/webarchivecreator.h
deleted file mode 100644
index 91f0b59e8..000000000
--- a/plugins/webarchiver/webarchivecreator.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
-   Copyright (C) 2001 Malte Starostik <malte at kde.org>
-
-   This program is free software; you can redistribute it and/or
-   modify it under the terms of the GNU General Public
-   License as published by the Free Software Foundation; either
-   version 2 of the License, or (at your option) any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program; see the file COPYING.  If not, write to
-   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-   Boston, MA 02110-1301, USA.
-*/
-
-// $Id$
-//
-#ifndef __webarchivecreator_h__
-#define __webarchivecreator_h__
-
-#include <kio/thumbcreator.h>
-//Added by qt3to4:
-#include <QTimerEvent>
-
-#include <QObject>
-#include <QString>
-
-class KHTMLPart;
-
-class WebArchiveCreator : public QObject, public ThumbCreator
-{
-    Q_OBJECT
-public:
-    WebArchiveCreator();
-    ~WebArchiveCreator() override;
-    bool create(const QString &path, int width, int height, QImage &img) override;
-    Flags flags() const override;
-
-protected:
-    void timerEvent(QTimerEvent *) override;
-
-private slots:
-    void slotCompleted();
-
-private:
-    KHTMLPart *m_html;
-    bool m_completed;
-};
-
-#endif
-
diff --git a/plugins/webarchiver/webarchivethumbnail.desktop b/plugins/webarchiver/webarchivethumbnail.desktop
deleted file mode 100644
index 50400e943..000000000
--- a/plugins/webarchiver/webarchivethumbnail.desktop
+++ /dev/null
@@ -1,67 +0,0 @@
-[Desktop Entry]
-Type=Service
-Name=Web Archives
-Name[ar]=أرشيف الويب
-Name[ast]=Archivos web
-Name[bg]=Архиви на страници
-Name[bs]=Veb arhive
-Name[ca]=Arxius web
-Name[ca at valencia]=Arxius web
-Name[cs]=Webové archivy
-Name[da]=Webarkiver
-Name[de]=Web-Archive
-Name[el]=Αρχειοθήκες ιστού
-Name[en_GB]=Web Archives
-Name[es]=Archivos web
-Name[et]=Veebiarhiivid
-Name[eu]=Web-artxiboak
-Name[fi]=Verkkosivuarkistot
-Name[fr]=Archives Web
-Name[ga]=Cartlanna Gréasáin
-Name[gl]=Arquivos web
-Name[he]=ארכיון אתרי אינטרנט
-Name[hne]=वेब अभिलेखागार
-Name[hr]=Web arhiva
-Name[hu]=Webarchívumok
-Name[ia]=Archivos Web
-Name[id]=Arsip Web
-Name[is]=Vefsíðusöfn
-Name[it]=Archivi web
-Name[ja]=ウェブアーカイブ
-Name[kk]=Веб-архивтері
-Name[km]=ប័ណ្ណសារ​តំបន់​បណ្ដាញ
-Name[ko]=웹 보관
-Name[ku]=Arşîvên Torê
-Name[lt]=Žiniatinklio archyvai
-Name[lv]=Tīmekļa arhīvi
-Name[mr]=वेब संग्रह
-Name[nb]=Nettarkiver
-Name[nds]=Nettarchiven
-Name[nl]=Webarchieven
-Name[nn]=Nettsidearkiv
-Name[pa]=ਵੈੱਬ ਅਕਾਇਵਰ
-Name[pl]=Archiwa sieciowe
-Name[pt]=Arquivos Web
-Name[pt_BR]=Arquivos da Internet
-Name[ro]=Arhive web
-Name[ru]=Архивы веб-страниц
-Name[sk]=Webové archívy
-Name[sl]=Spletni arhivi
-Name[sr]=Веб архиве
-Name[sr at ijekavian]=Веб архиве
-Name[sr at ijekavianlatin]=Veb arhive
-Name[sr at latin]=Veb arhive
-Name[sv]=Webbarkiv
-Name[tg]=Бойгонии интернетӣ
-Name[th]=แฟ้มจัดเก็บหน้าเว็บ
-Name[tr]=Web Arşivleri
-Name[ug]=تور ئارخىپلىرى
-Name[uk]=Вебархіви
-Name[wa]=Årtchives waibe
-Name[x-test]=xxWeb Archivesxx
-Name[zh_CN]=网页归档
-Name[zh_TW]=網頁歸檔
-X-KDE-ServiceTypes=ThumbCreator
-MimeType=application/x-webarchive;
-X-KDE-Library=webarchivethumbnail
-CacheThumbnail=true


More information about the kde-doc-english mailing list