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

List:       kde-commits
Subject:    [konqueror] plugins: Remove KUrl from autorefresh, dirfilter, domtreeview and fsview plugins
From:       Stefano Crocco <null () kde ! org>
Date:       2018-08-24 7:27:05
Message-ID: E1ft6Ur-0003ia-Jn () code ! kde ! org
[Download RAW message or body]

Git commit a466726fc3073087250baff512de8dd0cac8a385 by Stefano Crocco.
Committed on 24/08/2018 at 07:29.
Pushed by stefanocrocco into branch 'master'.

Remove KUrl from autorefresh, dirfilter, domtreeview and fsview plugins

Summary:
Remove use of KUrl from plugins

This is the first step in the long road to remove use of KDELibs4Support

Plugins which currently aren't compiled (for example, UAChanger or
AdBlock) haven't been changed

Test Plan: check that konqueror and its plugins compile

Reviewers: dfaure

Reviewed By: dfaure

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

M  +1    -5    plugins/autorefresh/autorefresh.cpp
M  +8    -8    plugins/dirfilter/dirfilterplugin.cpp
M  +3    -4    plugins/dirfilter/dirfilterplugin.h
M  +4    -4    plugins/domtreeviewer/domtreewindow.cpp
M  +6    -8    plugins/fsview/fsview.cpp
M  +1    -2    plugins/fsview/fsview.h
M  +7    -10   plugins/fsview/fsview_part.cpp
M  +1    -3    plugins/fsview/inode.cpp
M  +2    -4    plugins/fsview/scan.cpp
M  +2    -3    plugins/kimgalleryplugin/imgallerydialog.cpp
M  +1    -2    plugins/kimgalleryplugin/imgallerydialog.h
M  +23   -16   plugins/kimgalleryplugin/imgalleryplugin.cpp
M  +3    -4    plugins/kimgalleryplugin/imgalleryplugin.h
M  +0    -1    plugins/minitools/minitoolsplugin.h
M  +14   -11   plugins/rellinks/plugin_rellinks.cpp
M  +0    -4    plugins/searchbar/OpenSearchManager.h
M  +6    -6    plugins/searchbar/opensearch/OpenSearchEngine.cpp
M  +3    -3    plugins/searchbar/opensearch/OpenSearchEngine.h
M  +1    -5    plugins/shellcmdplugin/kshellcmdplugin.cpp
M  +11   -11   plugins/validators/plugin_validators.cpp
M  +7    -8    plugins/validators/plugin_validators.h
M  +39   -45   plugins/webarchiver/archivedialog.cpp
M  +13   -11   plugins/webarchiver/archivedialog.h
M  +3    -7    plugins/webarchiver/webarchivecreator.cpp

https://commits.kde.org/konqueror/a466726fc3073087250baff512de8dd0cac8a385

diff --git a/plugins/autorefresh/autorefresh.cpp \
b/plugins/autorefresh/autorefresh.cpp index f58782324..dd96ca542 100644
--- a/plugins/autorefresh/autorefresh.cpp
+++ b/plugins/autorefresh/autorefresh.cpp
@@ -32,10 +32,6 @@
 #include <kpluginfactory.h>
 #include <KParts/ReadOnlyPart>
 
-//KDELibs4Support
-
-#include <kurl.h>
-
 AutoRefresh::AutoRefresh(QObject *parent, const QVariantList & /*args*/)
     : Plugin(parent)
 {
@@ -121,7 +117,7 @@ void AutoRefresh::slotRefresh()
         KMessageBox::error(0, text, title);
     } else {
         // Get URL
-        KUrl url = part->url();
+        QUrl url = part->url();
         part->openUrl(url);
     }
 }
diff --git a/plugins/dirfilter/dirfilterplugin.cpp \
b/plugins/dirfilter/dirfilterplugin.cpp index bd9d910bc..1e45ca032 100644
--- a/plugins/dirfilter/dirfilterplugin.cpp
+++ b/plugins/dirfilter/dirfilterplugin.cpp
@@ -46,31 +46,31 @@
 
 K_GLOBAL_STATIC(SessionManager, globalSessionManager)
 
-static void generateKey(const KUrl &url, QString *key)
+static void generateKey(const QUrl &url, QString *key)
 {
     if (url.isValid()) {
-        *key = url.protocol();
+        *key = url.scheme();
         *key += QLatin1Char(':');
 
-        if (url.hasHost()) {
+        if (!url.host().isEmpty()) {
             *key += url.host();
             *key += QLatin1Char(':');
         }
 
-        if (url.hasPath()) {
+        if (!url.path().isEmpty()) {
             *key += url.path();
         }
     }
 }
 
-static void saveNameFilter(const KUrl &url, const QString &filter)
+static void saveNameFilter(const QUrl &url, const QString &filter)
 {
     SessionManager::Filters f = globalSessionManager->restore(url);
     f.nameFilter = filter;
     globalSessionManager->save(url, f);
 }
 
-static void saveTypeFilters(const KUrl &url, const QStringList &filters)
+static void saveTypeFilters(const QUrl &url, const QStringList &filters)
 {
     SessionManager::Filters f = globalSessionManager->restore(url);
     f.typeFilters = filters;
@@ -88,14 +88,14 @@ SessionManager::~SessionManager()
     saveSettings();
 }
 
-SessionManager::Filters SessionManager::restore(const KUrl &url)
+SessionManager::Filters SessionManager::restore(const QUrl &url)
 {
     QString key;
     generateKey(url, &key);
     return m_filters.value(key);
 }
 
-void SessionManager::save(const KUrl &url, const Filters &filters)
+void SessionManager::save(const QUrl &url, const Filters &filters)
 {
     QString key;
     generateKey(url, &key);
diff --git a/plugins/dirfilter/dirfilterplugin.h \
b/plugins/dirfilter/dirfilterplugin.h index 2f94526d4..661587166 100644
--- a/plugins/dirfilter/dirfilterplugin.h
+++ b/plugins/dirfilter/dirfilterplugin.h
@@ -24,13 +24,12 @@
 #include <QStringList>
 #include <QWidget>
 #include <QMenu>
+#include <QUrl>
 
-#include <kurl.h>
 #include <kparts/plugin.h>
 #include <kparts/listingextension.h>
 
 class QPushButton;
-class KUrl;
 class KFileItemList;
 class KLineEdit;
 namespace KParts
@@ -81,8 +80,8 @@ public:
 
     SessionManager();
     ~SessionManager();
-    Filters restore(const KUrl &url);
-    void save(const KUrl &url, const Filters &filters);
+    Filters restore(const QUrl &url);
+    void save(const QUrl &url, const Filters &filters);
 
     bool showCount;
     bool useMultipleFilters;
diff --git a/plugins/domtreeviewer/domtreewindow.cpp \
b/plugins/domtreeviewer/domtreewindow.cpp index 24921f088..0103f2b11 100644
--- a/plugins/domtreeviewer/domtreewindow.cpp
+++ b/plugins/domtreeviewer/domtreewindow.cpp
@@ -33,7 +33,6 @@
 #include <kstandarddirs.h>
 #include <kstandardguiitem.h>
 #include <ktextedit.h>
-#include <kurl.h>
 #include <kurlrequesterdialog.h>
 #include <kxmlguifactory.h>
 #include <kparts/partmanager.h>
@@ -48,6 +47,7 @@
 #include <QDragEnterEvent>
 #include <QMenu>
 #include <QDropEvent>
+#include <QMimeData>
 
 //KDELibs4Support
 #include <kdialog.h>
@@ -285,7 +285,7 @@ void DOMTreeWindow::saveProperties(KConfigGroup &config)
 
     void DOMTreeWindow::dragEnterEvent(QDragEnterEvent * event) {
         // accept uri drops only
-        event->setAccepted(KUrl::List::canDecode(event->mimeData()));
+        event->setAccepted(event->mimeData()->hasUrls());
     }
 
     void DOMTreeWindow::dropEvent(QDropEvent * event) {
@@ -294,10 +294,10 @@ void DOMTreeWindow::saveProperties(KConfigGroup &config)
         // much more, so please read the docs there
 
         // see if we can decode a URI.. if not, just ignore it
-        KUrl::List urls = KUrl::List::fromMimeData(event->mimeData());
+        QList<QUrl> urls = event->mimeData()->urls();
         if (!urls.isEmpty()) {
             // okay, we have a URI.. process it
-            const KUrl &url = urls.first();
+            const QUrl &url = urls.first();
 #if 0
             // load in the file
             load(url);
diff --git a/plugins/fsview/fsview.cpp b/plugins/fsview/fsview.cpp
index e1e73b04b..e2552064e 100644
--- a/plugins/fsview/fsview.cpp
+++ b/plugins/fsview/fsview.cpp
@@ -28,7 +28,6 @@
 #include <kconfig.h>
 #include <kdebug.h>
 #include <kmessagebox.h>
-#include <kurl.h>
 
 #include <kio/job.h>
 #include <kauthorized.h>
@@ -142,10 +141,10 @@ void FSView::setPath(const QString &p)
     _path = QDir::cleanPath(_path);
     _pathDepth = _path.count('/');
 
-    KUrl u;
+    QUrl u;
     u.setPath(_path);
-    if (!KUrlAuthorized::authorizeUrlAction(QStringLiteral("list"), KUrl(), u)) {
-        QString msg = KIO::buildErrorString(KIO::ERR_ACCESS_DENIED, u.prettyUrl());
+    if (!KUrlAuthorized::authorizeUrlAction(QStringLiteral("list"), QUrl(), u)) {
+        QString msg = KIO::buildErrorString(KIO::ERR_ACCESS_DENIED, \
u.toDisplayString());  KMessageBox::sorry(this, msg);
     }
 
@@ -157,13 +156,12 @@ void FSView::setPath(const QString &p)
     requestUpdate(b);
 }
 
-KUrl::List FSView::selectedUrls()
+QList<QUrl> FSView::selectedUrls()
 {
-    KUrl::List urls;
+    QList<QUrl> urls;
 
     foreach (TreeMapItem *i, selection()) {
-        KUrl u;
-        u.setPath(((Inode *)i)->path());
+        QUrl u = QUrl::fromLocalFile(((Inode *)i)->path());
         urls.append(u);
     }
     return urls;
diff --git a/plugins/fsview/fsview.h b/plugins/fsview/fsview.h
index 62a2b32c1..785569569 100644
--- a/plugins/fsview/fsview.h
+++ b/plugins/fsview/fsview.h
@@ -27,7 +27,6 @@
 #include <qfileinfo.h>
 #include <qstring.h>
 
-#include <kurl.h>
 #include <kmimetype.h>
 #include <kconfiggroup.h>
 
@@ -115,7 +114,7 @@ public:
     // for color mode
     void addColorItems(QMenu *, int);
 
-    KUrl::List selectedUrls();
+    QList<QUrl> selectedUrls();
 
 public slots:
     void selected(TreeMapItem *);
diff --git a/plugins/fsview/fsview_part.cpp b/plugins/fsview/fsview_part.cpp
index a472fff9d..ff584fd32 100644
--- a/plugins/fsview/fsview_part.cpp
+++ b/plugins/fsview/fsview_part.cpp
@@ -344,11 +344,10 @@ void FSViewPart::setNonStandardActionEnabled(const char \
*actionName, bool enable  void FSViewPart::updateActions()
 {
     int canDel = 0, canCopy = 0, canMove = 0;
-    KUrl::List urls;
+    QList<QUrl> urls;
 
     foreach (TreeMapItem *i, _view->selection()) {
-        KUrl u;
-        u.setPath(((Inode *)i)->path());
+        QUrl u = QUrl::fromLocalFile(((Inode *)i)->path());
         urls.append(u);
         canCopy++;
         if (KProtocolManager::supportsDeleting(u)) {
@@ -386,8 +385,7 @@ void FSViewPart::contextMenu(TreeMapItem * /*item*/, const QPoint \
&p)  KFileItemList items;
 
     foreach (TreeMapItem *i, _view->selection()) {
-        KUrl u;
-        u.setPath(((Inode *)i)->path());
+        QUrl u = QUrl::fromLocalFile(((Inode *)i)->path());
         QString mimetype = ((Inode *)i)->mimeType().name();
         const QFileInfo &info = ((Inode *)i)->fileInfo();
         mode_t mode =
@@ -449,7 +447,7 @@ void FSViewPart::contextMenu(TreeMapItem * /*item*/, const QPoint \
&p)  
 void FSViewPart::slotProperties()
 {
-    KUrl::List urlList;
+    QList<QUrl> urlList;
     if (view()) {
         urlList = view()->selectedUrls();
     }
@@ -472,7 +470,7 @@ FSViewBrowserExtension::~FSViewBrowserExtension()
 
 void FSViewBrowserExtension::del()
 {
-    const KUrl::List urls = _view->selectedUrls();
+    const QList<QUrl> urls = _view->selectedUrls();
     KIO::JobUiDelegate uiDelegate;
     uiDelegate.setWindow(_view);
     if (uiDelegate.askDeleteConfirmation(urls,
@@ -497,7 +495,7 @@ void FSViewBrowserExtension::trash(Qt::MouseButtons, \
Qt::KeyboardModifiers modif  if (uiDelegate.askDeleteConfirmation(urls,
                                              KIO::JobUiDelegate::Trash, \
KIO::JobUiDelegate::DefaultConfirmation)) {  KIO::Job *job = KIO::trash(urls);
-            KIO::FileUndoManager::self()->recordJob(KIO::FileUndoManager::Trash, \
urls, KUrl("trash:/"), job); +            \
KIO::FileUndoManager::self()->recordJob(KIO::FileUndoManager::Trash, urls, \
QUrl("trash:/"), job);  KJobWidgets::setWindow(job, _view);
             job->ui()->setAutoErrorHandlingEnabled(true);
             connect(job, SIGNAL(result(KJob*)),
@@ -551,8 +549,7 @@ void FSViewBrowserExtension::selected(TreeMapItem *i)
         return;
     }
 
-    KUrl url;
-    url.setPath(((Inode *)i)->path());
+    QUrl url = QUrl::fromLocalFile(((Inode *)i)->path());
     emit openUrlRequest(url);
 }
 
diff --git a/plugins/fsview/inode.cpp b/plugins/fsview/inode.cpp
index 8b3950238..5fa39cc8f 100644
--- a/plugins/fsview/inode.cpp
+++ b/plugins/fsview/inode.cpp
@@ -20,8 +20,6 @@
  * FSView specialisaton of TreeMapItem class.
  */
 
-#include <kurl.h>
-
 #include <kdebug.h>
 #include <kglobal.h>
 #include <kiconloader.h>
@@ -423,7 +421,7 @@ QPixmap Inode::pixmap(int i) const
     }
 
     if (!_mimePixmapSet) {
-        KUrl u(path());
+        QUrl u = QUrl::fromLocalFile(path());
         _mimePixmap = \
KIconLoader::global()->loadMimeTypeIcon(KIO::iconNameForUrl(u), KIconLoader::Small);  \
_mimePixmapSet = true;  }
diff --git a/plugins/fsview/scan.cpp b/plugins/fsview/scan.cpp
index 1df6c440c..700cfe882 100644
--- a/plugins/fsview/scan.cpp
+++ b/plugins/fsview/scan.cpp
@@ -22,7 +22,6 @@
 #include <qplatformdefs.h>
 
 #include <kdebug.h>
-#include <kurl.h>
 #include <kauthorized.h>
 #include <kurlauthorized.h>
 
@@ -269,9 +268,8 @@ int ScanDir::scan(ScanItem *si, ScanItemList &list, int data)
         return 0;
     }
 
-    KUrl u;
-    u.setPath(si->absPath);
-    if (!KUrlAuthorized::authorizeUrlAction(QStringLiteral("list"), KUrl(), u)) {
+    QUrl u = QUrl::fromLocalFile(si->absPath);
+    if (!KUrlAuthorized::authorizeUrlAction(QStringLiteral("list"), QUrl(), u)) {
         if (_parent) {
             _parent->subScanFinished();
         }
diff --git a/plugins/kimgalleryplugin/imgallerydialog.cpp \
b/plugins/kimgalleryplugin/imgallerydialog.cpp index 56c4928d3..060320321 100644
--- a/plugins/kimgalleryplugin/imgallerydialog.cpp
+++ b/plugins/kimgalleryplugin/imgallerydialog.cpp
@@ -32,7 +32,6 @@ Boston, MA 02110-1301, USA.
 #include <QGridLayout>
 
 #include <KLocalizedString>
-#include <kurl.h>
 #include <kfontdialog.h>
 #include <kiconloader.h>
 #include <klineedit.h>
@@ -450,14 +449,14 @@ const QString KIGPDialog::getTitle() const
     return m_title->text();
 }
 
-const KUrl KIGPDialog::getImageUrl() const
+const QUrl KIGPDialog::getImageUrl() const
 {
     return m_imageNameReq->url();
 }
 
 const QString KIGPDialog::getCommentFile() const
 {
-    return m_commentFileReq->url().path();
+    return m_commentFileReq->url().toLocalFile();
 }
 
 const QString KIGPDialog::getFontName() const
diff --git a/plugins/kimgalleryplugin/imgallerydialog.h \
b/plugins/kimgalleryplugin/imgallerydialog.h index 288e7f20d..ce123c9ac 100644
--- a/plugins/kimgalleryplugin/imgallerydialog.h
+++ b/plugins/kimgalleryplugin/imgallerydialog.h
@@ -23,7 +23,6 @@
 
 #include <kpagedialog.h>
 
-class KUrl;
 class KIntNumInput;
 class QCheckBox;
 class QLineEdit;
@@ -58,7 +57,7 @@ public:
     int getColorDepth() const;
 
     const QString getTitle() const;
-    const KUrl getImageUrl() const;
+    const QUrl getImageUrl() const;
     const QString getCommentFile() const;
     const QString getFontName() const;
     const QString getFontSize() const;
diff --git a/plugins/kimgalleryplugin/imgalleryplugin.cpp \
b/plugins/kimgalleryplugin/imgalleryplugin.cpp index ee964fece..0d3244535 100644
--- a/plugins/kimgalleryplugin/imgalleryplugin.cpp
+++ b/plugins/kimgalleryplugin/imgalleryplugin.cpp
@@ -32,7 +32,6 @@ Boston, MA 02110-1301, USA.
 #include <KLocalizedString>
 #include <kcharsets.h>
 #include <kmessagebox.h>
-#include <kurl.h>
 #include <kimageio.h>
 
 #include <kdebug.h>
@@ -53,6 +52,10 @@ Boston, MA 02110-1301, USA.
 
 K_PLUGIN_FACTORY(KImGalleryPluginFactory, registerPlugin<KImGalleryPlugin>();)
 
+static QString directory(const QUrl &url) {
+    return url.adjusted(QUrl::StripTrailingSlash).adjusted(QUrl::RemoveFilename).toLocalFile();
 +}
+
 KImGalleryPlugin::KImGalleryPlugin(QObject *parent, const QVariantList &)
     : KParts::Plugin(parent), m_commentMap(0)
 {
@@ -88,7 +91,7 @@ void KImGalleryPlugin::slotExecute()
         m_useCommentFile = m_configDlg->useCommentFile();
         m_imagesPerRow = m_configDlg->getImagesPerRow();
 
-        KUrl url(m_configDlg->getImageUrl());
+        QUrl url(m_configDlg->getImageUrl());
         if (!url.isEmpty() && url.isValid()) {
             m_progressDlg = new QProgressDialog(m_part->widget());
             QObject::connect(m_progressDlg, SIGNAL(canceled()), this, \
SLOT(slotCancelled())); @@ -171,10 +174,10 @@ QString \
KImGalleryPlugin::extension(const QString &imageFormat)  }
 
 void KImGalleryPlugin::createBody(QTextStream &stream, const QString &sourceDirName, \
                const QStringList &subDirList,
-                                  const QDir &imageDir, const KUrl &url, const \
QString &imageFormat) +                                  const QDir &imageDir, const \
QUrl &url, const QString &imageFormat)  {
     int numOfImages = imageDir.count();
-    const QString imgGalleryDir = url.directory();
+    const QString imgGalleryDir = directory(url);
     const QString today(KLocale::global()->formatDate(QDate::currentDate()));
 
     stream << "<body>\n<h1>" << m_configDlg->getTitle().toHtmlEscaped() << \
"</h1><p>" << endl; @@ -258,7 +261,7 @@ void KImGalleryPlugin::createBody(QTextStream \
&stream, const QString &sourceDirN  stream << "</table>\n</body>\n</html>" << endl;
 }
 
-bool KImGalleryPlugin::createHtml(const KUrl &url, const QString &sourceDirName, int \
recursionLevel, const QString &imageFormat) +bool KImGalleryPlugin::createHtml(const \
QUrl &url, const QString &sourceDirName, int recursionLevel, const QString \
&imageFormat)  {
     if (m_cancelled) {
         return false;
@@ -279,17 +282,17 @@ bool KImGalleryPlugin::createHtml(const KUrl &url, const \
                QString &sourceDirName,
             if (currentDir == QLatin1String(".") || currentDir == \
QLatin1String("..")) {  continue;   //disregard the "." and ".." directories
             }
-            QDir subDir = QDir(url.directory() + '/' + currentDir);
+            QDir subDir = QDir(directory(url) + '/' + currentDir);
             if (!subDir.exists()) {
-                subDir.setPath(url.directory());
+                subDir.setPath(directory(url));
                 if (!(subDir.mkdir(currentDir/*, false*/))) {
                     KMessageBox::sorry(m_part->widget(), i18n("Could not create \
folder: %1", subDir.path()));  continue;
                 } else {
-                    subDir.setPath(url.directory() + '/' + currentDir);
+                    subDir.setPath(directory(url) + '/' + currentDir);
                 }
             }
-            if (!createHtml(KUrl(subDir.path() + '/' + url.fileName()), \
sourceDirName + '/' + currentDir, +            if \
(!createHtml(QUrl::fromLocalFile(subDir.path() + '/' + url.fileName()), sourceDirName \
                + '/' + currentDir,
                             recursionLevel > 1 ? recursionLevel - 1 : 0, \
imageFormat)) {  return false;
             }
@@ -308,7 +311,7 @@ bool KImGalleryPlugin::createHtml(const KUrl &url, const QString \
&sourceDirName,  QDir imageDir(sourceDirName, filter.toLatin1(),
                   QDir::Name | QDir::IgnoreCase, QDir::Files | QDir::Readable);
 
-    const QString imgGalleryDir = url.directory();
+    const QString imgGalleryDir = directory(url);
     kDebug(90170) << "imgGalleryDir: " << imgGalleryDir;
 
     // Create the "thumbs" subdirectory if necessary
@@ -341,12 +344,16 @@ bool KImGalleryPlugin::createHtml(const KUrl &url, const \
QString &sourceDirName,  return !m_cancelled;
 
     } else {
-        KMessageBox::sorry(m_part->widget(), i18n("Could not open file: %1", \
url.path(KUrl::AddTrailingSlash))); +        QString path = url.toLocalFile();
+        if (!path.endsWith("/")) {
+            path += '/';
+        }
+        KMessageBox::sorry(m_part->widget(), i18n("Could not open file: %1", path));
         return false;
     }
 }
 
-void KImGalleryPlugin::deleteCancelledGallery(const KUrl &url, const QString \
&sourceDirName, int recursionLevel, const QString &imageFormat) +void \
KImGalleryPlugin::deleteCancelledGallery(const QUrl &url, const QString \
&sourceDirName, int recursionLevel, const QString &imageFormat)  {
     if (m_recurseSubDirectories && (recursionLevel >= 0)) {
         QStringList subDirList;
@@ -358,13 +365,13 @@ void KImGalleryPlugin::deleteCancelledGallery(const KUrl &url, \
                const QString &so
             if (*it == QLatin1String(".") || *it == QLatin1String("..") || *it == \
QLatin1String("thumbs") || (m_copyFiles && *it == QLatin1String("images"))) {  \
continue; //disregard the "." and ".." directories  }
-            deleteCancelledGallery(KUrl(url.directory() + '/' + *it + '/' + \
url.fileName()), +            \
deleteCancelledGallery(QUrl::fromLocalFile(directory(url) + '/' + *it + '/' + \
url.fileName()),  sourceDirName + '/' + *it,
                                    recursionLevel > 1 ? recursionLevel - 1 : 0, \
imageFormat);  }
     }
 
-    const QString imgGalleryDir = url.directory();
+    const QString imgGalleryDir = directory(url);
     QDir thumb_dir(imgGalleryDir + QLatin1String("/thumbs/"));
     QDir images_dir(imgGalleryDir + QLatin1String("/images/"));
     QDir imageDir(sourceDirName, QStringLiteral("*.png *.PNG *.gif *.GIF *.jpg *.JPG \
*.jpeg *.JPEG *.bmp *.BMP"), @@ -448,9 +455,9 @@ bool \
KImGalleryPlugin::createThumb(const QString &imgName, const QString &source  const \
QString pixPath = sourceDirName + QLatin1String("/") + imgName;  
     if (m_copyFiles) {
-        KUrl srcURL = KUrl(pixPath);
+        QUrl srcURL = QUrl::fromLocalFile(pixPath);
         //kDebug(90170) << "srcURL: " << srcURL;
-        KUrl destURL = KUrl(imgGalleryDir + QLatin1String("/images/") + imgName);
+        QUrl destURL = QUrl::fromLocalFile(imgGalleryDir + QLatin1String("/images/") \
+ imgName);  //kDebug(90170) << "destURL: " << destURL;
         KIO::NetAccess::file_copy(srcURL, destURL, static_cast<KParts::Part \
*>(parent())->widget());  }
diff --git a/plugins/kimgalleryplugin/imgalleryplugin.h \
b/plugins/kimgalleryplugin/imgalleryplugin.h index 1da92480c..70b56f9dd 100644
--- a/plugins/kimgalleryplugin/imgalleryplugin.h
+++ b/plugins/kimgalleryplugin/imgalleryplugin.h
@@ -26,7 +26,6 @@ Boston, MA 02110-1301, USA.
 #include <QDir>
 
 class QProgressDialog;
-class KUrl;
 class KIGPDialog;
 class QTextStream;
 
@@ -66,12 +65,12 @@ private:
 
     void createHead(QTextStream &stream);
     void createCSSSection(QTextStream &stream);
-    void createBody(QTextStream &stream, const QString &sourceDirName, const \
QStringList &subDirList, const QDir &imageDir, const KUrl &url, const QString \
&imageFormat); +    void createBody(QTextStream &stream, const QString \
&sourceDirName, const QStringList &subDirList, const QDir &imageDir, const QUrl &url, \
const QString &imageFormat);  
     bool createThumb(const QString &imgName, const QString &sourceDirName, const \
QString &imgGalleryDir, const QString &imageFormat);  
-    bool createHtml(const KUrl &url, const QString &sourceDirName, int \
                recursionLevel, const QString &imageFormat);
-    void deleteCancelledGallery(const KUrl &url, const QString &sourceDirName, int \
recursionLevel, const QString &imageFormat); +    bool createHtml(const QUrl &url, \
const QString &sourceDirName, int recursionLevel, const QString &imageFormat); +    \
void deleteCancelledGallery(const QUrl &url, const QString &sourceDirName, int \
recursionLevel, const QString &imageFormat);  void loadCommentFile();
 
     static QString extension(const QString &imageFormat);
diff --git a/plugins/minitools/minitoolsplugin.h \
b/plugins/minitools/minitoolsplugin.h index 1346cee50..21ab421bd 100644
--- a/plugins/minitools/minitoolsplugin.h
+++ b/plugins/minitools/minitoolsplugin.h
@@ -25,7 +25,6 @@
 #include <QList>
 #include <qstringlist.h>
 
-#include <kurl.h>
 #include <klibloader.h>
 #include <kparts/plugin.h>
 
diff --git a/plugins/rellinks/plugin_rellinks.cpp \
b/plugins/rellinks/plugin_rellinks.cpp index db15b748d..639492b02 100644
--- a/plugins/rellinks/plugin_rellinks.cpp
+++ b/plugins/rellinks/plugin_rellinks.cpp
@@ -41,7 +41,6 @@
 #include <KLocalizedString>
 #include <QMenu>
 #include <ktoolbar.h>
-#include <kurl.h>
 #include <kactionmenu.h>
 #include <kactioncollection.h>
 // local includes
@@ -52,6 +51,10 @@
 K_PLUGIN_FACTORY(RelLinksFactory, registerPlugin<RelLinksPlugin>();)
 #include <kaboutdata.h>
 
+static QUrl resolvedUrl(const QUrl &base, const QString& rel) {
+    return QUrl(base).resolved(QUrl(rel));
+}
+
 Q_DECLARE_METATYPE(DOM::Element);
 
 /** Constructor of the plugin. */
@@ -382,9 +385,9 @@ void RelLinksPlugin::updateToolbar()
         QString title = e.getAttribute("title").string();
         QString hreflang = e.getAttribute("hreflang").string();
 
-        KUrl ref(m_part->url(), href);
+        QUrl ref(resolvedUrl(m_part->url(), href));
         if (title.isEmpty()) {
-            title = ref.prettyUrl();
+            title = ref.toDisplayString();
         }
 
         // escape ampersand before settings as action title, otherwise the menu \
entry will interpret it as an @@ -473,8 +476,8 @@ void \
RelLinksPlugin::guessRelations()  }
 
         QString href = rx.cap(1) + nval_str + rx.cap(3);
-        KUrl ref(m_part->url(), href);
-        QString title = i18n("[Autodetected] %1", ref.prettyUrl());
+        QUrl ref(resolvedUrl(m_part->url(), href));
+        QString title = i18n("[Autodetected] %1", ref.toDisplayString());
         DOM::Element e = m_part->document().createElement("link");
         e.setAttribute("href", href);
         QAction *a = actionCollection()->action(QStringLiteral("rellinks_next"));
@@ -488,8 +491,8 @@ void RelLinksPlugin::guessRelations()
                 nval_str.prepend(zeros.left(lenval - nval_str.length()));
             }
             QString href = rx.cap(1) + nval_str + rx.cap(3);
-            KUrl ref(m_part->url(), href);
-            QString title = i18n("[Autodetected] %1", ref.prettyUrl());
+            QUrl ref(resolvedUrl(m_part->url(), href));
+            QString title = i18n("[Autodetected] %1", ref.toDisplayString());
             e = m_part->document().createElement("link");
             e.setAttribute("href", href);
             QAction *a = \
actionCollection()->action(QStringLiteral("rellinks_prev")); @@ -508,7 +511,7 @@ void \
RelLinksPlugin::goToLink(DOM::Element e)  return;
     }
     QString href = e.getAttribute("href").string();
-    KUrl url(part->url(), href);
+    QUrl url(resolvedUrl(part->url(), href));
     QString target = e.getAttribute("target").string();
 
     // URL arguments
@@ -520,9 +523,9 @@ void RelLinksPlugin::goToLink(DOM::Element e)
     if (url.isValid()) {
         part->browserExtension()->openUrlRequest(url, arguments, browserArguments);
     } else {
-        KUrl baseURL = part->baseURL();
-        QString endURL = url.prettyUrl();
-        KUrl realURL = KUrl(baseURL, endURL);
+        QUrl baseURL = part->baseURL();
+        QString endURL = url.toDisplayString();
+        QUrl realURL = resolvedUrl(baseURL, endURL);
         part->browserExtension()->openUrlRequest(realURL, arguments, \
browserArguments);  }
 
diff --git a/plugins/searchbar/OpenSearchManager.h \
b/plugins/searchbar/OpenSearchManager.h index d68693bf3..b5fb43107 100644
--- a/plugins/searchbar/OpenSearchManager.h
+++ b/plugins/searchbar/OpenSearchManager.h
@@ -23,10 +23,6 @@
 #include <QtCore/QObject>
 #include <kio/jobclasses.h>
 
-//KDELibs4Support
-#include <kurl.h>
-
-
 class OpenSearchEngine;
 
 /**
diff --git a/plugins/searchbar/opensearch/OpenSearchEngine.cpp \
b/plugins/searchbar/opensearch/OpenSearchEngine.cpp index 9fa674677..11b81bcf7 100644
--- a/plugins/searchbar/opensearch/OpenSearchEngine.cpp
+++ b/plugins/searchbar/opensearch/OpenSearchEngine.cpp
@@ -82,13 +82,13 @@ void OpenSearchEngine::setSearchUrlTemplate(const QString \
&searchUrlTemplate)  m_searchUrlTemplate = searchUrlTemplate;
 }
 
-KUrl OpenSearchEngine::searchUrl(const QString &searchTerm) const
+QUrl OpenSearchEngine::searchUrl(const QString &searchTerm) const
 {
     if (m_searchUrlTemplate.isEmpty()) {
-        return KUrl();
+        return QUrl();
     }
 
-    KUrl retVal = KUrl::fromEncoded(parseTemplate(searchTerm, \
m_searchUrlTemplate).toUtf8()); +    QUrl retVal = \
QUrl::fromEncoded(parseTemplate(searchTerm, m_searchUrlTemplate).toUtf8());  
     QList<Parameter>::const_iterator end = m_searchParameters.constEnd();
     QList<Parameter>::const_iterator i = m_searchParameters.constBegin();
@@ -114,13 +114,13 @@ void OpenSearchEngine::setSuggestionsUrlTemplate(const QString \
&suggestionsUrlTe  m_suggestionsUrlTemplate = suggestionsUrlTemplate;
 }
 
-KUrl OpenSearchEngine::suggestionsUrl(const QString &searchTerm) const
+QUrl OpenSearchEngine::suggestionsUrl(const QString &searchTerm) const
 {
     if (m_suggestionsUrlTemplate.isEmpty()) {
-        return KUrl();
+        return QUrl();
     }
 
-    KUrl retVal = KUrl::fromEncoded(parseTemplate(searchTerm, \
m_suggestionsUrlTemplate).toUtf8()); +    QUrl retVal = \
QUrl::fromEncoded(parseTemplate(searchTerm, m_suggestionsUrlTemplate).toUtf8());  
     QList<Parameter>::const_iterator end = m_suggestionsParameters.constEnd();
     QList<Parameter>::const_iterator i = m_suggestionsParameters.constBegin();
diff --git a/plugins/searchbar/opensearch/OpenSearchEngine.h \
b/plugins/searchbar/opensearch/OpenSearchEngine.h index fd2746518..bcb35320d 100644
--- a/plugins/searchbar/opensearch/OpenSearchEngine.h
+++ b/plugins/searchbar/opensearch/OpenSearchEngine.h
@@ -24,7 +24,7 @@
 #include <QtCore/QPair>
 #include <QImage>
 
-#include <KUrl>
+#include <QUrl>
 
 class QScriptEngine;
 
@@ -44,13 +44,13 @@ public:
 
     QString searchUrlTemplate() const;
     void setSearchUrlTemplate(const QString &searchUrl);
-    KUrl searchUrl(const QString &searchTerm) const;
+    QUrl searchUrl(const QString &searchTerm) const;
 
     bool providesSuggestions() const;
 
     QString suggestionsUrlTemplate() const;
     void setSuggestionsUrlTemplate(const QString &suggestionsUrl);
-    KUrl suggestionsUrl(const QString &searchTerm) const;
+    QUrl suggestionsUrl(const QString &searchTerm) const;
 
     QList<Parameter> searchParameters() const;
     void setSearchParameters(const QList<Parameter> &searchParameters);
diff --git a/plugins/shellcmdplugin/kshellcmdplugin.cpp \
b/plugins/shellcmdplugin/kshellcmdplugin.cpp index 8b5d9ddca..59e6e7aae 100644
--- a/plugins/shellcmdplugin/kshellcmdplugin.cpp
+++ b/plugins/shellcmdplugin/kshellcmdplugin.cpp
@@ -31,10 +31,6 @@
 #include <KParts/ReadOnlyPart>
 #include <QAction>
 
-//KDELibs4Support
-#include <kurl.h>
-
-
 KShellCmdPlugin::KShellCmdPlugin(QObject *parent, const QVariantList &)
     : KParts::Plugin(parent)
 {
@@ -57,7 +53,7 @@ void KShellCmdPlugin::slotExecuteShellCommand()
         return;
     }
 
-    KUrl url = KIO::NetAccess::mostLocalUrl(part->url(), NULL);
+    QUrl url = KIO::NetAccess::mostLocalUrl(part->url(), NULL);
     if (!url.isLocalFile()) {
         KMessageBox::sorry(part->widget(), i18n("Executing shell commands works only \
on local directories."));  return;
diff --git a/plugins/validators/plugin_validators.cpp \
b/plugins/validators/plugin_validators.cpp index f35bf8f9b..46460d64a 100644
--- a/plugins/validators/plugin_validators.cpp
+++ b/plugins/validators/plugin_validators.cpp
@@ -226,11 +226,11 @@ QString getLinkValidatorUrl()
 
 void PluginValidators::setURLs()
 {
-    m_WWWValidatorUrl = KUrl(getWWWValidatorUrl());
-    m_CSSValidatorUrl = KUrl(getCSSValidatorUrl());
-    m_WWWValidatorUploadUrl = KUrl(getWWWValidatorUploadUrl());
-    m_CSSValidatorUploadUrl = KUrl(getCSSValidatorUploadUrl());
-    m_linkValidatorUrl = KUrl(getLinkValidatorUrl());
+    m_WWWValidatorUrl = QUrl(getWWWValidatorUrl());
+    m_CSSValidatorUrl = QUrl(getCSSValidatorUrl());
+    m_WWWValidatorUploadUrl = QUrl(getWWWValidatorUploadUrl());
+    m_CSSValidatorUploadUrl = QUrl(getCSSValidatorUploadUrl());
+    m_linkValidatorUrl = QUrl(getLinkValidatorUrl());
 }
 
 void PluginValidators::slotStarted(KIO::Job *)
@@ -433,15 +433,15 @@ void PluginValidators::slotConfigure()
     m_configDialog->show();
 }
 
-void PluginValidators::validateByUri(const KUrl &url)
+void PluginValidators::validateByUri(const QUrl &url)
 {
     if (!doExternalValidationChecks()) {
         return;
     }
 
-    KUrl partUrl = m_part->url();
-    KUrl validatorUrl(url);
-    if (partUrl.hasPass()) {
+    QUrl partUrl = m_part->url();
+    QUrl validatorUrl(url);
+    if (!partUrl.password().isEmpty()) {
         KMessageBox::sorry(
             m_part->widget(),
             i18n("<qt>The selected URL cannot be verified because it contains "
@@ -460,7 +460,7 @@ void PluginValidators::validateByUri(const KUrl &url)
     emit ext->openUrlRequest(validatorUrl, urlArgs, browserArgs);
 }
 
-void PluginValidators::validateByUpload(const KUrl &validatorUrl, const \
QList<QPair<QByteArray, QByteArray> > &formData) +void \
PluginValidators::validateByUpload(const QUrl &validatorUrl, const \
QList<QPair<QByteArray, QByteArray> > &formData)  {
     KParts::BrowserExtension *ext = KParts::BrowserExtension::childObject(m_part);
     KParts::OpenUrlArguments urlArgs;
@@ -525,7 +525,7 @@ bool PluginValidators::doExternalValidationChecks()
     }
 
     // Get URL
-    KUrl partUrl = m_part->url();
+    QUrl partUrl = m_part->url();
     if (!partUrl.isValid()) { // Just in case ;)
         const QString title = i18nc("@title:window", "Malformed URL");
         const QString text = i18n("The URL you entered is not valid, please "
diff --git a/plugins/validators/plugin_validators.h \
b/plugins/validators/plugin_validators.h index abe2e5d14..829365c06 100644
--- a/plugins/validators/plugin_validators.h
+++ b/plugins/validators/plugin_validators.h
@@ -31,14 +31,13 @@
 #include "validatorsdialog.h"
 
 #include <qpointer.h>
+#include <QUrl>
 
 #include <kparts/plugin.h>
 
-//KDELibs4Support
-#include <kurl.h>
 
 class KActionMenu;
-class KUrl;
+
 namespace KIO
 {
 class Job;
@@ -84,9 +83,9 @@ private:
     // +-> Order dependency.
     KParts::ReadOnlyPart *m_part;                // |
 
-    KUrl m_WWWValidatorUrl, m_WWWValidatorUploadUrl;
-    KUrl m_CSSValidatorUrl, m_CSSValidatorUploadUrl;
-    KUrl m_linkValidatorUrl;
+    QUrl m_WWWValidatorUrl, m_WWWValidatorUploadUrl;
+    QUrl m_CSSValidatorUrl, m_CSSValidatorUploadUrl;
+    QUrl m_linkValidatorUrl;
 
     QAction *m_validateHtmlUri, *m_validateHtmlUpload;
     QAction *m_validateCssUri, *m_validateCssUpload;
@@ -101,8 +100,8 @@ private:
     bool canValidateByUpload() const;
     bool canValidateLocally() const;
     QString documentSource() const;
-    void validateByUri(const KUrl &url);
-    void validateByUpload(const KUrl &url, const QList<QPair<QByteArray, QByteArray> \
> &formData); +    void validateByUri(const QUrl &url);
+    void validateByUpload(const QUrl &url, const QList<QPair<QByteArray, QByteArray> \
> &formData);  bool doExternalValidationChecks();
     void addStatusBarIcon();
     void removeStatusBarIcon();
diff --git a/plugins/webarchiver/archivedialog.cpp \
b/plugins/webarchiver/archivedialog.cpp index 8aa936b57..e297251e0 100644
--- a/plugins/webarchiver/archivedialog.cpp
+++ b/plugins/webarchiver/archivedialog.cpp
@@ -32,7 +32,7 @@
 // * 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 KUrl::equals() and QUrl::fragment() to compare Urls
+// * 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.
 
@@ -75,7 +75,6 @@
 #include "webarchiverdebug.h"
 
 //KDELibs4Support
-#include <kurl.h>
 #include <kglobal.h>
 
 // Set to true if you have a patched http-io-slave that has
@@ -176,9 +175,9 @@ ArchiveDialog::ArchiveDialog(QWidget *parent, const QString \
&filename, KHTMLPart  }
     setMainWidget(m_widget);
 
-    KUrl srcURL = part->url();
+    QUrl srcURL = part->url();
     m_widget->urlLabel->setText(QStringLiteral("<a href=\"") + srcURL.url() + "\">" \
                +
-                                KStringHandler::csqueeze(srcURL.prettyUrl(), 80) + \
"</a>"); +                                \
                KStringHandler::csqueeze(srcURL.toDisplayString(), 80) + "</a>");
     m_widget->targetLabel->setText(QStringLiteral("<a href=\"") + filename + "\">" +
                                    KStringHandler::csqueeze(filename, 80) + "</a>");
 
@@ -215,7 +214,7 @@ void ArchiveDialog::archive()
 //         m_objects.reserve(m_url2tar.size() - m_cssURLs.size());
 
         FOR_ITER(UrlTarMap, m_url2tar, u2t_it) {
-            const KUrl &url = u2t_it.key();
+            const QUrl &url = u2t_it.key();
             DownloadInfo &info = u2t_it.value();
 
             assert(info.tarName.isNull());
@@ -258,7 +257,7 @@ void ArchiveDialog::downloadObjects()
     } else {
 
         m_dlurl2tar_it = (*m_objects_it);
-        const KUrl &url    = m_dlurl2tar_it.key();
+        const QUrl &url    = m_dlurl2tar_it.key();
         DownloadInfo &info = m_dlurl2tar_it.value();
         assert(m_dlurl2tar_it != m_url2tar.end());
 
@@ -273,7 +272,7 @@ void ArchiveDialog::slotObjectFinished(KJob *_job)
     KIO::StoredTransferJob *job = qobject_cast<KIO::StoredTransferJob *>(_job);
     Q_ASSERT(job == m_job);
     m_job = NULL;
-    const KUrl &url    = m_dlurl2tar_it.key();
+    const QUrl &url    = m_dlurl2tar_it.key();
     DownloadInfo &info = m_dlurl2tar_it.value();
 
     assert(info.tarName.isNull());
@@ -285,7 +284,7 @@ void ArchiveDialog::slotObjectFinished(KJob *_job)
         QByteArray data(job->data());
         const QString &tarName = info.tarName;
 
-//         qCDebug(WEBARCHIVERPLUGIN_LOG) << "downloaded " << url.prettyUrl() << \
"size=" << data.size() << "mimetype" << mimetype; +//         \
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) {
@@ -312,7 +311,7 @@ void ArchiveDialog::downloadStyleSheets()
     } else {
 
 //         QTimer::singleShot(3000, this, SLOT(slotDownloadStyleSheetsDelay()));
-        const KUrl &url = m_styleSheets_it.key();
+        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();
@@ -328,7 +327,7 @@ void ArchiveDialog::slotStyleSheetFinished(KJob *_job)
     KIO::StoredTransferJob *job = qobject_cast<KIO::StoredTransferJob *>(_job);
     Q_ASSERT(job == m_job);
     m_job = NULL;
-    const KUrl &url    = m_dlurl2tar_it.key();
+    const QUrl &url    = m_dlurl2tar_it.key();
     DownloadInfo &info = m_dlurl2tar_it.value();
 
     bool error = job->error();
@@ -370,11 +369,11 @@ void ArchiveDialog::slotStyleSheetFinished(KJob *_job)
     downloadStyleSheets();
 }
 
-KIO::Job *ArchiveDialog::startDownload(const KUrl &url, KHTMLPart *part)
+KIO::Job *ArchiveDialog::startDownload(const QUrl &url, KHTMLPart *part)
 {
     QTreeWidgetItem *twi = new QTreeWidgetItem;
     twi->setText(0, i18n("Downloading"));
-    twi->setText(1, url.prettyUrl());
+    twi->setText(1, url.toDisplayString());
     QTreeWidget *tw = m_widget->progressView;
     tw->insertTopLevelItem(0, twi);
 
@@ -458,7 +457,7 @@ struct GetName : public GetFromPart {
 struct GetURL : public GetFromPart {
     GetURL(const KHTMLPart *child) : GetFromPart(child) { }
 
-    operator KUrl()
+    operator QUrl()
     {
         return child->url();
     }
@@ -534,13 +533,13 @@ void ArchiveDialog::obtainURLs()
     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().prettyUrl(); +            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().prettyUrl(); +            qCDebug(WEBARCHIVERPLUGIN_LOG) << "   \
url='" << c2f_it.key() << "' -> '" << c2f_it.data().toDisplayString();  }
     }
 #endif
@@ -577,7 +576,7 @@ void ArchiveDialog::obtainStyleSheetURLsLower(DOM::CSSStyleSheet \
css, RecurseDat  // Remove that URL from the stylesheet
                 qCDebug(WEBARCHIVERPLUGIN_LOG) << "stylesheet: invalid @import \
url('" << cir.href() << "')";  
-                raw2full.insert(cir.href().string(), KUrl());
+                raw2full.insert(cir.href().string(), QUrl());
 
             } else {
 
@@ -586,7 +585,7 @@ void ArchiveDialog::obtainStyleSheetURLsLower(DOM::CSSStyleSheet \
css, RecurseDat  QString href = cir.href().string();
                 Q_ASSERT(!href.isNull());
 
-                KUrl fullURL  = importSheet.baseUrl();
+                QUrl fullURL  = importSheet.baseUrl();
                 bool inserted = insertHRefFromStyleSheet(href, raw2full, fullURL, \
data);  if (inserted) {
                     m_cssURLs.insert(fullURL, importSheet);
@@ -644,7 +643,7 @@ void ArchiveDialog::obtainURLsLower(KHTMLPart *part, int level)
             QString href = css.href().string();
             if (! href.isNull()) {
                 QString href  = css.href().string();
-                KUrl fullUrl  = css.baseUrl();
+                QUrl fullUrl  = css.baseUrl();
                 qCDebug(WEBARCHIVERPLUGIN_LOG) << "top-level stylesheet='" << href;
                 bool inserted = insertTranslateURL(fullUrl, data);
                 if (inserted) {
@@ -703,9 +702,9 @@ void ArchiveDialog::obtainPartURLsLower(const DOM::Node &pNode, \
int level, Recur  
             // URL has no 'name' attribute.  This frame cannot(?) change, so 'src' \
should  // identify it unambigously
-            KUrl _frameURL = absoluteURL((*eurls.frameURL).value, data);
+            QUrl _frameURL = absoluteURL((*eurls.frameURL).value, data);
             if (!urlCheckFailed(data.part, _frameURL)) {
-                data.partFrameData->framesWithURLOnly.insert(_frameURL.url(), 0);
+                data.partFrameData->framesWithURLOnly.insert(QUrl(_frameURL.url()), \
0);  }
 
         } else {
@@ -732,7 +731,7 @@ void ArchiveDialog::obtainPartURLsLower(const DOM::Node &pNode, \
int level, Recur  
 // Kill insecure/invalid links. Frames are treated separately.
 
-bool ArchiveDialog::insertTranslateURL(const KUrl &fullURL, RecurseData &data)
+bool ArchiveDialog::insertTranslateURL(const QUrl &fullURL, RecurseData &data)
 {
     if (!urlCheckFailed(data.part, fullURL)) {
 //         qCDebug(WEBARCHIVERPLUGIN_LOG) << "adding '" << fullURL << "' to \
to-be-downloaded URLs"; @@ -745,25 +744,25 @@ bool \
ArchiveDialog::insertTranslateURL(const KUrl &fullURL, RecurseData &data)  }
 
 bool ArchiveDialog::insertHRefFromStyleSheet(const QString &hrefRaw, RawHRef2FullURL \
                &raw2full,
-        const KUrl &fullURL, RecurseData &data)
+        const QUrl &fullURL, RecurseData &data)
 {
     bool inserted = insertTranslateURL(fullURL, data);
 
 #if 0
     if (inserted) {
         qCDebug(WEBARCHIVERPLUGIN_LOG) << "stylesheet: found url='"
-                      << fullURL.prettyUrl() << "' hrefRaw='" << hrefRaw;
+                      << fullURL.toDisplayString() << "' hrefRaw='" << hrefRaw;
     } else {
         qCDebug(WEBARCHIVERPLUGIN_LOG) << "stylesheet: killing insecure/invalid \
                url='"
-                      << fullURL.prettyUrl() << "' hrefRaw='" << hrefRaw;
+                      << fullURL.toDisplayString() << "' hrefRaw='" << hrefRaw;
     }
 #endif
 
-    raw2full.insert(hrefRaw, inserted ? fullURL : KUrl());
+    raw2full.insert(hrefRaw, inserted ? fullURL : QUrl());
     return inserted;
 }
 
-void ArchiveDialog::parseStyleDeclaration(const KUrl &baseURL, \
DOM::CSSStyleDeclaration decl, +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) {
@@ -782,7 +781,7 @@ void ArchiveDialog::parseStyleDeclaration(const KUrl &baseURL, \
DOM::CSSStyleDecl  QString parsedURL = parseURL(href);
 
 //             qCDebug(WEBARCHIVERPLUGIN_LOG) << "found URL='" << val << "' \
                extracted='" << parsedURL << "'";
-            insertHRefFromStyleSheet(href, raw2full, KUrl(baseURL, parsedURL), \
data); +            insertHRefFromStyleSheet(href, raw2full, \
QUrl(baseURL).resolved(QUrl(parsedURL)), data);  }
     }
 }
@@ -922,8 +921,8 @@ void ArchiveDialog::saveHTMLPartLower(const DOM::Node &pNode, int \
level, Recurse  
             // make URLs in hyperref links absolute
             if (eurls.absURL != invalid) {
-                KUrl baseurl = absoluteURL(QLatin1String(""), data);
-                KUrl newurl = KUrl(baseurl, parseURL((*eurls.absURL).value));
+                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 << "'"; @@ -933,8 +932,8 @@ void \
                ArchiveDialog::saveHTMLPartLower(const DOM::Node &pNode, int level, \
                Recurse
                     // 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.  //
-                    assert(! newurl.hasSubUrl());   // @see urlCheckFailed()
-                    if (newurl.hasFragment() && baseurl.equals(newurl, \
KUrl::CompareWithoutFragment)) { +                    assert(! hasSubUrl(newurl));   \
// @see urlCheckFailed() +                    if (newurl.hasFragment() && \
                baseurl.matches(newurl, QUrl::RemoveFragment)) {
                         (*eurls.absURL).value = QStringLiteral("#") + \
newurl.fragment();  } else {
                         (*eurls.absURL).value = newurl.url();
@@ -947,7 +946,7 @@ void ArchiveDialog::saveHTMLPartLower(const DOM::Node &pNode, int \
                level, Recurse
                 // 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
-                KUrl fullURL = absoluteURL(parseURL((*eurls.transURL).value), data);
+                QUrl fullURL = absoluteURL(parseURL((*eurls.transURL).value), data);
                 UrlTarMap::Iterator it = m_url2tar.find(fullURL);
                 if (it == m_url2tar.end()) {
 
@@ -963,7 +962,7 @@ void ArchiveDialog::saveHTMLPartLower(const DOM::Node &pNode, int \
level, Recurse  // Check stylesheet <link>s
             if (eurls.cssURL != invalid) {
 
-                KUrl fullURL = absoluteURL((*eurls.cssURL).value, data);
+                QUrl fullURL = absoluteURL((*eurls.cssURL).value, data);
                 UrlTarMap::Iterator it = m_url2tar.find(fullURL);
 
                 if (it == m_url2tar.end()) {
@@ -1010,7 +1009,7 @@ void ArchiveDialog::saveHTMLPartLower(const DOM::Node &pNode, \
int level, Recurse  } else if (eurls.frameURL != invalid) {
 
                 URL2Part &u2f = data.partFrameData->framesWithURLOnly;
-                KUrl fullURL = absoluteURL((*eurls.frameURL).value, data);
+                QUrl fullURL = absoluteURL((*eurls.frameURL).value, data);
                 URL2Part::Iterator u2f_part = u2f.find(fullURL);
 
                 if (u2f_part == u2f.end()) {
@@ -1149,7 +1148,7 @@ QString &ArchiveDialog::changeCSSURLs(QString &text, const \
RawHRef2FullURL &raw2  {
     FOR_CONST_ITER(RawHRef2FullURL, raw2full, r2f_it) {
         const QString &raw  = r2f_it.key();
-        const KUrl &fullURL = r2f_it.value();
+        const QUrl &fullURL = r2f_it.value();
         if (fullURL.isValid()) {
             UrlTarMap::Iterator utm_it = m_url2tar.find(fullURL);
             if (utm_it != m_url2tar.end()) {
@@ -1277,12 +1276,12 @@ ArchiveDialog::AttrList::Iterator \
ArchiveDialog::getAttribute(AttrList &attrList  return attrList.end();
 }
 
-KUrl ArchiveDialog::absoluteURL(const QString &partURL, RecurseData &data)
+QUrl ArchiveDialog::absoluteURL(const QString &partURL, RecurseData &data)
 {
     if (data.baseSeen) {
-        return KUrl(data.document.completeURL(partURL).string());
+        return QUrl(data.document.completeURL(partURL).string());
     } else {
-        return KUrl(data.part->url(), partURL);
+        return QUrl(data.part->url()).resolved(QUrl(partURL));
     }
 }
 
@@ -1307,17 +1306,13 @@ QString ArchiveDialog::uniqTarName(const QString &suggestion, \
KHTMLPart *part)  return result;
 }
 
-bool ArchiveDialog::urlCheckFailed(KHTMLPart *part, const KUrl &fullURL)
+bool ArchiveDialog::urlCheckFailed(KHTMLPart *part, const QUrl &fullURL)
 {
     if (!fullURL.isValid()) {
         return true;
     }
-//     kDebug() << fullURL.prettyUrl() << " hasSubURL()=" << fullURL.hasSubUrl();
-    if (fullURL.hasSubUrl()) {
-        return true;
-    }
 
-    QString prot = fullURL.protocol();
+    QString prot = fullURL.scheme();
     bool protFile = (prot == QLatin1String("file"));
     if (part->onlyLocalReferences() && !protFile) {
         return true;
@@ -1378,4 +1373,3 @@ QString ArchiveDialog::appendMimeTypeSuffix(QString filename, \
const QString &mim  }
     return filename;
 }
-
diff --git a/plugins/webarchiver/archivedialog.h \
b/plugins/webarchiver/archivedialog.h index ec11aeead..3bf214c87 100644
--- a/plugins/webarchiver/archivedialog.h
+++ b/plugins/webarchiver/archivedialog.h
@@ -34,7 +34,7 @@
 class QWidget;
 class KHTMLPart;
 class ArchiveViewBase;
-class KUrl;
+class QUrl;
 class KTar;
 class QTextStream;
 
@@ -68,7 +68,7 @@ protected:
 
     static NonCDataAttr non_cdata_attr;
 
-    KIO::Job *startDownload(const KUrl &url, KHTMLPart *part);
+    KIO::Job *startDownload(const QUrl &url, KHTMLPart *part);
 
 public:
 
@@ -76,7 +76,7 @@ public:
 
     typedef QHash<QString, KHTMLPart *> Name2Part;
 private:
-    typedef QHash<KUrl,    KHTMLPart *> URL2Part;
+    typedef QHash<QUrl,    KHTMLPart *> URL2Part;
 
     struct PartFrameData {
         Name2Part framesWithName;
@@ -89,8 +89,8 @@ private:
 
     // Stylesheets
 
-    typedef QHash< KUrl, DOM::CSSStyleSheet >            CSSURLSet;
-    typedef QHash< QString, KUrl >                       RawHRef2FullURL;
+    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;
@@ -116,7 +116,7 @@ private:
             : tarName(_tarName), part(_part) { }
     };
 
-    typedef QMap< KUrl, DownloadInfo >     UrlTarMap;
+    typedef QMap< QUrl, DownloadInfo >     UrlTarMap;
     typedef QList< UrlTarMap::Iterator > DownloadList;
 
     struct AttrElem {
@@ -155,10 +155,10 @@ private:
     void obtainPartURLsLower(const DOM::Node &pNode, int level, RecurseData &data);
     void obtainStyleSheetURLsLower(DOM::CSSStyleSheet styleSheet, RecurseData \
&data);  
-    bool insertTranslateURL(const KUrl &fullURL, RecurseData &data);
+    bool insertTranslateURL(const QUrl &fullURL, RecurseData &data);
     bool insertHRefFromStyleSheet(const QString &hrefRaw, RawHRef2FullURL &raw2full,
-                                  const KUrl &fullURL, RecurseData &data);
-    void parseStyleDeclaration(const KUrl &baseURL, DOM::CSSStyleDeclaration decl,
+                                  const QUrl &fullURL, RecurseData &data);
+    void parseStyleDeclaration(const QUrl &baseURL, DOM::CSSStyleDeclaration decl,
                                RawHRef2FullURL &urls, RecurseData &data /*, bool \
verbose = false*/);  
     bool saveTopFrame();
@@ -172,6 +172,8 @@ private:
     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 &lt;img \
href="...") @@ -196,7 +198,7 @@ private:
      *
      * @return fully qualified URL of @p partURL relative to the HTML document in @c \
                data.part
      */
-    static KUrl absoluteURL(const QString &partURL, RecurseData &data);
+    static QUrl absoluteURL(const QString &partURL, RecurseData &data);
 
     /**
      * TODO KDE4 is this in KHTML function available now?
@@ -219,7 +221,7 @@ private:
      *
      * Checks if an embedded link like &lt;img src=&quot;...&quot; should be loaded
      */
-    static bool urlCheckFailed(KHTMLPart *part, const KUrl &fullURL);
+    static bool urlCheckFailed(KHTMLPart *part, const QUrl &fullURL);
 
     /**
      * Escapes HTML characters. Does not forget " as @ref Qt::escape() does.
diff --git a/plugins/webarchiver/webarchivecreator.cpp \
b/plugins/webarchiver/webarchivecreator.cpp index c6ad59653..c37e023e7 100644
--- a/plugins/webarchiver/webarchivecreator.cpp
+++ b/plugins/webarchiver/webarchivecreator.cpp
@@ -31,9 +31,6 @@
 #include <QAbstractEventDispatcher>
 #include <khtml_part.h>
 
-// KDELibs4Support
-#include  <kurl.h>
-
 #include "webarchivecreator.moc"
 
 extern "C"
@@ -63,10 +60,9 @@ bool WebArchiveCreator::create(const QString &path, int width, int \
height, QImag  m_html->setJavaEnabled(false);
         m_html->setPluginsEnabled(false);
     }
-    KUrl url;
-    url.setProtocol(QStringLiteral("tar"));
-    url.setPath(path);
-    url.addPath(QStringLiteral("index.html"));
+    QUrl url;
+    url.setScheme(QStringLiteral("tar"));
+    url.setPath(path + '/' + QStringLiteral("index.html"));
     m_html->openUrl(url);
     m_completed = false;
     int timerId = startTimer(5000);


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

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