]> cloud.milkyroute.net Git - dolphin.git/commitdiff
port Dolphin from KUrl to QUrl
authorLukáš Tinkl <lukas@kde.org>
Tue, 21 Oct 2014 19:18:43 +0000 (21:18 +0200)
committerLukáš Tinkl <lukas@kde.org>
Tue, 21 Oct 2014 19:19:14 +0000 (21:19 +0200)
REVIEW: 120688

85 files changed:
src/dolphinapplication.cpp
src/dolphincontextmenu.cpp
src/dolphincontextmenu.h
src/dolphinmainwindow.cpp
src/dolphinmainwindow.h
src/dolphinpart.cpp
src/dolphinpart.h
src/dolphinpart_ext.cpp
src/dolphinpart_ext.h
src/dolphinrecenttabsmenu.cpp
src/dolphinrecenttabsmenu.h
src/dolphintabbar.cpp
src/dolphintabpage.cpp
src/dolphintabpage.h
src/dolphintabwidget.cpp
src/dolphintabwidget.h
src/dolphinviewcontainer.cpp
src/dolphinviewcontainer.h
src/kitemviews/kfileitemmodel.cpp
src/kitemviews/kfileitemmodel.h
src/kitemviews/kfileitemmodelrolesupdater.cpp
src/kitemviews/kstandarditemlistwidget.cpp
src/kitemviews/private/kdirectorycontentscounter.cpp
src/kitemviews/private/kfileitemclipboard.cpp
src/kitemviews/private/kfileitemclipboard.h
src/kitemviews/private/kfileitemmodeldirlister.h
src/panels/folders/folderspanel.cpp
src/panels/folders/folderspanel.h
src/panels/folders/treeviewcontextmenu.cpp
src/panels/information/informationpanel.cpp
src/panels/information/informationpanel.h
src/panels/information/informationpanelcontent.cpp
src/panels/information/informationpanelcontent.h
src/panels/information/phononwidget.cpp
src/panels/information/phononwidget.h
src/panels/panel.cpp
src/panels/panel.h
src/panels/places/placesitem.cpp
src/panels/places/placesitem.h
src/panels/places/placesitemeditdialog.cpp
src/panels/places/placesitemeditdialog.h
src/panels/places/placesitemmodel.cpp
src/panels/places/placesitemmodel.h
src/panels/places/placespanel.cpp
src/panels/places/placespanel.h
src/panels/terminal/terminalpanel.cpp
src/panels/terminal/terminalpanel.h
src/search/dolphinsearchbox.cpp
src/search/dolphinsearchbox.h
src/settings/applyviewpropsjob.cpp
src/settings/applyviewpropsjob.h
src/settings/dolphin_generalsettings.kcfg
src/settings/dolphinsettingsdialog.cpp
src/settings/dolphinsettingsdialog.h
src/settings/general/behaviorsettingspage.cpp
src/settings/general/behaviorsettingspage.h
src/settings/general/generalsettingspage.cpp
src/settings/general/generalsettingspage.h
src/settings/startup/startupsettingspage.cpp
src/settings/startup/startupsettingspage.h
src/settings/viewpropertiesdialog.cpp
src/settings/viewpropsprogressinfo.cpp
src/settings/viewpropsprogressinfo.h
src/statusbar/dolphinstatusbar.cpp
src/statusbar/dolphinstatusbar.h
src/statusbar/spaceinfoobserver.cpp
src/statusbar/spaceinfoobserver.h
src/statusbar/statusbarspaceinfo.cpp
src/statusbar/statusbarspaceinfo.h
src/tests/kfileitemmodelbenchmark.cpp
src/tests/testdir.cpp
src/tests/testdir.h
src/views/dolphinremoteencoding.cpp
src/views/dolphinremoteencoding.h
src/views/dolphinview.cpp
src/views/dolphinview.h
src/views/dolphinviewactionhandler.cpp
src/views/draganddrophelper.cpp
src/views/draganddrophelper.h
src/views/versioncontrol/versioncontrolobserver.cpp
src/views/versioncontrol/versioncontrolobserver.h
src/views/viewmodecontroller.cpp
src/views/viewmodecontroller.h
src/views/viewproperties.cpp
src/views/viewproperties.h

index 8d4af66df5ca50bdfd45e60dada370c71f8a2b97..acd938317445f38cdc710561286c0fc01d490c46 100644 (file)
@@ -24,7 +24,7 @@
 
 #include <KCmdLineArgs>
 #include <KDebug>
-#include <KUrl>
+#include <QUrl>
 
 DolphinApplication::DolphinApplication() :
     m_mainWindow(0)
@@ -41,7 +41,7 @@ DolphinApplication::DolphinApplication() :
 
     QList<QUrl> urls;
     for (int i = 0; i < argsCount; ++i) {
-        const KUrl url = args->url(i);
+        const QUrl url = args->url(i);
         if (url.isValid()) {
             urls.append(url);
         }
@@ -71,7 +71,7 @@ DolphinApplication::DolphinApplication() :
             m_mainWindow->openDirectories(urls);
         }
     } else {
-        const KUrl homeUrl(GeneralSettings::homeUrl());
+        const QUrl homeUrl(QUrl::fromLocalFile(GeneralSettings::homeUrl()));
         m_mainWindow->openNewActivatedTab(homeUrl);
     }
 
index f597d52e320af42aae784c190eb61bbee2e600f2..9a47faef72798923999a23697db8beba645b7e89 100644 (file)
@@ -56,7 +56,7 @@
 DolphinContextMenu::DolphinContextMenu(DolphinMainWindow* parent,
                                        const QPoint& pos,
                                        const KFileItem& fileInfo,
-                                       const KUrl& baseUrl) :
+                                       const QUrl& baseUrl) :
     QMenu(parent),
     m_pos(pos),
     m_mainWindow(parent),
@@ -91,7 +91,7 @@ void DolphinContextMenu::setCustomActions(const QList<QAction*>& actions)
 DolphinContextMenu::Command DolphinContextMenu::open()
 {
     // get the context information
-    if (m_baseUrl.protocol() == QLatin1String("trash")) {
+    if (m_baseUrl.scheme() == QLatin1String("trash")) {
         m_context |= TrashContext;
     }
 
@@ -175,7 +175,7 @@ void DolphinContextMenu::openTrashItemContextMenu()
     addAction(propertiesAction);
 
     if (exec(m_pos) == restoreAction) {
-        KUrl::List selectedUrls;
+        QList<QUrl> selectedUrls;
         foreach (const KFileItem &item, m_selectedItems) {
             selectedUrls.append(item.url());
         }
@@ -226,7 +226,7 @@ void DolphinContextMenu::openItemContextMenu()
             }
 
             addSeparator();
-        } else if (m_baseUrl.protocol().contains("search") || m_baseUrl.protocol().contains("timeline")) {
+        } else if (m_baseUrl.scheme().contains("search") || m_baseUrl.scheme().contains("timeline")) {
             openParentAction = new QAction(QIcon::fromTheme("document-open-folder"),
                                            i18nc("@action:inmenu",
                                                  "Open Path"),
@@ -256,7 +256,7 @@ void DolphinContextMenu::openItemContextMenu()
     } else {
         bool selectionHasOnlyDirs = true;
         foreach (const KFileItem& item, m_selectedItems) {
-            const KUrl& url = DolphinView::openItemAsFolderUrl(item);
+            const QUrl& url = DolphinView::openItemAsFolderUrl(item);
             if (url.isEmpty()) {
                 selectionHasOnlyDirs = false;
                 break;
@@ -296,7 +296,7 @@ void DolphinContextMenu::openItemContextMenu()
     QAction* activatedAction = exec(m_pos);
     if (activatedAction) {
         if (activatedAction == addToPlacesAction) {
-            const KUrl selectedUrl(m_fileInfo.url());
+            const QUrl selectedUrl(m_fileInfo.url());
             if (selectedUrl.isValid()) {
                 PlacesItemModel model;
                 const QString text = selectedUrl.fileName();
@@ -420,14 +420,14 @@ void DolphinContextMenu::addShowMenuBarAction()
     }
 }
 
-bool DolphinContextMenu::placeExists(const KUrl& url) const
+bool DolphinContextMenu::placeExists(const QUrl& url) const
 {
     PlacesItemModel model;
 
     const int count = model.count();
     for (int i = 0; i < count; ++i) {
-        const KUrl placeUrl = model.placesItem(i)->url();
-        if (placeUrl.equals(url, KUrl::CompareWithoutTrailingSlash)) {
+        const QUrl placeUrl = model.placesItem(i)->url();
+        if (placeUrl.matches(url, QUrl::StripTrailingSlash)) {
             return true;
         }
     }
index f082e1c6caaee83b5658ac19a044d3caeffe3783..8ed22dda5c1ae1834365fb7d11b090122d65e707 100644 (file)
@@ -21,7 +21,7 @@
 #define DOLPHINCONTEXTMENU_H
 
 #include <KFileItem>
-#include <KUrl>
+#include <QUrl>
 #include <konq_copytomenu.h>
 #include <QMenu>
 
@@ -72,7 +72,7 @@ public:
     DolphinContextMenu(DolphinMainWindow* parent,
                        const QPoint& pos,
                        const KFileItem& fileInfo,
-                       const KUrl& baseUrl);
+                       const QUrl& baseUrl);
 
     virtual ~DolphinContextMenu();
 
@@ -106,7 +106,7 @@ private:
      */
     void addShowMenuBarAction();
 
-    bool placeExists(const KUrl& url) const;
+    bool placeExists(const QUrl& url) const;
 
     QAction* createPasteAction();
 
@@ -162,7 +162,7 @@ private:
 
     KFileItem m_fileInfo;
 
-    KUrl m_baseUrl;
+    QUrl m_baseUrl;
     KFileItem* m_baseFileItem;  /// File item for m_baseUrl
 
     KFileItemList m_selectedItems;
index 1053f15b62e0fb743035d5674265576ace27eee6..f44d3236fc7fccc0b577090b6f42ce04e951ea22 100644 (file)
@@ -128,8 +128,8 @@ DolphinMainWindow::DolphinMainWindow() :
             this, SLOT(activeViewChanged(DolphinViewContainer*)));
     connect(m_tabWidget, SIGNAL(tabCountChanged(int)),
             this, SLOT(tabCountChanged(int)));
-    connect(m_tabWidget, SIGNAL(currentUrlChanged(KUrl)),
-            this, SLOT(setUrlAsCaption(KUrl)));
+    connect(m_tabWidget, SIGNAL(currentUrlChanged(QUrl)),
+            this, SLOT(setUrlAsCaption(QUrl)));
     setCentralWidget(m_tabWidget);
 
     setupActions();
@@ -216,7 +216,7 @@ void DolphinMainWindow::pasteIntoFolder()
     m_activeViewContainer->view()->pasteIntoFolder();
 }
 
-void DolphinMainWindow::changeUrl(const KUrl& url)
+void DolphinMainWindow::changeUrl(const QUrl &url)
 {
     if (!KProtocolManager::supportsListing(url)) {
         // The URL navigator only checks for validity, not
@@ -234,7 +234,7 @@ void DolphinMainWindow::changeUrl(const KUrl& url)
     emit urlChanged(url);
 }
 
-void DolphinMainWindow::slotTerminalDirectoryChanged(const KUrl& url)
+void DolphinMainWindow::slotTerminalDirectoryChanged(const QUrl& url)
 {
     m_activeViewContainer->setAutoGrabFocus(false);
     changeUrl(url);
@@ -295,7 +295,7 @@ void DolphinMainWindow::updateFilterBarAction(bool show)
 
 void DolphinMainWindow::openNewMainWindow()
 {
-    KRun::run("dolphin %u", KUrl::List(), this);
+    KRun::run("dolphin %u", QList<QUrl>(), this);
 }
 
 void DolphinMainWindow::openNewActivatedTab()
@@ -303,12 +303,12 @@ void DolphinMainWindow::openNewActivatedTab()
     m_tabWidget->openNewActivatedTab();
 }
 
-void DolphinMainWindow::openNewTab(const KUrl& url)
+void DolphinMainWindow::openNewTab(const QUrl& url)
 {
     m_tabWidget->openNewTab(url);
 }
 
-void DolphinMainWindow::openNewActivatedTab(const KUrl& url)
+void DolphinMainWindow::openNewActivatedTab(const QUrl& url)
 {
     m_tabWidget->openNewActivatedTab(url);
 }
@@ -320,7 +320,7 @@ void DolphinMainWindow::openInNewTab()
         openNewTab(m_activeViewContainer->url());
     } else {
         foreach (const KFileItem& item, list) {
-            const KUrl& url = DolphinView::openItemAsFolderUrl(item);
+            const QUrl& url = DolphinView::openItemAsFolderUrl(item);
             if (!url.isEmpty()) {
                 openNewTab(url);
             }
@@ -330,7 +330,7 @@ void DolphinMainWindow::openInNewTab()
 
 void DolphinMainWindow::openInNewWindow()
 {
-    KUrl newWindowUrl;
+    QUrl newWindowUrl;
 
     const KFileItemList list = m_activeViewContainer->view()->selectedItems();
     if (list.isEmpty()) {
@@ -640,7 +640,7 @@ void DolphinMainWindow::goUp(Qt::MouseButtons buttons)
 {
     // The default case (left button pressed) is handled in goUp().
     if (buttons == Qt::MidButton) {
-        openNewTab(activeViewContainer()->url().upUrl());
+        openNewTab(KIO::upUrl(activeViewContainer()->url()));
     }
 }
 
@@ -661,13 +661,13 @@ void DolphinMainWindow::compareFiles()
         return;
     }
 
-    KUrl urlA = items.at(0).url();
-    KUrl urlB = items.at(1).url();
+    QUrl urlA = items.at(0).url();
+    QUrl urlB = items.at(1).url();
 
     QString command("kompare -c \"");
-    command.append(urlA.pathOrUrl());
+    command.append(urlA.toDisplayString(QUrl::PreferLocalFile));
     command.append("\" \"");
-    command.append(urlB.pathOrUrl());
+    command.append(urlB.toDisplayString(QUrl::PreferLocalFile));
     command.append('\"');
     KRun::runCommand(command, "Kompare", "kompare", this);
 }
@@ -689,7 +689,7 @@ void DolphinMainWindow::openTerminal()
 
     // If the given directory is not local, it can still be the URL of an
     // ioslave using UDS_LOCAL_PATH which to be converted first.
-    KUrl url = KIO::NetAccess::mostLocalUrl(m_activeViewContainer->url(), this);
+    QUrl url = KIO::NetAccess::mostLocalUrl(m_activeViewContainer->url(), this);
 
     //If the URL is local after the above conversion, set the directory.
     if (url.isLocalFile()) {
@@ -705,7 +705,7 @@ void DolphinMainWindow::editSettings()
         DolphinViewContainer* container = activeViewContainer();
         container->view()->writeSettings();
 
-        const KUrl url = container->url();
+        const QUrl url = container->url();
         DolphinSettingsDialog* settingsDialog = new DolphinSettingsDialog(url, this);
         connect(settingsDialog, &DolphinSettingsDialog::settingsChanged, this, &DolphinMainWindow::refreshViews);
         settingsDialog->setAttribute(Qt::WA_DeleteOnClose);
@@ -716,7 +716,7 @@ void DolphinMainWindow::editSettings()
     }
 }
 
-void DolphinMainWindow::handleUrl(const KUrl& url)
+void DolphinMainWindow::handleUrl(const QUrl& url)
 {
     delete m_lastHandleUrlStatJob;
     m_lastHandleUrlStatJob = 0;
@@ -741,7 +741,7 @@ void DolphinMainWindow::slotHandleUrlStatFinished(KJob* job)
 {
     m_lastHandleUrlStatJob = 0;
     const KIO::UDSEntry entry = static_cast<KIO::StatJob*>(job)->statResult();
-    const KUrl url = static_cast<KIO::StatJob*>(job)->url();
+    const QUrl url = static_cast<KIO::StatJob*>(job)->url();
     if (entry.isDir()) {
         activeViewContainer()->setUrl(url);
     } else {
@@ -756,7 +756,7 @@ void DolphinMainWindow::slotWriteStateChanged(bool isFolderWritable)
 
 void DolphinMainWindow::openContextMenu(const QPoint& pos,
                                         const KFileItem& item,
-                                        const KUrl& url,
+                                        const QUrl& url,
                                         const QList<QAction*>& customActions)
 {
     QWeakPointer<DolphinContextMenu> contextMenu = new DolphinContextMenu(this, pos, item, url);
@@ -900,7 +900,7 @@ void DolphinMainWindow::slotPanelErrorMessage(const QString& error)
     activeViewContainer()->showMessage(error, DolphinViewContainer::Error);
 }
 
-void DolphinMainWindow::slotPlaceActivated(const KUrl& url)
+void DolphinMainWindow::slotPlaceActivated(const QUrl& url)
 {
     DolphinViewContainer* view = activeViewContainer();
 
@@ -943,7 +943,7 @@ void DolphinMainWindow::activeViewChanged(DolphinViewContainer* viewContainer)
     updateViewActions();
     updateGoActions();
 
-    const KUrl url = viewContainer->url();
+    const QUrl url = viewContainer->url();
     emit urlChanged(url);
 }
 
@@ -955,12 +955,12 @@ void DolphinMainWindow::tabCountChanged(int count)
     actionCollection()->action("activate_prev_tab")->setEnabled(enableTabActions);
 }
 
-void DolphinMainWindow::setUrlAsCaption(const KUrl& url)
+void DolphinMainWindow::setUrlAsCaption(const QUrl& url)
 {
     QString caption;
     if (!url.isLocalFile()) {
-        caption.append(url.protocol() + " - ");
-        if (url.hasHost()) {
+        caption.append(url.scheme() + " - ");
+        if (!url.host().isEmpty()) {
             caption.append(url.host() + " - ");
         }
     }
@@ -1070,8 +1070,8 @@ void DolphinMainWindow::setupActions()
 
     DolphinRecentTabsMenu* recentTabsMenu = new DolphinRecentTabsMenu(this);
     actionCollection()->addAction("closed_tabs", recentTabsMenu);
-    connect(m_tabWidget, SIGNAL(rememberClosedTab(KUrl,QByteArray)),
-            recentTabsMenu, SLOT(rememberClosedTab(KUrl,QByteArray)));
+    connect(m_tabWidget, SIGNAL(rememberClosedTab(QUrl,QByteArray)),
+            recentTabsMenu, SLOT(rememberClosedTab(QUrl,QByteArray)));
     connect(recentTabsMenu, SIGNAL(restoreClosedTab(QByteArray)),
             m_tabWidget, SLOT(restoreClosedTab(QByteArray)));
     connect(recentTabsMenu, SIGNAL(closedTabsCountChanged(uint)),
@@ -1255,8 +1255,8 @@ void DolphinMainWindow::setupDockWidgets()
     addDockWidget(Qt::LeftDockWidgetArea, placesDock);
     connect(placesPanel, &PlacesPanel::placeActivated,
             this, &DolphinMainWindow::slotPlaceActivated);
-    connect(placesPanel, SIGNAL(placeMiddleClicked(KUrl)),
-            this, SLOT(openNewTab(KUrl)));
+    connect(placesPanel, SIGNAL(placeMiddleClicked(QUrl)),
+            this, SLOT(openNewTab(QUrl)));
     connect(placesPanel, &PlacesPanel::errorMessage,
             this, &DolphinMainWindow::slotPanelErrorMessage);
     connect(this, &DolphinMainWindow::urlChanged,
@@ -1326,8 +1326,8 @@ void DolphinMainWindow::updateViewActions()
 void DolphinMainWindow::updateGoActions()
 {
     QAction* goUpAction = actionCollection()->action(KStandardAction::name(KStandardAction::Up));
-    const KUrl currentUrl = m_activeViewContainer->url();
-    goUpAction->setEnabled(currentUrl.upUrl() != currentUrl);
+    const QUrl currentUrl = m_activeViewContainer->url();
+    goUpAction->setEnabled(KIO::upUrl(currentUrl) != currentUrl);
 }
 
 void DolphinMainWindow::createControlButton()
index 893394abcad373dd307d88416f1203ff7fe34fed..36a16e518d511caf5ac55f286a77ce5a82a44fe1 100644 (file)
@@ -28,7 +28,7 @@
 #include <ksortablelist.h>
 #include <kxmlguiwindow.h>
 #include <QIcon>
-#include <KUrl>
+#include <QUrl>
 
 #include <QList>
 #include <QWeakPointer>
@@ -109,14 +109,14 @@ public slots:
      * Inform all affected dolphin components (panels, views) of an URL
      * change.
      */
-    void changeUrl(const KUrl& url);
+    void changeUrl(const QUrl& url);
 
     /**
      * The current directory of the Terminal Panel has changed, probably because
      * the user entered a 'cd' command. This slot calls changeUrl(url) and makes
      * sure that the panel keeps the keyboard focus.
      */
-    void slotTerminalDirectoryChanged(const KUrl& url);
+    void slotTerminalDirectoryChanged(const QUrl& url);
 
     /** Stores all settings and quits Dolphin. */
     void quit();
@@ -132,7 +132,7 @@ signals:
      * Is sent if the url of the currently active view has
      * been changed.
      */
-    void urlChanged(const KUrl& url);
+    void urlChanged(const QUrl& url);
 
     /**
      * Is emitted if information of an item is requested to be shown e. g. in the panel.
@@ -336,12 +336,12 @@ private slots:
     /**
      * Opens a new tab in the background showing the URL \a url.
      */
-    void openNewTab(const KUrl& url);
+    void openNewTab(const QUrl& url);
 
     /**
      * Opens a new tab showing the URL \a url and activates the tab.
      */
-    void openNewActivatedTab(const KUrl& url);
+    void openNewActivatedTab(const QUrl& url);
 
     /**
      * Opens the selected folder in a new tab.
@@ -363,7 +363,7 @@ private slots:
      * If the URL can be listed, open it in the current view, otherwise
      * run it through KRun.
      */
-    void handleUrl(const KUrl& url);
+    void handleUrl(const QUrl& url);
 
     /**
      * handleUrl() can trigger a stat job to see if the url can actually
@@ -388,7 +388,7 @@ private slots:
      */
     void openContextMenu(const QPoint& pos,
                          const KFileItem& item,
-                         const KUrl& url,
+                         const QUrl& url,
                          const QList<QAction*>& customActions);
 
     void updateControlMenu();
@@ -406,7 +406,7 @@ private slots:
      * Reloads the view if \a url is the current URL already, and changes the
      * current URL otherwise.
      */
-    void slotPlaceActivated(const KUrl& url);
+    void slotPlaceActivated(const QUrl& url);
 
     /**
      * Is called if the another view has been activated by changing the current
@@ -430,7 +430,7 @@ private slots:
      * Sets the window caption to url.fileName() if this is non-empty,
      * "/" if the URL is "file:///", and url.protocol() otherwise.
      */
-    void setUrlAsCaption(const KUrl& url);
+    void setUrlAsCaption(const QUrl& url);
 
 private:
     void setupActions();
index 43eae8a670d0327fc5bca1d4ae95b51edc00bf46..6d1c79b2ef5601c0fb78155e5e807fb1ec965d63 100644 (file)
@@ -73,7 +73,7 @@ DolphinPart::DolphinPart(QWidget* parentWidget, QObject* parent, const QVariantL
     // make sure that other apps using this part find Dolphin's view-file-columns icons
     KIconLoader::global()->addAppDir("dolphin");
 
-    m_view = new DolphinView(KUrl(), parentWidget);
+    m_view = new DolphinView(QUrl(), parentWidget);
     m_view->setTabsForFilesEnabled(true);
     setWidget(m_view);
 
@@ -248,7 +248,7 @@ void DolphinPart::createGoAction(const char* name, const char* iconName,
 void DolphinPart::slotGoTriggered(QAction* action)
 {
     const QString url = action->data().toString();
-    emit m_extension->openUrlRequest(KUrl(url));
+    emit m_extension->openUrlRequest(QUrl(url));
 }
 
 void DolphinPart::slotSelectionChanged(const KFileItemList& selection)
@@ -311,11 +311,11 @@ bool DolphinPart::openUrl(const QUrl &url)
         return true;
     }
     setUrl(url); // remember it at the KParts level
-    KUrl visibleUrl(url);
+    QUrl visibleUrl(url);
     if (!m_nameFilter.isEmpty()) {
-        visibleUrl.addPath(m_nameFilter);
+        visibleUrl.setPath(visibleUrl.path() + '/' + m_nameFilter);
     }
-    QString prettyUrl = visibleUrl.pathOrUrl();
+    QString prettyUrl = visibleUrl.toDisplayString(QUrl::PreferLocalFile);
     emit setWindowCaption(prettyUrl);
     emit m_extension->setLocationBarUrl(prettyUrl);
     emit started(0); // get the wheel to spin
@@ -539,7 +539,7 @@ void DolphinPart::slotOpenTerminal()
 {
     QString dir(QDir::homePath());
 
-    KUrl u(url());
+    QUrl u(url());
 
     // If the given directory is not local, it can still be the URL of an
     // ioslave using UDS_LOCAL_PATH which to be converted first.
index 56e049b22c8eb342b14e057957503b0997109b14..9439a17bc5d0c83afa820ad25639a8945e3a9a98 100644 (file)
@@ -21,7 +21,7 @@
 #define DOLPHINPART_H
 
 #include <KParts/ReadOnlyPart>
-#include <KUrl>
+#include <QUrl>
 
 
 class DolphinNewFileMenu;
index 8e298587800335ad9735e171a44542676bc9141c..d275e8627510f8d5f212e7d25ecea46fc1eae862 100644 (file)
@@ -61,7 +61,7 @@ void DolphinPartBrowserExtension::paste()
     m_part->view()->paste();
 }
 
-void DolphinPartBrowserExtension::pasteTo(const KUrl&)
+void DolphinPartBrowserExtension::pasteTo(const QUrl&)
 {
     m_part->view()->pasteIntoFolder();
 }
index 5272df69d2e11a717bb3d2c749ad3250e95f08b0..bebde3adabc66a650674b2bfbb7e33230ce1539c 100644 (file)
@@ -23,7 +23,7 @@
 #include <kparts/browserextension.h>
 #include <kparts/fileinfoextension.h>
 #include <kparts/listingextension.h>
-#include <KUrl>
+#include <QUrl>
 
 class DolphinPart;
 
@@ -39,7 +39,7 @@ public Q_SLOTS:
     void cut();
     void copy();
     void paste();
-    void pasteTo(const KUrl&);
+    void pasteTo(const QUrl &);
     void reparseConfiguration();
 
 private:
index bce3996f645f821bd473d0ad87d2ca7bc03a7b3a..1087a38e45bf7eba1d23434303fa764c3fbe7f47 100644 (file)
@@ -40,7 +40,7 @@ DolphinRecentTabsMenu::DolphinRecentTabsMenu(QObject* parent) :
             this, SLOT(handleAction(QAction*)));
 }
 
-void DolphinRecentTabsMenu::rememberClosedTab(const KUrl& url, const QByteArray& state)
+void DolphinRecentTabsMenu::rememberClosedTab(const QUrl& url, const QByteArray& state)
 {
     QAction* action = new QAction(menu());
     action->setText(url.path());
index dce032128b04910957990949f7848216f88adb48..fe92a516d1c7b41fdd067ebba47b6e3fe02ef000 100644 (file)
@@ -21,7 +21,7 @@
 #define DOLPHIN_RECENT_TABS_MENU_H
 
 #include <KActionMenu>
-#include <KUrl>
+#include <QUrl>
 
 class QAction;
 
@@ -33,7 +33,7 @@ public:
     explicit DolphinRecentTabsMenu(QObject* parent);
 
 public slots:
-    void rememberClosedTab(const KUrl& url, const QByteArray& state);
+    void rememberClosedTab(const QUrl& url, const QByteArray& state);
     void undoCloseTab();
 
 signals:
@@ -47,4 +47,4 @@ private:
     QAction* m_clearListAction;
 };
 
-#endif
\ No newline at end of file
+#endif
index 8e5fb2dced07cab141ccbc42ec3a5986c18882ff..dbd324db56c29fa21a760dfc0e42434a3ff281d0 100644 (file)
@@ -24,7 +24,8 @@
 #include <KLocalizedString>
 #include <QMenu>
 #include <QIcon>
-#include <KUrl>
+#include <QUrl>
+#include <QMimeData>
 
 DolphinTabBar::DolphinTabBar(QWidget* parent) :
     QTabBar(parent),
@@ -47,7 +48,7 @@ void DolphinTabBar::dragEnterEvent(QDragEnterEvent* event)
     const QMimeData* mimeData = event->mimeData();
     const int index = tabAt(event->pos());
 
-    if (KUrl::List::canDecode(mimeData)) {
+    if (mimeData->hasUrls()) {
         event->acceptProposedAction();
         updateAutoActivationTimer(index);
     }
@@ -67,7 +68,7 @@ void DolphinTabBar::dragMoveEvent(QDragMoveEvent* event)
     const QMimeData* mimeData = event->mimeData();
     const int index = tabAt(event->pos());
 
-    if (KUrl::List::canDecode(mimeData)) {
+    if (mimeData->hasUrls()) {
         updateAutoActivationTimer(index);
     }
 
@@ -82,7 +83,7 @@ void DolphinTabBar::dropEvent(QDropEvent* event)
     const QMimeData* mimeData = event->mimeData();
     const int index = tabAt(event->pos());
 
-    if (index >= 0 && KUrl::List::canDecode(mimeData)) {
+    if (index >= 0 && mimeData->hasUrls()) {
         emit tabDropEvent(index, event);
     }
 
index 2d02ff04924928f2e63adf02171d668b853bc5a9..6d55ebeb2a6ed997dbeb5fcf8e470fe6343751a7 100644 (file)
@@ -40,10 +40,10 @@ DolphinTabPage::DolphinTabPage(const QUrl &primaryUrl, const QUrl &secondaryUrl,
 
     // Create a new primary view
     m_primaryViewContainer = createViewContainer(primaryUrl);
-    connect(m_primaryViewContainer->view(), SIGNAL(urlChanged(KUrl)),
-            this, SIGNAL(activeViewUrlChanged(KUrl)));
-    connect(m_primaryViewContainer->view(), SIGNAL(redirection(KUrl,KUrl)),
-            this, SLOT(slotViewUrlRedirection(KUrl,KUrl)));
+    connect(m_primaryViewContainer->view(), SIGNAL(urlChanged(QUrl)),
+            this, SIGNAL(activeViewUrlChanged(QUrl)));
+    connect(m_primaryViewContainer->view(), SIGNAL(redirection(QUrl,QUrl)),
+            this, SLOT(slotViewUrlRedirection(QUrl,QUrl)));
 
     m_splitter->addWidget(m_primaryViewContainer);
     m_primaryViewContainer->show();
@@ -52,7 +52,7 @@ DolphinTabPage::DolphinTabPage(const QUrl &primaryUrl, const QUrl &secondaryUrl,
         // Provide a secondary view, if the given secondary url is valid or if the
         // startup settings are set this way (use the url of the primary view).
         m_splitViewEnabled = true;
-        const KUrl& url = secondaryUrl.isValid() ? secondaryUrl : primaryUrl;
+        const QUrl& url = secondaryUrl.isValid() ? secondaryUrl : primaryUrl;
         m_secondaryViewContainer = createViewContainer(url);
         m_splitter->addWidget(m_secondaryViewContainer);
         m_secondaryViewContainer->show();
@@ -77,7 +77,7 @@ void DolphinTabPage::setSplitViewEnabled(bool enabled)
         m_splitViewEnabled = enabled;
 
         if (enabled) {
-            const KUrl& url = m_primaryViewContainer->url();
+            const QUrl& url = m_primaryViewContainer->url();
             m_secondaryViewContainer = createViewContainer(url);
 
             const bool placesSelectorVisible = m_primaryViewContainer->urlNavigator()->isPlacesSelectorVisible();
@@ -213,7 +213,7 @@ void DolphinTabPage::restoreState(const QByteArray& state)
     stream >> isSplitViewEnabled;
     setSplitViewEnabled(isSplitViewEnabled);
 
-    KUrl primaryUrl;
+    QUrl primaryUrl;
     stream >> primaryUrl;
     m_primaryViewContainer->setUrl(primaryUrl);
     bool primaryUrlEditable;
@@ -222,7 +222,7 @@ void DolphinTabPage::restoreState(const QByteArray& state)
     m_primaryViewContainer->view()->restoreState(stream);
 
     if (isSplitViewEnabled) {
-        KUrl secondaryUrl;
+        QUrl secondaryUrl;
         stream >> secondaryUrl;
         m_secondaryViewContainer->setUrl(secondaryUrl);
         bool secondaryUrlEditable;
@@ -257,7 +257,7 @@ void DolphinTabPage::restoreStateV1(const QByteArray& state)
     stream >> isSplitViewEnabled;
     setSplitViewEnabled(isSplitViewEnabled);
 
-    KUrl primaryUrl;
+    QUrl primaryUrl;
     stream >> primaryUrl;
     m_primaryViewContainer->setUrl(primaryUrl);
     bool primaryUrlEditable;
@@ -265,7 +265,7 @@ void DolphinTabPage::restoreStateV1(const QByteArray& state)
     m_primaryViewContainer->urlNavigator()->setUrlEditable(primaryUrlEditable);
 
     if (isSplitViewEnabled) {
-        KUrl secondaryUrl;
+        QUrl secondaryUrl;
         stream >> secondaryUrl;
         m_secondaryViewContainer->setUrl(secondaryUrl);
         bool secondaryUrlEditable;
@@ -302,28 +302,28 @@ void DolphinTabPage::slotViewActivated()
     const DolphinView* newActiveView = activeViewContainer()->view();
 
     if (newActiveView != oldActiveView) {
-        disconnect(oldActiveView, SIGNAL(urlChanged(KUrl)),
-                   this, SIGNAL(activeViewUrlChanged(KUrl)));
-        disconnect(oldActiveView, SIGNAL(redirection(KUrl,KUrl)),
-                   this, SLOT(slotViewUrlRedirection(KUrl,KUrl)));
-        connect(newActiveView, SIGNAL(urlChanged(KUrl)),
-                this, SIGNAL(activeViewUrlChanged(KUrl)));
-        connect(newActiveView, SIGNAL(redirection(KUrl,KUrl)),
-                this, SLOT(slotViewUrlRedirection(KUrl,KUrl)));
+        disconnect(oldActiveView, SIGNAL(urlChanged(QUrl)),
+                   this, SIGNAL(activeViewUrlChanged(QUrl)));
+        disconnect(oldActiveView, SIGNAL(redirection(QUrl,QUrl)),
+                   this, SLOT(slotViewUrlRedirection(QUrl,QUrl)));
+        connect(newActiveView, SIGNAL(urlChanged(QUrl)),
+                this, SIGNAL(activeViewUrlChanged(QUrl)));
+        connect(newActiveView, SIGNAL(redirection(QUrl,QUrl)),
+                this, SLOT(slotViewUrlRedirection(QUrl,QUrl)));
     }
 
     emit activeViewUrlChanged(activeViewContainer()->url());
     emit activeViewChanged(activeViewContainer());
 }
 
-void DolphinTabPage::slotViewUrlRedirection(const KUrl& oldUrl, const KUrl& newUrl)
+void DolphinTabPage::slotViewUrlRedirection(const QUrl& oldUrl, const QUrl& newUrl)
 {
     Q_UNUSED(oldUrl);
 
     emit activeViewUrlChanged(newUrl);
 }
 
-DolphinViewContainer* DolphinTabPage::createViewContainer(const KUrl& url) const
+DolphinViewContainer* DolphinTabPage::createViewContainer(const QUrl& url) const
 {
     DolphinViewContainer* container = new DolphinViewContainer(url, m_splitter);
     container->setActive(false);
index e4a5ad6c7e479a177ce388a9595ae91e1f6c8ff4..b46daf350c115df7c30b3978c3eeebf8501fa033 100644 (file)
@@ -22,7 +22,7 @@
 
 #include <QWidget>
 #include <QPointer>
-#include <KUrl>
+#include <QUrl>
 
 class QSplitter;
 class DolphinViewContainer;
@@ -33,7 +33,7 @@ class DolphinTabPage : public QWidget
     Q_OBJECT
 
 public:
-    explicit DolphinTabPage(const QUrl& primaryUrl, const QUrl& secondaryUrl = KUrl(), QWidget* parent = 0);
+    explicit DolphinTabPage(const QUrl& primaryUrl, const QUrl& secondaryUrl = QUrl(), QWidget* parent = 0);
 
     /**
      * @return True if primary view is the active view in this tab.
@@ -131,7 +131,7 @@ public:
 
 signals:
     void activeViewChanged(DolphinViewContainer* viewContainer);
-    void activeViewUrlChanged(const KUrl& url);
+    void activeViewUrlChanged(const QUrl& url);
 
 private slots:
     /**
@@ -147,13 +147,13 @@ private slots:
      *
      * It emits the activeViewUrlChanged signal with the url \a newUrl.
      */
-    void slotViewUrlRedirection(const KUrl& oldUrl, const KUrl& newUrl);
+    void slotViewUrlRedirection(const QUrl& oldUrl, const QUrl& newUrl);
 
 private:
     /**
      * Creates a new view container and does the default initialization.
      */
-    DolphinViewContainer* createViewContainer(const KUrl& url) const;
+    DolphinViewContainer* createViewContainer(const QUrl& url) const;
 
 private:
     QSplitter* m_splitter;
index 65cc824f0b35b111171392069323764b6941ada2..7a486942103c2db0a5571668c0e96228653acf5a 100644 (file)
@@ -130,7 +130,7 @@ void DolphinTabWidget::openNewActivatedTab()
     }
 }
 
-void DolphinTabWidget::openNewActivatedTab(const KUrl& primaryUrl, const KUrl& secondaryUrl)
+void DolphinTabWidget::openNewActivatedTab(const QUrl& primaryUrl, const QUrl& secondaryUrl)
 {
     openNewTab(primaryUrl, secondaryUrl);
     setCurrentIndex(count() - 1);
@@ -144,8 +144,8 @@ void DolphinTabWidget::openNewTab(const QUrl& primaryUrl, const QUrl& secondaryU
     tabPage->setPlacesSelectorVisible(m_placesSelectorVisible);
     connect(tabPage, SIGNAL(activeViewChanged(DolphinViewContainer*)),
             this, SIGNAL(activeViewChanged(DolphinViewContainer*)));
-    connect(tabPage, SIGNAL(activeViewUrlChanged(KUrl)),
-            this, SLOT(tabUrlChanged(KUrl)));
+    connect(tabPage, SIGNAL(activeViewUrlChanged(QUrl)),
+            this, SLOT(tabUrlChanged(QUrl)));
     addTab(tabPage, QIcon::fromTheme(KIO::iconNameForUrl(primaryUrl)), tabName(primaryUrl));
 
     if (focusWidget) {
@@ -183,8 +183,8 @@ void DolphinTabWidget::openFiles(const QList<QUrl>& files)
     // for each directory. If the "split view" option is enabled, two
     // directories are shown inside one tab (see openDirectories()).
     QList<QUrl> dirs;
-    foreach (const KUrl& url, files) {
-        const KUrl dir(url.directory());
+    foreach (const QUrl& url, files) {
+        const QUrl dir(url.adjusted(QUrl::RemoveFilename).path());
         if (!dirs.contains(dir)) {
             dirs.append(dir);
         }
@@ -296,7 +296,7 @@ void DolphinTabWidget::tabDropEvent(int index, QDropEvent* event)
     }
 }
 
-void DolphinTabWidget::tabUrlChanged(const KUrl& url)
+void DolphinTabWidget::tabUrlChanged(const QUrl& url)
 {
     const int index = indexOf(qobject_cast<QWidget*>(sender()));
     if (index >= 0) {
@@ -342,15 +342,15 @@ void DolphinTabWidget::tabRemoved(int index)
     emit tabCountChanged(count());
 }
 
-QString DolphinTabWidget::tabName(const KUrl& url) const
+QString DolphinTabWidget::tabName(const QUrl& url) const
 {
     QString name;
-    if (url.equals(KUrl("file:///"))) {
+    if (url == QUrl("file:///")) {
         name = '/';
     } else {
         name = url.fileName();
         if (name.isEmpty()) {
-            name = url.protocol();
+            name = url.scheme();
         } else {
             // Make sure that a '&' inside the directory name is displayed correctly
             // and not misinterpreted as a keyboard shortcut in QTabBar::setTabText()
index c5ab8c2601c476231d307f493275564dfdb926ed..93213ac61683547fba838b0278bfcc38c42a13f1 100644 (file)
@@ -21,7 +21,7 @@
 #define DOLPHIN_TAB_WIDGET_H
 
 #include <QTabWidget>
-#include <KUrl>
+#include <QUrl>
 
 class DolphinViewContainer;
 class DolphinTabPage;
@@ -70,13 +70,13 @@ signals:
     /**
      * Is emitted when a tab has been closed.
      */
-    void rememberClosedTab(const KUrl& url, const QByteArray& state);
+    void rememberClosedTab(const QUrl& url, const QByteArray& state);
 
     /**
      * Is emitted when the url of the current tab has been changed. This signal
      * is also emitted when the active view has been changed.
      */
-    void currentUrlChanged(const KUrl& url);
+    void currentUrlChanged(const QUrl& url);
 
 public slots:
     /**
@@ -89,13 +89,13 @@ public slots:
      * Opens a new tab showing the  URL \a primaryUrl and the optional URL
      * \a secondaryUrl and activates the tab.
      */
-    void openNewActivatedTab(const KUrl& primaryUrl, const KUrl& secondaryUrl = KUrl());
+    void openNewActivatedTab(const QUrl& primaryUrl, const QUrl& secondaryUrl = QUrl());
 
     /**
      * Opens a new tab in the background showing the URL \a primaryUrl and the
      * optional URL \a secondaryUrl.
      */
-    void openNewTab(const QUrl &primaryUrl, const QUrl &secondaryUrl = KUrl());
+    void openNewTab(const QUrl &primaryUrl, const QUrl &secondaryUrl = QUrl());
 
     /**
      * Opens each directory in \p dirs in a separate tab. If the "split view"
@@ -168,7 +168,7 @@ private slots:
      * The active view url of a tab has been changed so update the text and the
      * icon of the corresponding tab.
      */
-    void tabUrlChanged(const KUrl& url);
+    void tabUrlChanged(const QUrl& url);
 
     void currentTabChanged(int index);
 
@@ -180,7 +180,7 @@ private:
     /**
      * Returns the name of the tab for the URL \a url.
      */
-    QString tabName(const KUrl& url) const;
+    QString tabName(const QUrl& url) const;
 
 private:
     /** Caches the (negated) places panel visibility */
index 14bc4b7bc90bc8ad7f3a2214523107144341cf25..aecf7ae2faa1052b69428e7240fe4212095ce4a3 100644 (file)
@@ -32,7 +32,7 @@
 #include <KMessageWidget>
 #include <konq_operations.h>
 #include <KShell>
-#include <KUrl>
+#include <QUrl>
 #include <KUrlComboBox>
 #include <KUrlNavigator>
 #include <KRun>
@@ -48,7 +48,7 @@
 #include "views/viewmodecontroller.h"
 #include "views/viewproperties.h"
 
-DolphinViewContainer::DolphinViewContainer(const KUrl& url, QWidget* parent) :
+DolphinViewContainer::DolphinViewContainer(const QUrl& url, QWidget* parent) :
     QWidget(parent),
     m_topLayout(0),
     m_urlNavigator(0),
@@ -83,7 +83,7 @@ DolphinViewContainer::DolphinViewContainer(const KUrl& url, QWidget* parent) :
     const GeneralSettings* settings = GeneralSettings::self();
     m_urlNavigator->setUrlEditable(settings->editableUrl());
     m_urlNavigator->setShowFullPath(settings->showFullPath());
-    m_urlNavigator->setHomeUrl(KUrl(settings->homeUrl()));
+    m_urlNavigator->setHomeUrl(QUrl::fromLocalFile(settings->homeUrl()));
     KUrlComboBox* editor = m_urlNavigator->editor();
     editor->setCompletionMode(KCompletion::CompletionMode(settings->urlCompletionMode()));
 
@@ -207,7 +207,7 @@ DolphinViewContainer::~DolphinViewContainer()
 {
 }
 
-KUrl DolphinViewContainer::url() const
+QUrl DolphinViewContainer::url() const
 {
     return m_view->url();
 }
@@ -308,7 +308,7 @@ void DolphinViewContainer::readSettings()
         // settings of the URL navigator and the filterbar.
         m_urlNavigator->setUrlEditable(GeneralSettings::editableUrl());
         m_urlNavigator->setShowFullPath(GeneralSettings::showFullPath());
-        m_urlNavigator->setHomeUrl(KUrl(GeneralSettings::homeUrl()));
+        m_urlNavigator->setHomeUrl(QUrl::fromLocalFile(GeneralSettings::homeUrl()));
         setFilterBarVisible(GeneralSettings::filterBar());
     }
 
@@ -335,16 +335,16 @@ void DolphinViewContainer::setSearchModeEnabled(bool enabled)
     m_urlNavigator->setVisible(!enabled);
 
     if (enabled) {
-        const KUrl& locationUrl = m_urlNavigator->locationUrl();
+        const QUrl& locationUrl = m_urlNavigator->locationUrl();
         m_searchBox->fromSearchUrl(locationUrl);
     } else {
         m_view->setViewPropertiesContext(QString());
 
         // Restore the URL for the URL navigator. If Dolphin has been
         // started with a search-URL, the home URL is used as fallback.
-        KUrl url = m_searchBox->searchPath();
+        QUrl url = m_searchBox->searchPath();
         if (url.isEmpty() || !url.isValid() || isSearchUrl(url)) {
-            url = GeneralSettings::self()->homeUrl();
+            url = QUrl::fromLocalFile(GeneralSettings::self()->homeUrl());
         }
         m_urlNavigator->setLocationUrl(url);
     }
@@ -371,7 +371,7 @@ QString DolphinViewContainer::placesText() const
     return text;
 }
 
-void DolphinViewContainer::setUrl(const KUrl& newUrl)
+void DolphinViewContainer::setUrl(const QUrl& newUrl)
 {
     if (newUrl != m_urlNavigator->locationUrl()) {
         m_urlNavigator->setLocationUrl(newUrl);
@@ -476,14 +476,14 @@ void DolphinViewContainer::slotDirectoryLoadingCanceled()
     m_statusBar->setText(QString());
 }
 
-void DolphinViewContainer::slotUrlIsFileError(const KUrl& url)
+void DolphinViewContainer::slotUrlIsFileError(const QUrl& url)
 {
     const KFileItem item(KFileItem::Unknown, KFileItem::Unknown, url);
 
     // Find out if the file can be opened in the view (for example, this is the
     // case if the file is an archive). The mime type must be known for that.
     item.determineMimeType();
-    const KUrl& folderUrl = DolphinView::openItemAsFolderUrl(item, true);
+    const QUrl& folderUrl = DolphinView::openItemAsFolderUrl(item, true);
     if (!folderUrl.isEmpty()) {
         m_view->setUrl(folderUrl);
     } else {
@@ -498,7 +498,7 @@ void DolphinViewContainer::slotItemActivated(const KFileItem& item)
     // results in an active view.
     m_view->setActive(true);
 
-    const KUrl& url = DolphinView::openItemAsFolderUrl(item, GeneralSettings::browseThroughArchives());
+    const QUrl& url = DolphinView::openItemAsFolderUrl(item, GeneralSettings::browseThroughArchives());
     if (!url.isEmpty()) {
         m_view->setUrl(url);
         return;
@@ -542,7 +542,7 @@ void DolphinViewContainer::activate()
     setActive(true);
 }
 
-void DolphinViewContainer::slotViewUrlAboutToBeChanged(const KUrl& url)
+void DolphinViewContainer::slotViewUrlAboutToBeChanged(const QUrl& url)
 {
     // URL changes of the view can happen in two ways:
     // 1. The URL navigator gets changed and will trigger the view to update its URL
@@ -554,7 +554,7 @@ void DolphinViewContainer::slotViewUrlAboutToBeChanged(const KUrl& url)
     }
 }
 
-void DolphinViewContainer::slotUrlNavigatorLocationAboutToBeChanged(const KUrl& url)
+void DolphinViewContainer::slotUrlNavigatorLocationAboutToBeChanged(const QUrl& url)
 {
     // URL changes of the view can happen in two ways:
     // 1. The URL navigator gets changed and will trigger the view to update its URL
@@ -566,7 +566,7 @@ void DolphinViewContainer::slotUrlNavigatorLocationAboutToBeChanged(const KUrl&
     }
 }
 
-void DolphinViewContainer::slotUrlNavigatorLocationChanged(const KUrl& url)
+void DolphinViewContainer::slotUrlNavigatorLocationChanged(const QUrl& url)
 {
     slotReturnPressed();
 
@@ -582,7 +582,7 @@ void DolphinViewContainer::slotUrlNavigatorLocationChanged(const KUrl& url)
         }
     } else if (KProtocolManager::isSourceProtocol(url)) {
         QString app = "konqueror";
-        if (url.protocol().startsWith(QLatin1String("http"))) {
+        if (url.scheme().startsWith(QLatin1String("http"))) {
             showMessage(i18nc("@info:status", // krazy:exclude=qmethods
                               "Dolphin does not support web pages, the web browser has been launched"),
                         Information);
@@ -602,7 +602,7 @@ void DolphinViewContainer::slotUrlNavigatorLocationChanged(const KUrl& url)
                         Information);
         }
 
-        const QString secureUrl = KShell::quoteArg(url.pathOrUrl());
+        const QString secureUrl = KShell::quoteArg(url.toDisplayString(QUrl::PreferLocalFile));
         const QString command = app + ' ' + secureUrl;
         KRun::runCommand(command, app, app, this);
     } else {
@@ -610,7 +610,7 @@ void DolphinViewContainer::slotUrlNavigatorLocationChanged(const KUrl& url)
     }
 }
 
-void DolphinViewContainer::dropUrls(const KUrl& destination, QDropEvent* event)
+void DolphinViewContainer::dropUrls(const QUrl& destination, QDropEvent* event)
 {
     m_dropDestination = destination;
 
@@ -645,7 +645,7 @@ void DolphinViewContainer::dropUrlsDelayed()
     m_dropEvent.reset();
 }
 
-void DolphinViewContainer::redirect(const KUrl& oldUrl, const KUrl& newUrl)
+void DolphinViewContainer::redirect(const QUrl& oldUrl, const QUrl& newUrl)
 {
     Q_UNUSED(oldUrl);
     const bool block = m_urlNavigator->signalsBlocked();
@@ -689,7 +689,7 @@ void DolphinViewContainer::slotReturnPressed()
 
 void DolphinViewContainer::startSearching()
 {
-    const KUrl url = m_searchBox->urlForSearching();
+    const QUrl url = m_searchBox->urlForSearching();
     if (url.isValid() && !url.isEmpty()) {
         m_view->setViewPropertiesContext("search");
         m_urlNavigator->setLocationUrl(url);
@@ -717,10 +717,9 @@ void DolphinViewContainer::showErrorMessage(const QString& msg)
     showMessage(msg, Error);
 }
 
-bool DolphinViewContainer::isSearchUrl(const KUrl& url) const
+bool DolphinViewContainer::isSearchUrl(const QUrl& url) const
 {
-    const QString protocol = url.protocol();
-    return protocol.contains("search");
+    return url.scheme().contains("search");
 }
 
 void DolphinViewContainer::saveViewState()
@@ -730,4 +729,3 @@ void DolphinViewContainer::saveViewState()
     m_view->saveState(stream);
     m_urlNavigator->saveLocationState(locationState);
 }
-
index ce2f606d5772047d9e6993e48b70530ab2c72af3..bd4141db5a2d56e6a605247eaba4da3291664645 100644 (file)
@@ -40,7 +40,7 @@ namespace KActivities {
 
 class FilterBar;
 class KMessageWidget;
-class KUrl;
+class QUrl;
 class KUrlNavigator;
 class DolphinSearchBox;
 class DolphinStatusBar;
@@ -69,14 +69,14 @@ public:
         Error
     };
 
-    DolphinViewContainer(const KUrl& url, QWidget* parent);
+    DolphinViewContainer(const QUrl& url, QWidget* parent);
     virtual ~DolphinViewContainer();
 
     /**
      * Returns the current active URL, where all actions are applied.
      * The URL navigator is synchronized with this URL.
      */
-    KUrl url() const;
+    QUrl url() const;
 
     /**
      * If \a active is true, the view container will marked as active. The active
@@ -137,7 +137,7 @@ public slots:
      * are emitted.
      * @see DolphinViewContainer::urlNavigator()
      */
-    void setUrl(const KUrl& url);
+    void setUrl(const QUrl& url);
 
     /**
      * Popups the filter bar above the status bar if \a visible is true.
@@ -204,7 +204,7 @@ private slots:
      * Is called if the URL set by DolphinView::setUrl() represents
      * a file and not a directory. Takes care to activate the file.
      */
-    void slotUrlIsFileError(const KUrl& url);
+    void slotUrlIsFileError(const QUrl& url);
 
     /**
      * Handles clicking on an item. If the item is a directory, the
@@ -243,19 +243,19 @@ private slots:
      * Is invoked if the signal urlAboutToBeChanged() from the DolphinView
      * is emitted. Tries to save the view-state.
      */
-    void slotViewUrlAboutToBeChanged(const KUrl& url);
+    void slotViewUrlAboutToBeChanged(const QUrl& url);
 
     /**
      * Is invoked if the signal urlAboutToBeChanged() from the URL navigator
      * is emitted. Tries to save the view-state.
      */
-    void slotUrlNavigatorLocationAboutToBeChanged(const KUrl& url);
+    void slotUrlNavigatorLocationAboutToBeChanged(const QUrl& url);
 
     /**
      * Restores the current view to show \a url and assures
      * that the root URL of the view is respected.
      */
-    void slotUrlNavigatorLocationChanged(const KUrl& url);
+    void slotUrlNavigatorLocationChanged(const QUrl& url);
 
     /**
      * Is connected with the URL navigator and drops the URLs
@@ -264,7 +264,7 @@ private slots:
      * Creates a copy of \a event and invokes \a dropUrlsDelayed with a
      * queued connection.
      */
-    void dropUrls(const KUrl& destination, QDropEvent* event);
+    void dropUrls(const QUrl& destination, QDropEvent* event);
 
     /**
      * Is invoked with a queued connection by \a dropUrls to prevent that the
@@ -280,7 +280,7 @@ private slots:
      * URL of the URL navigator to \a newUrl without triggering
      * a reloading of the directory.
      */
-    void redirect(const KUrl& oldUrl, const KUrl& newUrl);
+    void redirect(const QUrl& oldUrl, const QUrl& newUrl);
 
     /** Requests the focus for the view \a m_view. */
     void requestFocus();
@@ -318,7 +318,7 @@ private:
     /**
      * @return True if the URL protocol is a search URL (e. g. baloosearch:// or filenamesearch://).
      */
-    bool isSearchUrl(const KUrl& url) const;
+    bool isSearchUrl(const QUrl& url) const;
 
     /**
      * Saves the state of the current view: contents position,
@@ -341,7 +341,7 @@ private:
     QElapsedTimer m_statusBarTimestamp;  // Time in ms since last update
     bool m_autoGrabFocus;
 
-    KUrl m_dropDestination;
+    QUrl m_dropDestination;
     QScopedPointer<QDropEvent> m_dropEvent;
 
 #ifdef KF5Activities_FOUND
index 524b4f59a97ff6597e854b144870ecda77d80657..711b0797be1d416fc7b94694963516fdb542e8aa 100644 (file)
@@ -189,8 +189,9 @@ bool KFileItemModel::setData(int index, const QHash<QByteArray, QVariant>& value
 
     m_itemData[index]->values = currentValues;
     if (changedRoles.contains("text")) {
-        KUrl url = m_itemData[index]->item.url();
-        url.setFileName(currentValues["text"].toString());
+        QUrl url = m_itemData[index]->item.url();
+        url = url.adjusted(QUrl::RemoveFilename);
+        url.setPath(url.path() + currentValues["text"].toString());
         m_itemData[index]->item.setUrl(url);
     }
 
@@ -243,8 +244,8 @@ QMimeData* KFileItemModel::createMimeData(const KItemSet& indexes) const
     // The following code has been taken from KDirModel::mimeData()
     // (kdelibs/kio/kio/kdirmodel.cpp)
     // Copyright (C) 2006 David Faure <faure@kde.org>
-    KUrl::List urls;
-    KUrl::List mostLocalUrls;
+    QList<QUrl> urls;
+    QList<QUrl> mostLocalUrls;
     bool canUseMostLocalUrls = true;
     const ItemData* lastAddedItem = 0;
 
@@ -276,9 +277,9 @@ QMimeData* KFileItemModel::createMimeData(const KItemSet& indexes) const
 
     const bool different = canUseMostLocalUrls && mostLocalUrls != urls;
     if (different) {
-        urls.populateMimeData(mostLocalUrls, data);
+        data->setUrls(mostLocalUrls);
     } else {
-        urls.populateMimeData(data);
+        data->setUrls(urls);
     }
 
     return data;
@@ -369,8 +370,7 @@ int KFileItemModel::index(const KFileItem& item) const
 
 int KFileItemModel::index(const QUrl& url) const
 {
-    KUrl urlToFind = url;
-    urlToFind.adjustPath(KUrl::RemoveTrailingSlash);
+    const QUrl urlToFind = url.adjusted(QUrl::StripTrailingSlash);
 
     const int itemCount = m_itemData.count();
     int itemsInHash = m_items.count();
@@ -388,7 +388,7 @@ int KFileItemModel::index(const QUrl& url) const
         const int blockSize = 1000;
         const int currentBlockEnd = qMin(itemsInHash + blockSize, itemCount);
         for (int i = itemsInHash; i < currentBlockEnd; ++i) {
-            const KUrl nextUrl = m_itemData.at(i)->item.url();
+            const QUrl nextUrl = m_itemData.at(i)->item.url();
             m_items.insert(nextUrl, i);
         }
 
@@ -412,12 +412,12 @@ int KFileItemModel::index(const QUrl& url) const
             kWarning() << "m_itemData.count() ==" << m_itemData.count();
 
             // Check if there are multiple items with the same URL.
-            QMultiHash<KUrl, int> indexesForUrl;
+            QMultiHash<QUrl, int> indexesForUrl;
             for (int i = 0; i < m_itemData.count(); ++i) {
                 indexesForUrl.insert(m_itemData.at(i)->item.url(), i);
             }
 
-            foreach (const KUrl& url, indexesForUrl.uniqueKeys()) {
+            foreach (const QUrl& url, indexesForUrl.uniqueKeys()) {
                 if (indexesForUrl.count(url) > 1) {
                     kWarning() << "Multiple items found with the URL" << url;
                     foreach (int index, indexesForUrl.values(url)) {
@@ -511,15 +511,15 @@ bool KFileItemModel::setExpanded(int index, bool expanded)
     }
 
     const KFileItem item = m_itemData.at(index)->item;
-    const KUrl url = item.url();
-    const KUrl targetUrl = item.targetUrl();
+    const QUrl url = item.url();
+    const QUrl targetUrl = item.targetUrl();
     if (expanded) {
         m_expandedDirs.insert(targetUrl, url);
         m_dirLister->openUrl(url, KDirLister::Keep);
 
-        const KUrl::List previouslyExpandedChildren = m_itemData.at(index)->values.value("previouslyExpandedChildren").value<KUrl::List>();
-        foreach (const KUrl& url, previouslyExpandedChildren) {
-            m_urlsToExpand.insert(url);
+        const QVariantList previouslyExpandedChildren = m_itemData.at(index)->values.value("previouslyExpandedChildren").value<QVariantList>();
+        foreach (const QVariant& var, previouslyExpandedChildren) {
+            m_urlsToExpand.insert(var.toUrl());
         }
     } else {
         // Note that there might be (indirect) children of the folder which is to be collapsed in
@@ -541,14 +541,14 @@ bool KFileItemModel::setExpanded(int index, bool expanded)
         const int itemCount = m_itemData.count();
         const int firstChildIndex = index + 1;
 
-        KUrl::List expandedChildren;
+        QVariantList expandedChildren;
 
         int childIndex = firstChildIndex;
         while (childIndex < itemCount && expandedParentsCount(childIndex) > parentLevel) {
             ItemData* itemData = m_itemData.at(childIndex);
             if (itemData->values.value("isExpanded").toBool()) {
-                const KUrl targetUrl = itemData->item.targetUrl();
-                const KUrl url = itemData->item.url();
+                const QUrl targetUrl = itemData->item.targetUrl();
+                const QUrl url = itemData->item.url();
                 m_expandedDirs.remove(targetUrl);
                 m_dirLister->stop(url);     // TODO: try to unit-test this, see https://bugs.kde.org/show_bug.cgi?id=332102#c11
                 expandedChildren.append(targetUrl);
@@ -610,10 +610,10 @@ void KFileItemModel::expandParentDirectories(const QUrl &url)
     // expanded is added to m_urlsToExpand. KDirLister
     // does not care whether the parent-URL has already been
     // expanded.
-    KUrl urlToExpand = m_dirLister->url();
+    QUrl urlToExpand = m_dirLister->url();
     const QStringList subDirs = url.path().mid(pos).split(QDir::separator());
     for (int i = 0; i < subDirs.count() - 1; ++i) {
-        urlToExpand.addPath(subDirs.at(i));
+        urlToExpand.setPath(urlToExpand.path() + '/' + subDirs.at(i));
         m_urlsToExpand.insert(urlToExpand);
     }
 
@@ -801,7 +801,7 @@ void KFileItemModel::resortAllItems()
     // Remember the order of the current URLs so
     // that it can be determined which indexes have
     // been moved because of the resorting.
-    QList<KUrl> oldUrls;
+    QList<QUrl> oldUrls;
     oldUrls.reserve(itemCount);
     foreach (const ItemData* itemData, m_itemData) {
         oldUrls.append(itemData->item.url());
@@ -870,7 +870,7 @@ void KFileItemModel::slotCompleted()
         // Note that the parent folder must be expanded before any of its subfolders become visible.
         // Therefore, some URLs in m_restoredExpandedUrls might not be visible yet
         // -> we expand the first visible URL we find in m_restoredExpandedUrls.
-        foreach (const KUrl& url, m_urlsToExpand) {
+        foreach (const QUrl& url, m_urlsToExpand) {
             const int indexForUrl = index(url);
             if (indexForUrl >= 0) {
                 m_urlsToExpand.remove(url);
@@ -902,12 +902,11 @@ void KFileItemModel::slotItemsAdded(const QUrl &directoryUrl, const KFileItemLis
 {
     Q_ASSERT(!items.isEmpty());
 
-    KUrl parentUrl;
+    QUrl parentUrl;
     if (m_expandedDirs.contains(directoryUrl)) {
         parentUrl = m_expandedDirs.value(directoryUrl);
     } else {
-        parentUrl = directoryUrl;
-        parentUrl.adjustPath(KUrl::RemoveTrailingSlash);
+        parentUrl = directoryUrl.adjusted(QUrl::StripTrailingSlash);
     }
 
     if (m_requestRole[ExpandedParentsCountRole]) {
@@ -916,7 +915,7 @@ void KFileItemModel::slotItemsAdded(const QUrl &directoryUrl, const KFileItemLis
         // might result in emitting the same items twice due to the Keep-parameter.
         // This case happens if an item gets expanded, collapsed and expanded again
         // before the items could be loaded for the first expansion.
-        if (index(KUrl(items.first().url())) >= 0) {
+        if (index(items.first().url()) >= 0) {
             // The items are already part of the model.
             return;
         }
@@ -1202,7 +1201,7 @@ void KFileItemModel::insertItems(QList<ItemData*>& newItems)
     }
 
     // The indexes in m_items are not correct anymore. Therefore, we clear m_items.
-    // It will be re-populated with the updated indices if index(const KUrl&) is called.
+    // It will be re-populated with the updated indices if index(const QUrl&) is called.
     m_items.clear();
 
     emit itemsInserted(itemRanges);
@@ -1255,13 +1254,13 @@ void KFileItemModel::removeItems(const KItemRangeList& itemRanges, RemoveItemsBe
     m_itemData.erase(m_itemData.end() - removedItemsCount, m_itemData.end());
 
     // The indexes in m_items are not correct anymore. Therefore, we clear m_items.
-    // It will be re-populated with the updated indices if index(const KUrl&) is called.
+    // It will be re-populated with the updated indices if index(const QUrl&) is called.
     m_items.clear();
 
     emit itemsRemoved(itemRanges);
 }
 
-QList<KFileItemModel::ItemData*> KFileItemModel::createItemDataList(const KUrl& parentUrl, const KFileItemList& items) const
+QList<KFileItemModel::ItemData*> KFileItemModel::createItemDataList(const QUrl& parentUrl, const KFileItemList& items) const
 {
     if (m_sortRole == TypeRole) {
         // Try to resolve the MIME-types synchronously to prevent a reordering of
@@ -2200,7 +2199,7 @@ QByteArray KFileItemModel::sharedValue(const QByteArray& value)
 bool KFileItemModel::isConsistent() const
 {
     // m_items may contain less items than m_itemData because m_items
-    // is populated lazily, see KFileItemModel::index(const KUrl& url).
+    // is populated lazily, see KFileItemModel::index(const QUrl& url).
     if (m_items.count() > m_itemData.count()) {
         return false;
     }
index aea0341ead710262160e86354e9c890dbf62f005..1a4f6928ea991e07fc4bc0f46ecf31616bda677c 100644 (file)
@@ -22,7 +22,7 @@
 
 #include <libdolphin_export.h>
 #include <KFileItemList>
-#include <KUrl>
+#include <QUrl>
 #include <kitemviews/kitemmodelbase.h>
 #include <kitemviews/private/kfileitemmodelfilter.h>
 
@@ -317,7 +317,7 @@ private:
      * Note that the ItemData instances are created dynamically and
      * must be deleted by the caller.
      */
-    QList<ItemData*> createItemDataList(const KUrl& parentUrl, const KFileItemList& items) const;
+    QList<ItemData*> createItemDataList(const QUrl& parentUrl, const KFileItemList& items) const;
 
     /**
      * Prepares the items for sorting. Normally, the hash 'values' in ItemData is filled
@@ -470,11 +470,11 @@ private:
 
     QList<ItemData*> m_itemData;
 
-    // m_items is a cache for the method index(const KUrl&). If it contains N
+    // m_items is a cache for the method index(const QUrl&). If it contains N
     // entries, it is guaranteed that these correspond to the first N items in
     // the model, i.e., that (for every i between 0 and N - 1)
     // m_items.value(fileItem(i).url()) == i
-    mutable QHash<KUrl, int> m_items;
+    mutable QHash<QUrl, int> m_items;
 
     KFileItemModelFilter m_filter;
     QHash<KFileItem, ItemData*> m_filteredItems; // Items that got hidden by KFileItemModel::setNameFilter()
index 8e9b9dd9807800d4b0c14e3b34ab8aa18afb7816..2353f106f190f43eb9de5dc2d721d39b7117fedb 100644 (file)
@@ -741,7 +741,7 @@ void KFileItemModelRolesUpdater::slotDirectoryContentsCountReceived(const QStrin
     const bool getIsExpandableRole = m_roles.contains("isExpandable");
 
     if (getSizeRole || getIsExpandableRole) {
-        const int index = m_model->index(KUrl(path));
+        const int index = m_model->index(QUrl::fromLocalFile(path));
         if (index >= 0) {
             QHash<QByteArray, QVariant> data;
 
index 9a08a53dbd9c1daad1fa73dff1c896dca3a26302..ec48f19db25d93ae3fea6b05a438b00928fb772d 100644 (file)
@@ -680,7 +680,7 @@ void KStandardItemListWidget::dataChanged(const QHash<QByteArray, QVariant>& cur
     // The URL might have changed (i.e., if the sort order of the items has
     // been changed). Therefore, the "is cut" state must be updated.
     KFileItemClipboard* clipboard = KFileItemClipboard::instance();
-    const KUrl itemUrl = data().value("url").value<KUrl>();
+    const QUrl itemUrl = data().value("url").value<QUrl>();
     m_isCut = clipboard->isCut(itemUrl);
 
     // The icon-state might depend from other roles and hence is
@@ -831,7 +831,7 @@ void KStandardItemListWidget::showEvent(QShowEvent* event)
     // Listen to changes of the clipboard to mark the item as cut/uncut
     KFileItemClipboard* clipboard = KFileItemClipboard::instance();
 
-    const KUrl itemUrl = data().value("url").value<KUrl>();
+    const QUrl itemUrl = data().value("url").value<QUrl>();
     m_isCut = clipboard->isCut(itemUrl);
 
     connect(clipboard, &KFileItemClipboard::cutItemsChanged,
@@ -848,7 +848,7 @@ void KStandardItemListWidget::hideEvent(QHideEvent* event)
 
 void KStandardItemListWidget::slotCutItemsChanged()
 {
-    const KUrl itemUrl = data().value("url").value<KUrl>();
+    const QUrl itemUrl = data().value("url").value<QUrl>();
     const bool isCut = KFileItemClipboard::instance()->isCut(itemUrl);
     if (m_isCut != isCut) {
         m_isCut = isCut;
index cd448e233af6f3ee5a70214c3b79f4b95683c95b..af7312ad270089999bc29164d3837aab9716a85c 100644 (file)
@@ -122,7 +122,7 @@ void KDirectoryContentsCounter::slotResult(const QString& path, int count)
 
 void KDirectoryContentsCounter::slotDirWatchDirty(const QString& path)
 {
-    const int index = m_model->index(KUrl(path));
+    const int index = m_model->index(QUrl::fromLocalFile(path));
     if (index >= 0) {
         if (!m_model->fileItem(index).isDir()) {
             // If INotify is used, KDirWatch issues the dirty() signal
@@ -151,7 +151,7 @@ void KDirectoryContentsCounter::slotItemsRemoved()
             QMutableSetIterator<QString> it(m_watchedDirs);
             while (it.hasNext()) {
                 const QString& path = it.next();
-                if (m_model->index(KUrl(path)) < 0) {
+                if (m_model->index(QUrl::fromLocalFile(path)) < 0) {
                     m_dirWatcher->removeDir(path);
                     it.remove();
                 }
@@ -181,4 +181,4 @@ void KDirectoryContentsCounter::startWorker(const QString& path)
 }
 
 QThread* KDirectoryContentsCounter::m_workerThread = 0;
-int KDirectoryContentsCounter::m_workersCount = 0;
\ No newline at end of file
+int KDirectoryContentsCounter::m_workersCount = 0;
index 1fb147716991026c4474026831aad4b163328290..e127678535aca1f63b747d91824dc23c2ffa457f 100644 (file)
 
 #include "kfileitemclipboard.h"
 
-#include <KGlobal>
 #include <QApplication>
 #include <QClipboard>
 #include <QMimeData>
+#include <KUrlMimeData>
 
 class KFileItemClipboardSingleton
 {
 public:
     KFileItemClipboard instance;
 };
-K_GLOBAL_STATIC(KFileItemClipboardSingleton, s_KFileItemClipboard)
+Q_GLOBAL_STATIC(KFileItemClipboardSingleton, s_KFileItemClipboard)
 
 
 
@@ -38,12 +38,12 @@ KFileItemClipboard* KFileItemClipboard::instance()
     return &s_KFileItemClipboard->instance;
 }
 
-bool KFileItemClipboard::isCut(const KUrl& url) const
+bool KFileItemClipboard::isCut(const QUrl& url) const
 {
     return m_cutItems.contains(url);
 }
 
-QList<KUrl> KFileItemClipboard::cutItems() const
+QList<QUrl> KFileItemClipboard::cutItems() const
 {
     return m_cutItems.toList();
 }
@@ -66,7 +66,7 @@ void KFileItemClipboard::updateCutItems()
     const QByteArray data = mimeData->data("application/x-kde-cutselection");
     const bool isCutSelection = (!data.isEmpty() && data.at(0) == QLatin1Char('1'));
     if (isCutSelection) {
-        m_cutItems = KUrl::List::fromMimeData(mimeData).toSet();
+        m_cutItems = KUrlMimeData::urlsFromMimeData(mimeData).toSet();
     } else {
         m_cutItems.clear();
     }
@@ -82,4 +82,3 @@ KFileItemClipboard::KFileItemClipboard() :
     connect(QApplication::clipboard(), &QClipboard::dataChanged,
             this, &KFileItemClipboard::updateCutItems);
 }
-
index 86eb8e9fcfd7364bee109ec898bfa17d68177d15..d02fc0d4787ebdf655e719d6cb789549599e651f 100644 (file)
@@ -20,7 +20,7 @@
 #ifndef KFILEITEMCLIPBOARD_H
 #define KFILEITEMCLIPBOARD_H
 
-#include <KUrl>
+#include <QUrl>
 #include <QList>
 #include <QSet>
 #include <QObject>
@@ -38,9 +38,9 @@ class LIBDOLPHINPRIVATE_EXPORT KFileItemClipboard : public QObject
 public:
     static KFileItemClipboard* instance();
 
-    bool isCut(const KUrl& url) const;
+    bool isCut(const QUrl& url) const;
 
-    QList<KUrl> cutItems() const;
+    QList<QUrl> cutItems() const;
 
 signals:
     void cutItemsChanged();
@@ -54,7 +54,7 @@ private slots:
 private:
     KFileItemClipboard();
 
-    QSet<KUrl> m_cutItems;
+    QSet<QUrl> m_cutItems;
 
     friend class KFileItemClipboardSingleton;
 };
index da01d20bd426d3672480f752474b6e92f46391d5..94a0e39fd6dda436b7aed7a011320bd9a451a741 100644 (file)
@@ -22,7 +22,7 @@
 
 #include <libdolphin_export.h>
 #include <KDirLister>
-#include <KUrl>
+#include <QUrl>
 
 /**
  * @brief Extends the class KDirLister by emitting a signal when an
@@ -45,7 +45,7 @@ signals:
      * Is emitted when the URL of the directory lister represents a file.
      * In this case no signal errorMessage() will be emitted.
      */
-    void urlIsFileError(const KUrl& url);
+    void urlIsFileError(const QUrl& url);
 
 protected:
     virtual void handleError(KIO::Job* job);
index afeeb64a9e3ee75140fcb3ca087b07007c7414c0..5bfc88c2ac978a75e59ebf7de3689b258067fcae 100644 (file)
@@ -108,7 +108,7 @@ void FoldersPanel::rename(const KFileItem& item)
 
 bool FoldersPanel::urlChanged()
 {
-    if (!url().isValid() || url().protocol().contains("search")) {
+    if (!url().isValid() || url().scheme().contains("search")) {
         // Skip results shown by a search, as possible identical
         // directory names are useless without parent-path information.
         return false;
@@ -296,13 +296,13 @@ void FoldersPanel::startFadeInAnimation()
     anim->setDuration(200);
 }
 
-void FoldersPanel::loadTree(const KUrl& url)
+void FoldersPanel::loadTree(const QUrl& url)
 {
     Q_ASSERT(m_controller);
 
     m_updateCurrentItem = false;
 
-    KUrl baseUrl;
+    QUrl baseUrl;
     if (url.isLocalFile()) {
         // Use the root directory as base for local URLs (#150941)
         baseUrl = QDir::rootPath();
index 1d3039d1f04cbe885789a43420f5ff5432b84961..2cbd28f28b5b60bc9621cd432c25f5f57aa77ade 100644 (file)
@@ -20,7 +20,7 @@
 #ifndef FOLDERSPANEL_H
 #define FOLDERSPANEL_H
 
-#include <KUrl>
+#include <QUrl>
 #include <panels/panel.h>
 
 class KFileItemModel;
@@ -51,8 +51,8 @@ public:
     void rename(const KFileItem& item);
 
 signals:
-    void folderActivated(const KUrl& url);
-    void folderMiddleClicked(const KUrl& url);
+    void folderActivated(const QUrl& url);
+    void folderMiddleClicked(const QUrl& url);
     void errorMessage(const QString& error);
 
 protected:
@@ -87,7 +87,7 @@ private:
      * directories until \a url.
      * @param url  URL of the leaf directory that should get expanded.
      */
-    void loadTree(const KUrl& url);
+    void loadTree(const QUrl& url);
 
     /**
      * Sets the item with the index \a index as current item, selects
index 330e185603ae2c0c8c1c006ef3cecd500feeef8a..4afe9e8e39360b235413a5e9cdee07393faaa344 100644 (file)
@@ -92,7 +92,7 @@ void TreeViewContextMenu::open()
         KConfigGroup configGroup(globalConfig, "KDE");
         bool showDeleteCommand = configGroup.readEntry("ShowDeleteCommand", false);
 
-        const KUrl url = m_fileItem.url();
+        const QUrl url = m_fileItem.url();
         if (url.isLocalFile()) {
             QAction* moveToTrashAction = new QAction(QIcon::fromTheme("user-trash"),
                                                     i18nc("@action:inmenu", "Move to Trash"), this);
@@ -155,9 +155,9 @@ void TreeViewContextMenu::open()
 
 void TreeViewContextMenu::populateMimeData(QMimeData* mimeData, bool cut)
 {
-    KUrl::List kdeUrls;
+    QList<QUrl> kdeUrls;
     kdeUrls.append(m_fileItem.url());
-    KUrl::List mostLocalUrls;
+    QList<QUrl> mostLocalUrls;
     bool dummy;
     mostLocalUrls.append(m_fileItem.mostLocalUrl(dummy));
     KIO::setClipboardDataCut(mimeData, cut);
@@ -190,12 +190,12 @@ void TreeViewContextMenu::rename()
 
 void TreeViewContextMenu::moveToTrash()
 {
-    KUrl::List list = KUrl::List() << m_fileItem.url();
+    const QList<QUrl> list {QList<QUrl>() << m_fileItem.url()};
     KIO::JobUiDelegate uiDelegate;
     uiDelegate.setWindow(m_parent);
     if (uiDelegate.askDeleteConfirmation(list, KIO::JobUiDelegate::Trash, KIO::JobUiDelegate::DefaultConfirmation)) {
         KIO::Job* job = KIO::trash(list);
-        KIO::FileUndoManager::self()->recordJob(KIO::FileUndoManager::Trash, list, KUrl("trash:/"), job);
+        KIO::FileUndoManager::self()->recordJob(KIO::FileUndoManager::Trash, list, QUrl("trash:/"), job);
         KJobWidgets::setWindow(job, m_parent);
         job->ui()->setAutoErrorHandlingEnabled(true);
     }
@@ -203,7 +203,7 @@ void TreeViewContextMenu::moveToTrash()
 
 void TreeViewContextMenu::deleteItem()
 {
-    KUrl::List list = KUrl::List() << m_fileItem.url();
+    const QList<QUrl> list {QList<QUrl>() << m_fileItem.url()};
     KIO::JobUiDelegate uiDelegate;
     uiDelegate.setWindow(m_parent);
     if (uiDelegate.askDeleteConfirmation(list, KIO::JobUiDelegate::Delete, KIO::JobUiDelegate::DefaultConfirmation)) {
index 5c4da7fbcf640c7e09ba2bb22acd5a0ebc878643..3d7a05f0351a3dfe8d07332af74369a6012b7275 100644 (file)
@@ -213,7 +213,7 @@ void InformationPanel::slotInfoTimeout()
 void InformationPanel::reset()
 {
     if (m_invalidUrlCandidate == m_shownUrl) {
-        m_invalidUrlCandidate = KUrl();
+        m_invalidUrlCandidate = QUrl();
 
         // The current URL is still invalid. Reset
         // the content to show the directory URL.
@@ -226,11 +226,11 @@ void InformationPanel::reset()
 
 void InformationPanel::slotFileRenamed(const QString& source, const QString& dest)
 {
-    if (m_shownUrl == KUrl(source)) {
-        m_shownUrl = KUrl(dest);
+    if (m_shownUrl == QUrl::fromLocalFile(source)) {
+        m_shownUrl = QUrl::fromLocalFile(dest);
         m_fileItem = KFileItem(KFileItem::Unknown, KFileItem::Unknown, m_shownUrl);
 
-        if ((m_selection.count() == 1) && (m_selection[0].url() == KUrl(source))) {
+        if ((m_selection.count() == 1) && (m_selection[0].url() == QUrl::fromLocalFile(source))) {
             m_selection[0] = m_fileItem;
             // Implementation note: Updating the selection is only required if exactly one
             // item is selected, as the name of the item is shown. If this should change
@@ -244,10 +244,10 @@ void InformationPanel::slotFileRenamed(const QString& source, const QString& des
 
 void InformationPanel::slotFilesAdded(const QString& directory)
 {
-    if (m_shownUrl == KUrl(directory)) {
+    if (m_shownUrl == QUrl::fromLocalFile(directory)) {
         // If the 'trash' icon changes because the trash has been emptied or got filled,
         // the signal filesAdded("trash:/") will be emitted.
-        KFileItem item(KFileItem::Unknown, KFileItem::Unknown, KUrl(directory));
+        KFileItem item(KFileItem::Unknown, KFileItem::Unknown, QUrl::fromLocalFile(directory));
         requestDelayedItemInfo(item);
     }
 }
@@ -255,7 +255,7 @@ void InformationPanel::slotFilesAdded(const QString& directory)
 void InformationPanel::slotFilesChanged(const QStringList& files)
 {
     foreach (const QString& fileName, files) {
-        if (m_shownUrl == KUrl(fileName)) {
+        if (m_shownUrl == QUrl::fromLocalFile(fileName)) {
             showItemInfo();
             break;
         }
@@ -265,7 +265,7 @@ void InformationPanel::slotFilesChanged(const QStringList& files)
 void InformationPanel::slotFilesRemoved(const QStringList& files)
 {
     foreach (const QString& fileName, files) {
-        if (m_shownUrl == KUrl(fileName)) {
+        if (m_shownUrl == QUrl::fromLocalFile(fileName)) {
             // the currently shown item has been removed, show
             // the parent directory as fallback
             markUrlAsInvalid();
@@ -276,15 +276,15 @@ void InformationPanel::slotFilesRemoved(const QStringList& files)
 
 void InformationPanel::slotEnteredDirectory(const QString& directory)
 {
-    if (m_shownUrl == KUrl(directory)) {
-        KFileItem item(KFileItem::Unknown, KFileItem::Unknown, KUrl(directory));
+    if (m_shownUrl == QUrl::fromLocalFile(directory)) {
+        KFileItem item(KFileItem::Unknown, KFileItem::Unknown, QUrl::fromLocalFile(directory));
         requestDelayedItemInfo(item);
     }
 }
 
 void InformationPanel::slotLeftDirectory(const QString& directory)
 {
-    if (m_shownUrl == KUrl(directory)) {
+    if (m_shownUrl == QUrl::fromLocalFile(directory)) {
         // The signal 'leftDirectory' is also emitted when a media
         // has been unmounted. In this case no directory change will be
         // done in Dolphin, but the Information Panel must be updated to
@@ -308,9 +308,9 @@ void InformationPanel::cancelRequest()
     m_urlCandidate.clear();
 }
 
-bool InformationPanel::isEqualToShownUrl(const KUrl& url) const
+bool InformationPanel::isEqualToShownUrl(const QUrl& url) const
 {
-    return m_shownUrl.equals(url, KUrl::CompareWithoutTrailingSlash);
+    return m_shownUrl.matches(url, QUrl::StripTrailingSlash);
 }
 
 void InformationPanel::markUrlAsInvalid()
index 8a1237b95752c7c115563585a205033926ab1226..9a1e6351dc6f25591c0ccce9dd926d6ec7246d0c 100644 (file)
@@ -40,7 +40,7 @@ public:
     virtual ~InformationPanel();
 
 signals:
-    void urlActivated(const KUrl& url);
+    void urlActivated(const QUrl& url);
 
 public slots:
     /**
@@ -116,7 +116,7 @@ private:
     /**
      * Returns true, if \a url is equal to the shown URL m_shownUrl.
      */
-    bool isEqualToShownUrl(const KUrl& url) const;
+    bool isEqualToShownUrl(const QUrl& url) const;
 
     /**
      * Marks the URL as invalid and will reset the Information Panel
@@ -136,17 +136,17 @@ private:
     QTimer* m_resetUrlTimer;
 
     // URL that is currently shown in the Information Panel.
-    KUrl m_shownUrl;
+    QUrl m_shownUrl;
 
     // URL candidate that will replace m_shownURL after a delay.
     // Used to remember URLs when hovering items.
-    KUrl m_urlCandidate;
+    QUrl m_urlCandidate;
 
     // URL candidate that is marked as invalid (e. g. because the directory
     // has been deleted or the shown item has been renamed). The Information
     // Panel will be reset asynchronously to prevent unnecessary resets when
     // a directory has been changed.
-    KUrl m_invalidUrlCandidate;
+    QUrl m_invalidUrlCandidate;
 
     KFileItem m_fileItem; // file item for m_shownUrl if available (otherwise null)
     KFileItemList m_selection;
index ce138baee7c1c75b9e4bceff2922eb0273a57ab8..4e32a7974f8cab0dca36023879c112c1007d63a5 100644 (file)
@@ -169,8 +169,8 @@ void InformationPanelContent::showItem(const KFileItem& item)
         m_previewJob->kill();
     }
 
-    const KUrl itemUrl = item.url();
-    const bool isSearchUrl = itemUrl.protocol().contains("search") && item.localPath().isEmpty();
+    const QUrl itemUrl = item.url();
+    const bool isSearchUrl = itemUrl.scheme().contains("search") && item.localPath().isEmpty();
     if (!applyPlace(itemUrl)) {
         setNameLabelText(item.text());
         if (isSearchUrl) {
@@ -370,12 +370,12 @@ void InformationPanelContent::refreshMetaData()
     }
 }
 
-bool InformationPanelContent::applyPlace(const KUrl& url)
+bool InformationPanelContent::applyPlace(const QUrl& url)
 {
     const int count = m_placesItemModel->count();
     for (int i = 0; i < count; ++i) {
         const PlacesItem* item = m_placesItemModel->placesItem(i);
-        if (item->url().equals(url, KUrl::CompareWithoutTrailingSlash)) {
+        if (item->url().matches(url, QUrl::StripTrailingSlash)) {
             setNameLabelText(item->text());
             m_preview->setPixmap(QIcon::fromTheme(item->icon()).pixmap(128, 128));
             return true;
index 6e4faec823f0e2bef97b011e7d47f57a2f07f6bf..f4103853e15e7b83e284ea4a93f87c4bed30b053 100644 (file)
@@ -22,7 +22,7 @@
 
 #include "config-baloo.h"
 #include <KFileItem>
-#include <KUrl>
+#include <QUrl>
 
 #include <QPointer>
 #include <QWidget>
@@ -81,7 +81,7 @@ public:
     void configureSettings(const QList<QAction*>& customContextMenuActions);
 
 signals:
-    void urlActivated( const KUrl& url );
+    void urlActivated( const QUrl& url );
 
 protected:
     /** @see QObject::eventFilter() */
@@ -121,7 +121,7 @@ private:
      * @return True, if the URL represents exactly a place.
      * @param url The url to check.
      */
-    bool applyPlace(const KUrl& url);
+    bool applyPlace(const QUrl& url);
 
     /**
      * Sets the text for the label \a m_nameLabel and assures that the
index 27cd3e7467e5c05b221bf8d6f770ff4965d09929..0de587bf8c56073c47fb22d739691252949a7116 100644 (file)
@@ -34,7 +34,7 @@
 #include <KDialog>
 #include <QIcon>
 #include <KIconLoader>
-#include <KUrl>
+#include <QUrl>
 #include <KLocalizedString>
 
 class EmbeddedVideoPlayer : public Phonon::VideoWidget
@@ -73,7 +73,7 @@ PhononWidget::PhononWidget(QWidget *parent)
 {
 }
 
-void PhononWidget::setUrl(const KUrl &url)
+void PhononWidget::setUrl(const QUrl &url)
 {
     if (m_url != url) {
         stop(); // emits playingStopped() signal
@@ -81,7 +81,7 @@ void PhononWidget::setUrl(const KUrl &url)
     }
 }
 
-KUrl PhononWidget::url() const
+QUrl PhononWidget::url() const
 {
     return m_url;
 }
index b5aedfe4f209fe461cae53dd833124cf67f90888..09b4ee26f8e1a885837f7f37e83fe299a036e3b3 100644 (file)
@@ -21,8 +21,7 @@
 #ifndef PHONONWIDGET_H
 #define PHONONWIDGET_H
 
-#include <KUrl>
-
+#include <QUrl>
 #include <QSize>
 #include <QWidget>
 
@@ -46,8 +45,8 @@ class PhononWidget : public QWidget
     public:
         PhononWidget(QWidget *parent = 0);
 
-        void setUrl(const KUrl &url);
-        KUrl url() const;
+        void setUrl(const QUrl &url);
+        QUrl url() const;
 
         void setVideoSize(const QSize& size);
         QSize videoSize() const;
@@ -77,7 +76,7 @@ class PhononWidget : public QWidget
         void applyVideoSize();
 
     private:
-        KUrl m_url;
+        QUrl m_url;
         QSize m_videoSize;
 
         QToolButton *m_playButton;
index 7673134456f7ae84c61375f1a88b927dc8cdd431..348191c981de63da7b511d06157a12ce363f7e07 100644 (file)
@@ -19,7 +19,7 @@
  ***************************************************************************/
 
 #include "panel.h"
-#include <KUrl>
+#include <QUrl>
 
 Panel::Panel(QWidget* parent) :
     QWidget(parent),
@@ -32,7 +32,7 @@ Panel::~Panel()
 {
 }
 
-KUrl Panel::url() const
+QUrl Panel::url() const
 {
     return m_url;
 }
@@ -57,13 +57,13 @@ QSize Panel::sizeHint() const
     return QSize(180, 180);
 }
 
-void Panel::setUrl(const KUrl& url)
+void Panel::setUrl(const QUrl& url)
 {
-    if (url.equals(m_url, KUrl::CompareWithoutTrailingSlash)) {
+    if (url.matches(m_url, QUrl::StripTrailingSlash)) {
         return;
     }
 
-    const KUrl oldUrl = m_url;
+    const QUrl oldUrl = m_url;
     m_url = url;
     const bool accepted = urlChanged();
     if (!accepted) {
index b2562dd6b8831412b565984e610b1555b10efb4f..f43ebe9d9b950f6c79fe60b4471ac1cbc8ddd0fd 100644 (file)
@@ -22,7 +22,7 @@
 #define PANEL_H
 
 #include <QWidget>
-#include <KUrl>
+#include <QUrl>
 
 /**
  * @brief Base widget for all panels that can be docked on the window borders.
@@ -39,7 +39,7 @@ public:
     virtual ~Panel();
 
     /** Returns the current set URL of the active Dolphin view. */
-    KUrl url() const;
+    QUrl url() const;
 
     /**
      * Sets custom context menu actions that are added to the panel specific
@@ -57,7 +57,7 @@ public slots:
      * This is invoked every time the folder being displayed in the
      * active Dolphin view changes.
      */
-    void setUrl(const KUrl& url);
+    void setUrl(const QUrl &url);
 
     /**
      * Refreshes the view to get synchronized with the settings.
@@ -75,7 +75,7 @@ protected:
     virtual bool urlChanged() = 0;
 
 private:
-    KUrl m_url;
+    QUrl m_url;
     QList<QAction*> m_customContextMenuActions;
 };
 
index edfe02343612a81f2e6525a2ec5bc38ea6791f0b..b1f62b982b1e6e7cdbfa5caf5a822775ae2dc2a8 100644 (file)
@@ -51,16 +51,16 @@ PlacesItem::~PlacesItem()
     delete m_trashDirLister;
 }
 
-void PlacesItem::setUrl(const KUrl& url)
+void PlacesItem::setUrl(const QUrl &url)
 {
     // The default check in KStandardItem::setDataValue()
     // for equal values does not work with a custom value
-    // like KUrl. Hence do a manual check to prevent that
+    // like QUrl. Hence do a manual check to prevent that
     // setting an equal URL results in an itemsChanged()
     // signal.
-    if (dataValue("url").value<KUrl>() != url) {
+    if (dataValue("url").value<QUrl>() != url) {
         delete m_trashDirLister;
-        if (url.protocol() == QLatin1String("trash")) {
+        if (url.scheme() == QLatin1String("trash")) {
             // The trash icon must always be updated dependent on whether
             // the trash is empty or not. We use a KDirLister that automatically
             // watches for changes if the number of items has been changed.
@@ -77,9 +77,9 @@ void PlacesItem::setUrl(const KUrl& url)
     }
 }
 
-KUrl PlacesItem::url() const
+QUrl PlacesItem::url() const
 {
-    return dataValue("url").value<KUrl>();
+    return dataValue("url").value<QUrl>();
 }
 
 void PlacesItem::setUdi(const QString& udi)
@@ -170,7 +170,7 @@ KBookmark PlacesItem::bookmark() const
 PlacesItem::GroupType PlacesItem::groupType() const
 {
     if (udi().isEmpty()) {
-        const QString protocol = url().protocol();
+        const QString protocol = url().scheme();
         if (protocol == QLatin1String("timeline")) {
             return RecentlySavedType;
         }
@@ -196,7 +196,7 @@ bool PlacesItem::storageSetupNeeded() const
 
 KBookmark PlacesItem::createBookmark(KBookmarkManager* manager,
                                      const QString& text,
-                                     const KUrl& url,
+                                     const QUrl& url,
                                      const QString& iconName)
 {
     KBookmarkGroup root = manager->root();
index 4c636ec63412e088d37103c22835fa823fd9b140..0bb116e574e0426bc806405b2918ac90b640eb45 100644 (file)
@@ -22,7 +22,7 @@
 
 #include <KBookmark>
 #include <kitemviews/kstandarditem.h>
-#include <KUrl>
+#include <QUrl>
 #include <QPointer>
 #include <Solid/Device>
 #include <Solid/OpticalDisc>
@@ -51,8 +51,8 @@ public:
     explicit PlacesItem(const KBookmark& bookmark, PlacesItem* parent = 0);
     virtual ~PlacesItem();
 
-    void setUrl(const KUrl& url);
-    KUrl url() const;
+    void setUrl(const QUrl& url);
+    QUrl url() const;
 
     void setUdi(const QString& udi);
     QString udi() const;
@@ -74,7 +74,7 @@ public:
 
     static KBookmark createBookmark(KBookmarkManager* manager,
                                     const QString& text,
-                                    const KUrl& url,
+                                    const QUrl& url,
                                     const QString& iconName);
     static KBookmark createDeviceBookmark(KBookmarkManager* manager,
                                           const QString& udi);
index 0fae3f248239b3bb18efea6f87c2faba971e4a78..257d0683397bc3820fd3eb237ef38d9770a05403 100644 (file)
@@ -72,18 +72,18 @@ QString PlacesItemEditDialog::text() const
 {
     QString text = m_textEdit->text();
     if (text.isEmpty()) {
-        const KUrl url = m_urlEdit->url();
-        text = url.fileName().isEmpty() ? url.prettyUrl() : url.fileName();
+        const QUrl url = m_urlEdit->url();
+        text = url.fileName().isEmpty() ? url.toDisplayString(QUrl::PreferLocalFile) : url.fileName();
     }
     return text;
 }
 
-void PlacesItemEditDialog::setUrl(const KUrl& url)
+void PlacesItemEditDialog::setUrl(const QUrl& url)
 {
     m_url = url;
 }
 
-KUrl PlacesItemEditDialog::url() const
+QUrl PlacesItemEditDialog::url() const
 {
     return m_urlEdit->url();
 }
@@ -142,7 +142,7 @@ void PlacesItemEditDialog::initialize()
     m_textEdit->setText(m_text);
     m_textEdit->setClickMessage(i18n("Enter descriptive label here"));
 
-    m_urlEdit = new KUrlRequester(m_url.prettyUrl(), mainWidget);
+    m_urlEdit = new KUrlRequester(m_url, mainWidget);
     m_urlEdit->setMode(KFile::Directory);
     formLayout->addRow(i18nc("@label", "Location:"), m_urlEdit);
     // Provide room for at least 40 chars (average char width is half of height)
index 3944b5a35aa3b5158b7b9ecac8bed0db282d3d59..53e62379d8795a9d307f53f6725c6bcfa875ff44 100644 (file)
@@ -25,7 +25,7 @@
 #define PLACESITEMEDITDIALOG_H
 
 #include <QDialog>
-#include <KUrl>
+#include <QUrl>
 
 class KIconButton;
 class KLineEdit;
@@ -47,8 +47,8 @@ public:
     void setText(const QString& text);
     QString text() const;
 
-    void setUrl(const KUrl& url);
-    KUrl url() const;
+    void setUrl(const QUrl& url);
+    QUrl url() const;
 
     void setAllowGlobal(bool allow);
     bool allowGlobal() const;
@@ -65,7 +65,7 @@ private:
 private:
     QString m_icon;
     QString m_text;
-    KUrl m_url;
+    QUrl m_url;
     bool m_allowGlobal;
 
     KUrlRequester* m_urlEdit;
index 14d97de5b4f2c8b55ae0624592ca7210b3dd292d..e49a6a9da61fe5c4b6596472b5863a62ba15a7d2 100644 (file)
@@ -41,6 +41,7 @@
 #include <QDate>
 #include <QMimeData>
 #include <QTimer>
+#include <KUrlMimeData>
 
 #include <Solid/Device>
 #include <Solid/DeviceNotifier>
@@ -120,7 +121,7 @@ PlacesItemModel::~PlacesItemModel()
 }
 
 PlacesItem* PlacesItemModel::createPlacesItem(const QString& text,
-                                              const KUrl& url,
+                                              const QUrl& url,
                                               const QString& iconName)
 {
     const KBookmark bookmark = PlacesItem::createBookmark(m_bookmarkManager, text, url, iconName);
@@ -206,15 +207,15 @@ bool PlacesItemModel::hiddenItemsShown() const
     return m_hiddenItemsShown;
 }
 
-int PlacesItemModel::closestItem(const KUrl& url) const
+int PlacesItemModel::closestItem(const QUrl& url) const
 {
     int foundIndex = -1;
     int maxLength = 0;
 
     for (int i = 0; i < count(); ++i) {
-        const KUrl itemUrl = placesItem(i)->url();
+        const QUrl itemUrl = placesItem(i)->url();
         if (itemUrl.isParentOf(url)) {
-            const int length = itemUrl.prettyUrl().length();
+            const int length = itemUrl.toDisplayString().length();
             if (length > maxLength) {
                 foundIndex = i;
                 maxLength = length;
@@ -368,13 +369,13 @@ void PlacesItemModel::requestStorageSetup(int index)
 
 QMimeData* PlacesItemModel::createMimeData(const KItemSet& indexes) const
 {
-    KUrl::List urls;
+    QList<QUrl> urls;
     QByteArray itemData;
 
     QDataStream stream(&itemData, QIODevice::WriteOnly);
 
     foreach (int index, indexes) {
-        const KUrl itemUrl = placesItem(index)->url();
+        const QUrl itemUrl = placesItem(index)->url();
         if (itemUrl.isValid()) {
             urls << itemUrl;
         }
@@ -383,7 +384,7 @@ QMimeData* PlacesItemModel::createMimeData(const KItemSet& indexes) const
 
     QMimeData* mimeData = new QMimeData();
     if (!urls.isEmpty()) {
-        urls.populateMimeData(mimeData);
+        mimeData->setUrls(urls);
     }
     mimeData->setData(internalMimeType(), itemData);
 
@@ -424,9 +425,9 @@ void PlacesItemModel::dropMimeDataBefore(int index, const QMimeData* mimeData)
         insertItem(dropIndex, newItem);
     } else if (mimeData->hasFormat("text/uri-list")) {
         // One or more items must be added to the model
-        const KUrl::List urls = KUrl::List::fromMimeData(mimeData);
+        const QList<QUrl> urls = KUrlMimeData::urlsFromMimeData(mimeData);
         for (int i = urls.count() - 1; i >= 0; --i) {
-            const KUrl& url = urls[i];
+            const QUrl& url = urls[i];
 
             QString text = url.fileName();
             if (text.isEmpty()) {
@@ -434,7 +435,7 @@ void PlacesItemModel::dropMimeDataBefore(int index, const QMimeData* mimeData)
             }
 
             if ((url.isLocalFile() && !QFileInfo(url.toLocalFile()).isDir())
-                    || url.protocol() == "trash") {
+                    || url.scheme() == "trash") {
                 // Only directories outside the trash are allowed
                 continue;
             }
@@ -446,12 +447,12 @@ void PlacesItemModel::dropMimeDataBefore(int index, const QMimeData* mimeData)
     }
 }
 
-KUrl PlacesItemModel::convertedUrl(const KUrl& url)
+QUrl PlacesItemModel::convertedUrl(const QUrl& url)
 {
-    KUrl newUrl = url;
-    if (url.protocol() == QLatin1String("timeline")) {
+    QUrl newUrl = url;
+    if (url.scheme() == QLatin1String("timeline")) {
         newUrl = createTimelineUrl(url);
-    } else if (url.protocol() == QLatin1String("search")) {
+    } else if (url.scheme() == QLatin1String("search")) {
         newUrl = createSearchUrl(url);
     }
 
@@ -606,7 +607,7 @@ void PlacesItemModel::slotStorageSetupDone(Solid::ErrorType error,
         return;
     }
 
-    if (error) {
+    if (error != Solid::NoError) {
         if (errorData.isValid()) {
             emit errorMessage(i18nc("@info", "An error occurred while accessing '%1', the system responded: %2",
                                     item->text(),
@@ -729,7 +730,7 @@ void PlacesItemModel::loadBookmarks()
     KBookmark bookmark = root.first();
     QSet<QString> devices = m_availableDevices;
 
-    QSet<KUrl> missingSystemBookmarks;
+    QSet<QUrl> missingSystemBookmarks;
     foreach (const SystemBookmarkData& data, m_systemBookmarks) {
         missingSystemBookmarks.insert(data.url);
     }
@@ -750,7 +751,7 @@ void PlacesItemModel::loadBookmarks()
                 devices.remove(item->udi());
                 devicesItems.append(item);
             } else {
-                const KUrl url = bookmark.url();
+                const QUrl url = bookmark.url();
                 if (missingSystemBookmarks.contains(url)) {
                     missingSystemBookmarks.remove(url);
 
@@ -823,15 +824,15 @@ bool PlacesItemModel::acceptBookmark(const KBookmark& bookmark,
                                      const QSet<QString>& availableDevices) const
 {
     const QString udi = bookmark.metaDataItem("UDI");
-    const KUrl url = bookmark.url();
+    const QUrl url = bookmark.url();
     const QString appName = bookmark.metaDataItem("OnlyInApp");
     const bool deviceAvailable = availableDevices.contains(udi);
 
     const bool allowedHere = (appName.isEmpty()
                               || appName == KGlobal::mainComponent().componentName()
                               || appName == KGlobal::mainComponent().componentName() + AppNamePrefix)
-                             && (m_fileIndexingEnabled || (url.protocol() != QLatin1String("timeline") &&
-                                                           url.protocol() != QLatin1String("search")));
+                             && (m_fileIndexingEnabled || (url.scheme() != QLatin1String("timeline") &&
+                                                           url.scheme() != QLatin1String("search")));
 
     return (udi.isEmpty() && allowedHere) || deviceAvailable;
 }
@@ -843,7 +844,7 @@ PlacesItem* PlacesItemModel::createSystemPlacesItem(const SystemBookmarkData& da
                                                     data.url,
                                                     data.icon);
 
-    const QString protocol = data.url.protocol();
+    const QString protocol = data.url.scheme();
     if (protocol == QLatin1String("timeline") || protocol == QLatin1String("search")) {
         // As long as the KFilePlacesView from kdelibs is available, the system-bookmarks
         // for "Recently Saved" and "Search For" should be a setting available only
@@ -881,7 +882,7 @@ PlacesItem* PlacesItemModel::createSystemPlacesItem(const SystemBookmarkData& da
                 props.setViewMode(DolphinView::IconsView);
                 props.setPreviewsShown(true);
                 props.setVisibleRoles(QList<QByteArray>() << "text");
-            } else if (data.url.protocol() == "timeline") {
+            } else if (data.url.scheme() == "timeline") {
                 props.setViewMode(DolphinView::DetailsView);
                 props.setVisibleRoles(QList<QByteArray>() << "text" << "date");
             }
@@ -900,42 +901,42 @@ void PlacesItemModel::createSystemBookmarks()
     // i18nc call is done after reading the bookmark. The reason why the i18nc call is not
     // done here is because otherwise switching the language would not result in retranslating the
     // bookmarks.
-    m_systemBookmarks.append(SystemBookmarkData(KUrl(KUser().homeDir()),
+    m_systemBookmarks.append(SystemBookmarkData(QUrl::fromLocalFile(KUser().homeDir()),
                                                 "user-home",
                                                 I18N_NOOP2("KFile System Bookmarks", "Home")));
-    m_systemBookmarks.append(SystemBookmarkData(KUrl("remote:/"),
+    m_systemBookmarks.append(SystemBookmarkData(QUrl("remote:/"),
                                                 "network-workgroup",
                                                 I18N_NOOP2("KFile System Bookmarks", "Network")));
-    m_systemBookmarks.append(SystemBookmarkData(KUrl("/"),
+    m_systemBookmarks.append(SystemBookmarkData(QUrl::fromLocalFile("/"),
                                                 "folder-red",
                                                 I18N_NOOP2("KFile System Bookmarks", "Root")));
-    m_systemBookmarks.append(SystemBookmarkData(KUrl("trash:/"),
+    m_systemBookmarks.append(SystemBookmarkData(QUrl("trash:/"),
                                                 "user-trash",
                                                 I18N_NOOP2("KFile System Bookmarks", "Trash")));
 
     if (m_fileIndexingEnabled) {
-        m_systemBookmarks.append(SystemBookmarkData(KUrl("timeline:/today"),
+        m_systemBookmarks.append(SystemBookmarkData(QUrl("timeline:/today"),
                                                     "go-jump-today",
                                                     I18N_NOOP2("KFile System Bookmarks", "Today")));
-        m_systemBookmarks.append(SystemBookmarkData(KUrl("timeline:/yesterday"),
+        m_systemBookmarks.append(SystemBookmarkData(QUrl("timeline:/yesterday"),
                                                     "view-calendar-day",
                                                     I18N_NOOP2("KFile System Bookmarks", "Yesterday")));
-        m_systemBookmarks.append(SystemBookmarkData(KUrl("timeline:/thismonth"),
+        m_systemBookmarks.append(SystemBookmarkData(QUrl("timeline:/thismonth"),
                                                     "view-calendar-month",
                                                     I18N_NOOP2("KFile System Bookmarks", "This Month")));
-        m_systemBookmarks.append(SystemBookmarkData(KUrl("timeline:/lastmonth"),
+        m_systemBookmarks.append(SystemBookmarkData(QUrl("timeline:/lastmonth"),
                                                     "view-calendar-month",
                                                     I18N_NOOP2("KFile System Bookmarks", "Last Month")));
-        m_systemBookmarks.append(SystemBookmarkData(KUrl("search:/documents"),
+        m_systemBookmarks.append(SystemBookmarkData(QUrl("search:/documents"),
                                                     "folder-txt",
                                                     I18N_NOOP2("KFile System Bookmarks", "Documents")));
-        m_systemBookmarks.append(SystemBookmarkData(KUrl("search:/images"),
+        m_systemBookmarks.append(SystemBookmarkData(QUrl("search:/images"),
                                                     "folder-image",
                                                     I18N_NOOP2("KFile System Bookmarks", "Images")));
-        m_systemBookmarks.append(SystemBookmarkData(KUrl("search:/audio"),
+        m_systemBookmarks.append(SystemBookmarkData(QUrl("search:/audio"),
                                                     "folder-sound",
                                                     I18N_NOOP2("KFile System Bookmarks", "Audio Files")));
-        m_systemBookmarks.append(SystemBookmarkData(KUrl("search:/videos"),
+        m_systemBookmarks.append(SystemBookmarkData(QUrl("search:/videos"),
                                                     "folder-video",
                                                     I18N_NOOP2("KFile System Bookmarks", "Videos")));
     }
@@ -1105,14 +1106,14 @@ bool PlacesItemModel::equalBookmarkIdentifiers(const KBookmark& b1, const KBookm
     }
 }
 
-KUrl PlacesItemModel::createTimelineUrl(const KUrl& url)
+QUrl PlacesItemModel::createTimelineUrl(const QUrl& url)
 {
     // TODO: Clarify with the Baloo-team whether it makes sense
     // provide default-timeline-URLs like 'yesterday', 'this month'
     // and 'last month'.
-    KUrl timelineUrl;
+    QUrl timelineUrl;
 
-    const QString path = url.pathOrUrl();
+    const QString path = url.toDisplayString(QUrl::PreferLocalFile);
     if (path.endsWith(QLatin1String("yesterday"))) {
         const QDate date = QDate::currentDate().addDays(-1);
         const int year = date.year();
@@ -1153,12 +1154,12 @@ QString PlacesItemModel::timelineDateString(int year, int month, int day)
     return date;
 }
 
-KUrl PlacesItemModel::createSearchUrl(const KUrl& url)
+QUrl PlacesItemModel::createSearchUrl(const QUrl& url)
 {
-    KUrl searchUrl;
+    QUrl searchUrl;
 
 #ifdef HAVE_BALOO
-    const QString path = url.pathOrUrl();
+    const QString path = url.toDisplayString(QUrl::PreferLocalFile);
     if (path.endsWith(QLatin1String("documents"))) {
         searchUrl = searchUrlForType("Document");
     } else if (path.endsWith(QLatin1String("images"))) {
@@ -1178,7 +1179,7 @@ KUrl PlacesItemModel::createSearchUrl(const KUrl& url)
 }
 
 #ifdef HAVE_BALOO
-KUrl PlacesItemModel::searchUrlForType(const QString& type)
+QUrl PlacesItemModel::searchUrlForType(const QString& type)
 {
     Baloo::Query query;
     query.addType("File");
index 4a374e502fdff5c5bb2130beddabcfe344138db6..229841dc54916633c91061fba7b49124af9a7cd6 100644 (file)
@@ -24,7 +24,7 @@
 
 #include <kitemviews/kstandarditemmodel.h>
 
-#include <KUrl>
+#include <QUrl>
 #include <QHash>
 #include <QList>
 #include <QSet>
@@ -58,7 +58,7 @@ public:
      *         attributes.
      */
     PlacesItem* createPlacesItem(const QString& text,
-                                 const KUrl& url,
+                                 const QUrl& url,
                                  const QString& iconName = QString());
 
     PlacesItem* placesItem(int index) const;
@@ -87,7 +87,7 @@ public:
      * range of the URL. -1 is returned if no closest item
      * could be found.
      */
-    int closestItem(const KUrl& url) const;
+    int closestItem(const QUrl& url) const;
 
     /**
      * Appends the item \a item as last element of the group
@@ -121,7 +121,7 @@ public:
      *         the corresponding IO-slave. Virtual URLs for bookmarks are used to
      *         be independent from internal format changes.
      */
-    static KUrl convertedUrl(const KUrl& url);
+    static QUrl convertedUrl(const QUrl& url);
 
     virtual void clear();
 signals:
@@ -223,7 +223,7 @@ private:
     /**
      * @return URL using the timeline-protocol for searching (see convertedUrl()).
      */
-    static KUrl createTimelineUrl(const KUrl& url);
+    static QUrl createTimelineUrl(const QUrl& url);
 
     /**
      * Helper method for createTimelineUrl().
@@ -237,7 +237,7 @@ private:
      *         for a given term. The URL \a url represents a places-internal
      *         URL like e.g. "search:/documents" (see convertedUrl()).
      */
-    static KUrl createSearchUrl(const KUrl& url);
+    static QUrl createSearchUrl(const QUrl& url);
 
 #ifdef HAVE_BALOO
     /**
@@ -245,7 +245,7 @@ private:
      * @return URL that can be listed by KIO and results in searching
      *         for the given type
      */
-    static KUrl searchUrlForType(const QString& type);
+    static QUrl searchUrlForType(const QString& type);
 #endif
 
 #ifdef PLACESITEMMODEL_DEBUG
@@ -262,17 +262,17 @@ private:
 
     struct SystemBookmarkData
     {
-        SystemBookmarkData(const KUrl& url,
+        SystemBookmarkData(const QUrl& url,
                            const QString& icon,
                            const QString& text) :
             url(url), icon(icon), text(text) {}
-        KUrl url;
+        QUrl url;
         QString icon;
         QString text;
     };
 
     QList<SystemBookmarkData> m_systemBookmarks;
-    QHash<KUrl, int> m_systemBookmarksIndexes;
+    QHash<QUrl, int> m_systemBookmarksIndexes;
 
     // Contains hidden and unhidden items that are stored as
     // bookmark (the model itself only contains items that
index 68c7fa558033a9eade944304ff5cd1323a3ea0f0..a84c474809770c5e286423b92cb1e3559530ba69 100644 (file)
@@ -72,7 +72,7 @@ PlacesPanel::~PlacesPanel()
 
 bool PlacesPanel::urlChanged()
 {
-    if (!url().isValid() || url().protocol().contains("search")) {
+    if (!url().isValid() || url().scheme().contains("search")) {
         // Skip results shown by a search, as possible identical
         // directory names are useless without parent-path information.
         return false;
@@ -185,7 +185,7 @@ void PlacesPanel::slotItemContextMenuRequested(int index, const QPointF& pos)
             mainSeparator = menu.addSeparator();
         }
     } else {
-        if (item->url() == KUrl("trash:/")) {
+        if (item->url() == QUrl("trash:/")) {
             emptyTrashAction = menu.addAction(QIcon::fromTheme("trash-empty"), i18nc("@action:inmenu", "Empty Trash"));
             emptyTrashAction->setEnabled(item->icon() == "user-trash-full");
             menu.addSeparator();
@@ -368,7 +368,7 @@ void PlacesPanel::slotItemDropEvent(int index, QGraphicsSceneDragDropEvent* even
         return;
     }
 
-    KUrl destUrl = destItem->url();
+    QUrl destUrl = destItem->url();
     QDropEvent dropEvent(event->pos().toPoint(),
                          event->possibleActions(),
                          event->mimeData(),
@@ -389,7 +389,7 @@ void PlacesPanel::slotItemDropEventStorageSetupDone(int index, bool success)
 
     if ((index == m_itemDropEventIndex) && m_itemDropEvent && m_itemDropEventMimeData) {
         if (success) {
-            KUrl destUrl = m_model->placesItem(index)->url();
+            QUrl destUrl = m_model->placesItem(index)->url();
 
             QString error;
             DragAndDropHelper::dropUrls(KFileItem(), destUrl, m_itemDropEvent, error);
@@ -412,7 +412,7 @@ void PlacesPanel::slotAboveItemDropEvent(int index, QGraphicsSceneDragDropEvent*
     m_model->dropMimeDataBefore(index, event->mimeData());
 }
 
-void PlacesPanel::slotUrlsDropped(const KUrl& dest, QDropEvent* event, QWidget* parent)
+void PlacesPanel::slotUrlsDropped(const QUrl& dest, QDropEvent* event, QWidget* parent)
 {
     Q_UNUSED(parent);
     QString error;
@@ -447,7 +447,7 @@ void PlacesPanel::slotStorageSetupDone(int index, bool success)
         m_triggerStorageSetupButton = Qt::NoButton;
     } else {
         setUrl(m_storageSetupFailedUrl);
-        m_storageSetupFailedUrl = KUrl();
+        m_storageSetupFailedUrl = QUrl();
     }
 }
 
@@ -465,7 +465,7 @@ void PlacesPanel::emptyTrash()
 void PlacesPanel::addEntry()
 {
     const int index = m_controller->selectionManager()->currentItem();
-    const KUrl url = m_model->data(index).value("url").value<KUrl>();
+    const QUrl url = m_model->data(index).value("url").value<QUrl>();
 
     QPointer<PlacesItemEditDialog> dialog = new PlacesItemEditDialog(this);
     dialog->setWindowTitle(i18nc("@title:window", "Add Places Entry"));
@@ -487,7 +487,7 @@ void PlacesPanel::editEntry(int index)
     dialog->setWindowTitle(i18nc("@title:window", "Edit Places Entry"));
     dialog->setIcon(data.value("iconName").toString());
     dialog->setText(data.value("text").toString());
-    dialog->setUrl(data.value("url").value<KUrl>());
+    dialog->setUrl(data.value("url").value<QUrl>());
     dialog->setAllowGlobal(true);
     if (dialog->exec() == QDialog::Accepted) {
         PlacesItem* oldItem = m_model->placesItem(index);
@@ -528,7 +528,7 @@ void PlacesPanel::triggerItem(int index, Qt::MouseButton button)
     } else {
         m_triggerStorageSetupButton = Qt::NoButton;
 
-        const KUrl url = m_model->data(index).value("url").value<KUrl>();
+        const QUrl url = m_model->data(index).value("url").value<QUrl>();
         if (!url.isEmpty()) {
             if (button == Qt::MiddleButton) {
                 emit placeMiddleClicked(PlacesItemModel::convertedUrl(url));
index 1f7979ecac2bd26c5b1a8f4045debde2d610260f..3604e99864eb286d0f299ae3408f874d3b83701e 100644 (file)
@@ -21,7 +21,8 @@
 #ifndef PLACESPANEL_H
 #define PLACESPANEL_H
 
-#include <KUrl>
+#include <QUrl>
+#include <QMimeData>
 #include <panels/panel.h>
 
 class KItemListController;
@@ -42,8 +43,8 @@ public:
     virtual ~PlacesPanel();
 
 signals:
-    void placeActivated(const KUrl& url);
-    void placeMiddleClicked(const KUrl& url);
+    void placeActivated(const QUrl& url);
+    void placeMiddleClicked(const QUrl& url);
     void errorMessage(const QString& error);
 
 protected:
@@ -61,7 +62,7 @@ private slots:
     void slotItemDropEvent(int index, QGraphicsSceneDragDropEvent* event);
     void slotItemDropEventStorageSetupDone(int index, bool success);
     void slotAboveItemDropEvent(int index, QGraphicsSceneDragDropEvent* event);
-    void slotUrlsDropped(const KUrl& dest, QDropEvent* event, QWidget* parent);
+    void slotUrlsDropped(const QUrl& dest, QDropEvent* event, QWidget* parent);
     void slotTrashUpdated(KJob* job);
     void slotStorageSetupDone(int index, bool success);
 
@@ -83,7 +84,7 @@ private:
     PlacesItemModel* m_model;
     PlacesView* m_view;
 
-    KUrl m_storageSetupFailedUrl;
+    QUrl m_storageSetupFailedUrl;
     Qt::MouseButton m_triggerStorageSetupButton;
 
     int m_itemDropEventIndex;
index 964479628bdee7b35e04e982908b70947b1e1832..02489d40e0ec2dfd6d95b4c1e16d46c5b4086407 100644 (file)
@@ -127,7 +127,7 @@ void TerminalPanel::showEvent(QShowEvent* event)
     Panel::showEvent(event);
 }
 
-void TerminalPanel::changeDir(const KUrl& url)
+void TerminalPanel::changeDir(const QUrl& url)
 {
     delete m_mostLocalUrlJob;
     m_mostLocalUrlJob = 0;
@@ -173,7 +173,7 @@ void TerminalPanel::sendCdToTerminal(const QString& dir)
 void TerminalPanel::slotMostLocalUrlResult(KJob* job)
 {
     KIO::StatJob* statJob = static_cast<KIO::StatJob *>(job);
-    const KUrl url = statJob->mostLocalUrl();
+    const QUrl url = statJob->mostLocalUrl();
     if (url.isLocalFile()) {
         sendCdToTerminal(url.toLocalFile());
     }
@@ -188,10 +188,9 @@ void TerminalPanel::slotKonsolePartCurrentDirectoryChanged(const QString& dir)
     // Only change the view URL if 'dir' is different from the current view URL.
     // Note that the current view URL could also be a symbolic link to 'dir'
     // -> use QDir::canonicalPath() to check that.
-    const KUrl oldUrl(url());
-    const KUrl newUrl(dir);
+    const QUrl oldUrl(url());
+    const QUrl newUrl(QUrl::fromLocalFile(dir));
     if (newUrl != oldUrl && dir != QDir(oldUrl.path()).canonicalPath()) {
         emit changeUrl(newUrl);
     }
 }
-
index 6a0b38f5b5a218be46f7dec28f07a415d6bcda97..5d012a332d622ded87fe18a26af7ec7ad38c7b44 100644 (file)
@@ -56,7 +56,7 @@ signals:
     /**
      * Is emitted if the an URL change is requested.
      */
-    void changeUrl(const KUrl& url);
+    void changeUrl(const QUrl& url);
 
 protected:
     /** @see Panel::urlChanged() */
@@ -70,7 +70,7 @@ private slots:
     void slotKonsolePartCurrentDirectoryChanged(const QString& dir);
 
 private:
-    void changeDir(const KUrl& url);
+    void changeDir(const QUrl& url);
     void sendCdToTerminal(const QString& path);
 
 private:
index 050ae394d84a9dbadf490851be8892fd3537a9be..65d35539cb7a84528072cbb18bcdf9c7ed98eafc 100644 (file)
@@ -82,7 +82,7 @@ QString DolphinSearchBox::text() const
     return m_searchInput->text();
 }
 
-void DolphinSearchBox::setSearchPath(const KUrl& url)
+void DolphinSearchBox::setSearchPath(const QUrl& url)
 {
     m_searchPath = url;
 
@@ -94,7 +94,7 @@ void DolphinSearchBox::setSearchPath(const KUrl& url)
         if (url.isLocalFile()) {
             location = QLatin1String("/");
         } else {
-            location = url.protocol() + QLatin1String(" - ") + url.host();
+            location = url.scheme() + QLatin1String(" - ") + url.host();
         }
     }
 
@@ -114,14 +114,14 @@ void DolphinSearchBox::setSearchPath(const KUrl& url)
     m_facetsWidget->setEnabled(hasFacetsSupport);
 }
 
-KUrl DolphinSearchBox::searchPath() const
+QUrl DolphinSearchBox::searchPath() const
 {
     return m_searchPath;
 }
 
-KUrl DolphinSearchBox::urlForSearching() const
+QUrl DolphinSearchBox::urlForSearching() const
 {
-    KUrl url;
+    QUrl url;
     bool useBalooSearch = false;
 #ifdef HAVE_BALOO
     const Baloo::IndexerConfig searchInfo;
@@ -130,7 +130,7 @@ KUrl DolphinSearchBox::urlForSearching() const
     if (useBalooSearch) {
         url = balooUrlForSearching();
     } else {
-        url.setProtocol("filenamesearch");
+        url.setScheme("filenamesearch");
         url.addQueryItem("search", m_searchInput->text());
         if (m_contentButton->isChecked()) {
             url.addQueryItem("checkContent", "yes");
@@ -151,15 +151,14 @@ KUrl DolphinSearchBox::urlForSearching() const
     return url;
 }
 
-void DolphinSearchBox::fromSearchUrl(const KUrl& url)
+void DolphinSearchBox::fromSearchUrl(const QUrl& url)
 {
-    if (url.protocol() == "baloosearch") {
+    if (url.scheme() == "baloosearch") {
         fromBalooSearchUrl(url);
-    } else if (url.protocol() == "filenamesearch") {
-        const QMap<QString, QString>& queryItems = url.queryItems();
-        setText(queryItems.value("search"));
-        setSearchPath(queryItems.value("url"));
-        m_contentButton->setChecked(queryItems.value("checkContent") == "yes");
+    } else if (url.scheme() == "filenamesearch") {
+        setText(url.queryItemValue("search"));
+        setSearchPath(url.queryItemValue("url"));
+        m_contentButton->setChecked(url.queryItemValue("checkContent") == "yes");
     } else {
         setText(QString());
         setSearchPath(url);
@@ -449,7 +448,7 @@ void DolphinSearchBox::init()
     updateFacetsToggleButton();
 }
 
-KUrl DolphinSearchBox::balooUrlForSearching() const
+QUrl DolphinSearchBox::balooUrlForSearching() const
 {
 #ifdef HAVE_BALOO
     const QString text = m_searchInput->text();
@@ -483,11 +482,11 @@ KUrl DolphinSearchBox::balooUrlForSearching() const
     return query.toSearchUrl(i18nc("@title UDS_DISPLAY_NAME for a KIO directory listing. %1 is the query the user entered.",
                                    "Query Results from '%1'", text));
 #else
-    return KUrl();
+    return QUrl();
 #endif
 }
 
-void DolphinSearchBox::fromBalooSearchUrl(const KUrl& url)
+void DolphinSearchBox::fromBalooSearchUrl(const QUrl& url)
 {
 #ifdef HAVE_BALOO
     const Baloo::Query query = Baloo::Query::fromSearchUrl(url);
index 16a6ec0c102ab00ccbc8b2211f8ba3678cd7b1c0..2de4c457c4a1c257cfac2d147c8c2fa564c8a90f 100644 (file)
@@ -20,7 +20,7 @@
 #ifndef DOLPHINSEARCHBOX_H
 #define DOLPHINSEARCHBOX_H
 
-#include <KUrl>
+#include <QUrl>
 #include <QWidget>
 
 #include <config-baloo.h>
@@ -71,17 +71,17 @@ public:
      * Sets the current path that is used as root for
      * searching files, if "From Here" has been selected.
      */
-    void setSearchPath(const KUrl& url);
-    KUrl searchPath() const;
+    void setSearchPath(const QUrl& url);
+    QUrl searchPath() const;
 
     /** @return URL that will start the searching of files. */
-    KUrl urlForSearching() const;
+    QUrl urlForSearching() const;
 
     /**
      * Extracts information from the given search \a url to
      * initialize the search box properly.
      */
-    void fromSearchUrl(const KUrl& url);
+    void fromSearchUrl(const QUrl& url);
 
     /**
      * Selects the whole text of the search box.
@@ -155,13 +155,13 @@ private:
     /**
      * @return URL that represents the Baloo query for starting the search.
      */
-    KUrl balooUrlForSearching() const;
+    QUrl balooUrlForSearching() const;
 
     /**
      * Extracts information from the given Baloo search \a url to
      * initialize the search box properly.
      */
-    void fromBalooSearchUrl(const KUrl& url);
+    void fromBalooSearchUrl(const QUrl& url);
 
     void updateFacetsToggleButton();
 private:
@@ -186,7 +186,7 @@ private:
     QToolButton* m_facetsToggleButton;
     DolphinFacetsWidget* m_facetsWidget;
 
-    KUrl m_searchPath;
+    QUrl m_searchPath;
 
     QTimer* m_startSearchTimer;
 };
index d33d4430f36038c8b61545e2e9fa04e6b1b40a1d..591966759975aef87ba86c0409225e96e591434a 100644 (file)
@@ -23,7 +23,7 @@
 #include "applyviewpropsjob.h"
 #include <views/viewproperties.h>
 
-ApplyViewPropsJob::ApplyViewPropsJob(const KUrl& dir,
+ApplyViewPropsJob::ApplyViewPropsJob(const QUrl& dir,
                                      const ViewProperties& viewProps) :
     KIO::Job(),
     m_viewProps(0),
@@ -56,8 +56,9 @@ void ApplyViewPropsJob::slotEntries(KIO::Job*, const KIO::UDSEntryList& list)
         if (name != QLatin1String(".") && name != QLatin1String("..") && entry.isDir()) {
             ++m_progress;
 
-            KUrl url(m_dir);
-            url.addPath(name);
+            QUrl url(m_dir);
+            url = url.adjusted(QUrl::StripTrailingSlash);
+            url.setPath(url.path() + '/' + name);
 
             Q_ASSERT(m_viewProps);
 
index 1d817fe5690fad88547a08ca5cb9e13362201cf8..297adb823fa6d56fef6943163af6a38c5ba9de0d 100644 (file)
@@ -24,7 +24,7 @@
 #define APPLYVIEWPROPSJOB_H
 
 #include <KIO/Job>
-#include <KUrl>
+#include <QUrl>
 
 class ViewProperties;
 
@@ -59,7 +59,7 @@ public:
      * @param viewProps View properties for the directory \a dir including its
      *                  sub directories.
      */
-    ApplyViewPropsJob(const KUrl& dir, const ViewProperties& viewProps);
+    ApplyViewPropsJob(const QUrl& dir, const ViewProperties& viewProps);
     virtual ~ApplyViewPropsJob();
     int progress() const;
 
@@ -71,7 +71,7 @@ private:
     ViewProperties* m_viewProps;
     int m_currentItem;
     int m_progress;
-    KUrl m_dir;
+    QUrl m_dir;
 };
 
 inline int ApplyViewPropsJob::progress() const
index 849a9c75c485d183d7139e855f248506a0459887..de7bbf878b3d3ab23574a86390f8f8cc73399df2 100644 (file)
@@ -5,7 +5,7 @@
       xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0
       http://www.kde.org/standards/kcfg/1.0/kcfg.xsd">
     <include>QDir</include>
-    <include>KUrl</include>
+    <include>QUrl</include>
     <include>kglobalsettings.h</include>
     <kcfgfile name="dolphinrc"/>
     <group name="General">
@@ -31,7 +31,7 @@
         </entry>
         <entry name="HomeUrl" type="String">
             <label>Home URL</label>
-            <default code="true">KUrl(QDir::homePath()).prettyUrl()</default>
+            <default code="true">QUrl::fromLocalFile(QDir::homePath()).toDisplayString(QUrl::PreferLocalFile)</default>
         </entry>
         <entry name="SplitView" type="Bool">
             <label>Split the view into two panes</label>
index 678ef7b8ed9b9f80ad4c81aec8c41acc7abc3f7a..d9240d97c347b57df46b8a3abd22904f8ea8ec23 100644 (file)
@@ -36,7 +36,7 @@
 #include <QPushButton>
 #include <QDialogButtonBox>
 
-DolphinSettingsDialog::DolphinSettingsDialog(const KUrl& url, QWidget* parent) :
+DolphinSettingsDialog::DolphinSettingsDialog(const QUrl& url, QWidget* parent) :
     KPageDialog(parent),
     m_pages()
 
index 56d924c7d2640f1ea5c53349a0c532cc979936da..93f714799bc9a5bc190ba9ddd32266457c0533fd 100644 (file)
@@ -23,7 +23,7 @@
 
 #include <kpagedialog.h>
 
-class KUrl;
+class QUrl;
 class SettingsPageBase;
 
 /**
@@ -36,7 +36,7 @@ class DolphinSettingsDialog : public KPageDialog
     Q_OBJECT
 
 public:
-    explicit DolphinSettingsDialog(const KUrl& url, QWidget* parent = 0);
+    explicit DolphinSettingsDialog(const QUrl& url, QWidget* parent = 0);
     virtual ~DolphinSettingsDialog();
 
 signals:
index 8d3e0ffb5d580bc60a1e586f50a0b305dbef69a3..f311b1a3cd0a61a8557d0be8a5202e151a5d934d 100644 (file)
@@ -31,7 +31,7 @@
 
 #include <views/viewproperties.h>
 
-BehaviorSettingsPage::BehaviorSettingsPage(const KUrl& url, QWidget* parent) :
+BehaviorSettingsPage::BehaviorSettingsPage(const QUrl& url, QWidget* parent) :
     SettingsPageBase(parent),
     m_url(url),
     m_localViewProps(0),
index 2221862e000a3bcf34b239d6f85efdd1fb171eb3..71ee2849acc0536bfe8b9db8d00099ebdebcb7d6 100644 (file)
@@ -21,7 +21,7 @@
 #define BEHAVIORSETTINGSPAGE_H
 
 #include <settings/settingspagebase.h>
-#include <KUrl>
+#include <QUrl>
 
 class QCheckBox;
 class QLabel;
@@ -35,7 +35,7 @@ class BehaviorSettingsPage : public SettingsPageBase
     Q_OBJECT
 
 public:
-    BehaviorSettingsPage(const KUrl& url, QWidget* parent);
+    BehaviorSettingsPage(const QUrl &url, QWidget* parent);
     virtual ~BehaviorSettingsPage();
 
     /** @see SettingsPageBase::applySettings() */
@@ -48,7 +48,7 @@ private:
     void loadSettings();
 
 private:
-    KUrl m_url;
+    QUrl m_url;
 
     QRadioButton* m_localViewProps;
     QRadioButton* m_globalViewProps;
index f749c33ce1775da4769229483458aea682d6c2fc..f24b1bf22a0f0d407659355909c3cfade68fa9d5 100644 (file)
@@ -32,7 +32,7 @@
 
 #include <QVBoxLayout>
 
-GeneralSettingsPage::GeneralSettingsPage(const KUrl& url, QWidget* parent) :
+GeneralSettingsPage::GeneralSettingsPage(const QUrl& url, QWidget* parent) :
     SettingsPageBase(parent),
     m_pages()
 {
index 0d28664f5340644385f79e5147014712f370b938..245773aeef763752367abd56af9226d837312106 100644 (file)
@@ -23,7 +23,7 @@
 #include <QWidget>
 #include <settings/settingspagebase.h>
 
-class KUrl;
+class QUrl;
 class SettingsPageBase;
 
 /**
@@ -40,7 +40,7 @@ class GeneralSettingsPage : public SettingsPageBase
     Q_OBJECT
 
 public:
-    GeneralSettingsPage(const KUrl& url, QWidget* parent);
+    GeneralSettingsPage(const QUrl& url, QWidget* parent);
     virtual ~GeneralSettingsPage();
 
     /** @see SettingsPageBase::applySettings() */
index 2c436b541718d1ceb612227c4fe5b083a0322b3c..b4ca9ac2c8a377217bf1fbbe65906740050c53f8 100644 (file)
@@ -39,7 +39,7 @@
 
 #include "views/dolphinview.h"
 
-StartupSettingsPage::StartupSettingsPage(const KUrl& url, QWidget* parent) :
+StartupSettingsPage::StartupSettingsPage(const QUrl& url, QWidget* parent) :
     SettingsPageBase(parent),
     m_url(url),
     m_homeUrl(0),
@@ -117,10 +117,10 @@ void StartupSettingsPage::applySettings()
 {
     GeneralSettings* settings = GeneralSettings::self();
 
-    const KUrl url(m_homeUrl->text());
+    const QUrl url(QUrl::fromLocalFile(m_homeUrl->text()));
     KFileItem fileItem(KFileItem::Unknown, KFileItem::Unknown, url);
-    if ((url.isValid() && fileItem.isDir()) || (url.protocol() == QLatin1String("timeline"))) {
-        settings->setHomeUrl(url.prettyUrl());
+    if ((url.isValid() && fileItem.isDir()) || (url.scheme() == QLatin1String("timeline"))) {
+        settings->setHomeUrl(url.toDisplayString(QUrl::PreferLocalFile));
     } else {
         KMessageBox::error(this, i18nc("@info", "The location for the home folder is invalid or does not exist, it will not be applied."));
     }
@@ -153,31 +153,29 @@ void StartupSettingsPage::slotSettingsChanged()
 void StartupSettingsPage::selectHomeUrl()
 {
     const QString homeUrl = m_homeUrl->text();
-    KUrl url = KFileDialog::getExistingDirectoryUrl(homeUrl, this);
+    QUrl url = KFileDialog::getExistingDirectoryUrl(QUrl::fromLocalFile(homeUrl), this);
     if (!url.isEmpty()) {
-        m_homeUrl->setText(url.prettyUrl());
+        m_homeUrl->setText(url.toDisplayString(QUrl::PreferLocalFile));
         slotSettingsChanged();
     }
 }
 
 void StartupSettingsPage::useCurrentLocation()
 {
-    m_homeUrl->setText(m_url.prettyUrl());
+    m_homeUrl->setText(m_url.toDisplayString(QUrl::PreferLocalFile));
 }
 
 void StartupSettingsPage::useDefaultLocation()
 {
-    KUrl url(QDir::homePath());
-    m_homeUrl->setText(url.prettyUrl());
+    m_homeUrl->setText(QDir::homePath());
 }
 
 void StartupSettingsPage::loadSettings()
 {
-    const KUrl url(GeneralSettings::homeUrl());
-    m_homeUrl->setText(url.prettyUrl());
+    const QUrl url(QUrl::fromLocalFile(GeneralSettings::homeUrl()));
+    m_homeUrl->setText(url.toDisplayString(QUrl::PreferLocalFile));
     m_splitView->setChecked(GeneralSettings::splitView());
     m_editableUrl->setChecked(GeneralSettings::editableUrl());
     m_showFullPath->setChecked(GeneralSettings::showFullPath());
     m_filterBar->setChecked(GeneralSettings::filterBar());
 }
-
index 29cdc6300ce1ec1fe210b3893b205f013eea7836..d8b15cf5b17ca5ac05f8e904dd83a55865579d09 100644 (file)
@@ -20,7 +20,7 @@
 #define STARTUPSETTINGSPAGE_H
 
 #include <settings/settingspagebase.h>
-#include <KUrl>
+#include <QUrl>
 
 class KLineEdit;
 class QCheckBox;
@@ -36,7 +36,7 @@ class StartupSettingsPage : public SettingsPageBase
     Q_OBJECT
 
 public:
-    StartupSettingsPage(const KUrl& url, QWidget* parent);
+    StartupSettingsPage(const QUrl& url, QWidget* parent);
     virtual ~StartupSettingsPage();
 
     /** @see SettingsPageBase::applySettings() */
@@ -55,7 +55,7 @@ private:
     void loadSettings();
 
 private:
-    KUrl m_url;
+    QUrl m_url;
     KLineEdit* m_homeUrl;
 
     QCheckBox* m_splitView;
index 2e0b172b934803b301b8b9191b760dd02b572504..338a1427728140b2e96e59cfdf21701513fa233e 100644 (file)
@@ -32,7 +32,7 @@
 #include <KLocalizedString>
 #include <KIO/NetAccess>
 #include <KMessageBox>
-#include <KUrl>
+#include <QUrl>
 #include <KComboBox>
 
 #include <QButtonGroup>
@@ -69,7 +69,7 @@ ViewPropertiesDialog::ViewPropertiesDialog(DolphinView* dolphinView) :
     setCaption(i18nc("@title:window", "View Properties"));
     setButtons(KDialog::Ok | KDialog::Cancel | KDialog::Apply);
 
-    const KUrl& url = dolphinView->url();
+    const QUrl& url = dolphinView->url();
     m_viewProps = new ViewProperties(url);
     m_viewProps->setAutoSaveEnabled(false);
 
index 091003416ed9db72d46c23472401e2b5dee97eba..9ce3d2de491dbb26f6c211535d893c9015da6199 100644 (file)
@@ -32,7 +32,7 @@
 #include <views/viewproperties.h>
 
 ViewPropsProgressInfo::ViewPropsProgressInfo(QWidget* parent,
-                                             const KUrl& dir,
+                                             const QUrl& dir,
                                              const ViewProperties& viewProps) :
     KDialog(parent),
     m_dir(dir),
index 6f8c763c3df911dc45c0641eb1822cdc738ee5d5..7522cf84c5549458773eaa7893e7798b9c43965c 100644 (file)
@@ -22,7 +22,7 @@
 
 #include <KDialog>
 #include <kio/directorysizejob.h>
-#include <KUrl>
+#include <QUrl>
 
 class ApplyViewPropsJob;
 class QLabel;
@@ -50,7 +50,7 @@ public:
      *                  sub directories.
      */
     ViewPropsProgressInfo(QWidget* parent,
-                          const KUrl& dir,
+                          const QUrl& dir,
                           const ViewProperties& viewProps);
 
     virtual ~ViewPropsProgressInfo();
@@ -64,7 +64,7 @@ private slots:
     void cancelApplying();
 
 private:
-    KUrl m_dir;
+    QUrl m_dir;
     ViewProperties* m_viewProps;
 
     QLabel* m_label;
index c5d7b45f64700f9b2978bec742de1cea272fec9a..166f6ab14411efb0aec163609807b2b2723b5aca 100644 (file)
@@ -228,12 +228,12 @@ QString DolphinStatusBar::defaultText() const
     return m_defaultText;
 }
 
-void DolphinStatusBar::setUrl(const KUrl& url)
+void DolphinStatusBar::setUrl(const QUrl& url)
 {
     m_spaceInfo->setUrl(url);
 }
 
-KUrl DolphinStatusBar::url() const
+QUrl DolphinStatusBar::url() const
 {
     return m_spaceInfo->url();
 }
index 4d6dbb20fb2b526f397d547621388333448995e9..7ceb2acf87406462df1022c6a0951e96695c03a7 100644 (file)
@@ -23,7 +23,7 @@
 #include <QTime>
 #include <QWidget>
 
-class KUrl;
+class QUrl;
 class StatusBarSpaceInfo;
 class QLabel;
 class QProgressBar;
@@ -79,7 +79,7 @@ public:
     void setDefaultText(const QString& text);
     QString defaultText() const;
 
-    KUrl url() const;
+    QUrl url() const;
     int zoomLevel() const;
 
     /**
@@ -89,7 +89,7 @@ public:
 
 public slots:
     void setText(const QString& text);
-    void setUrl(const KUrl& url);
+    void setUrl(const QUrl& url);
     void setZoomLevel(int zoomLevel);
 
 signals:
index 10efdd7fb69d53b499a890a9aee43947c26221dc..0fb018727c5e7ea68d583c4f633621c886ab3b26 100644 (file)
@@ -21,9 +21,9 @@
 
 #include "mountpointobserver.h"
 
-#include <KUrl>
+#include <QUrl>
 
-SpaceInfoObserver::SpaceInfoObserver(const KUrl& url, QObject* parent) :
+SpaceInfoObserver::SpaceInfoObserver(const QUrl& url, QObject* parent) :
     QObject(parent),
     m_mountPointObserver(0),
     m_dataSize(0),
@@ -53,7 +53,7 @@ quint64 SpaceInfoObserver::available() const
     return m_dataAvailable;
 }
 
-void SpaceInfoObserver::setUrl(const KUrl& url)
+void SpaceInfoObserver::setUrl(const QUrl& url)
 {
     MountPointObserver* newObserver = MountPointObserver::observerForUrl(url);
     if (newObserver != m_mountPointObserver) {
index 68c559ec9ecff91c1cb949d5cb5014f52a0bc95b..e1311abde592aefcbe222085d25f17250dcb6396 100644 (file)
@@ -24,7 +24,7 @@
 
 #include <KIO/Job>
 
-class KUrl;
+class QUrl;
 class MountPointObserver;
 
 class SpaceInfoObserver : public QObject
@@ -32,13 +32,13 @@ class SpaceInfoObserver : public QObject
     Q_OBJECT
 
 public:
-    explicit SpaceInfoObserver(const KUrl& url, QObject* parent = 0);
+    explicit SpaceInfoObserver(const QUrl& url, QObject* parent = 0);
     virtual ~SpaceInfoObserver();
 
     quint64 size() const;
     quint64 available() const;
 
-    void setUrl(const KUrl& url);
+    void setUrl(const QUrl& url);
 
 signals:
     /**
index 1c904830474b6bdc139ae6a6cfebc3740b3d6376..046cbbb23072648aece5677defb1b9074baa9482 100644 (file)
@@ -36,7 +36,7 @@ StatusBarSpaceInfo::~StatusBarSpaceInfo()
 {
 }
 
-void StatusBarSpaceInfo::setUrl(const KUrl& url)
+void StatusBarSpaceInfo::setUrl(const QUrl& url)
 {
     if (m_url != url) {
         m_url = url;
@@ -46,7 +46,7 @@ void StatusBarSpaceInfo::setUrl(const KUrl& url)
     }
 }
 
-KUrl StatusBarSpaceInfo::url() const
+QUrl StatusBarSpaceInfo::url() const
 {
     return m_url;
 }
index 597d91ef629ef42dcde4b0ec4c2272f908f4a89f..48313a81c595375dea1b53d5ba289f65d1e56305 100644 (file)
@@ -20,7 +20,7 @@
 #ifndef STATUSBARSPACEINFO_H
 #define STATUSBARSPACEINFO_H
 
-#include <KUrl>
+#include <QUrl>
 
 
 #include <kcapacitybar.h>
@@ -42,8 +42,8 @@ public:
     explicit StatusBarSpaceInfo(QWidget* parent = 0);
     virtual ~StatusBarSpaceInfo();
 
-    void setUrl(const KUrl& url);
-    KUrl url() const;
+    void setUrl(const QUrl& url);
+    QUrl url() const;
 
 protected:
     void showEvent(QShowEvent* event);
@@ -54,7 +54,7 @@ private slots:
 
 private:
     QScopedPointer<SpaceInfoObserver> m_observer;
-    KUrl m_url;
+    QUrl m_url;
 };
 
 #endif
index 2e942222cb67d88da701e3d8d245b23072c66f8b..0da1137c40afb5200fba1e9b79338467727bbda8 100644 (file)
@@ -322,8 +322,7 @@ KFileItemList KFileItemModelBenchmark::createFileItemList(const QStringList& fil
 
     KFileItemList result;
     foreach (const QString& name, fileNames) {
-        const KUrl url(prefix + name);
-        const KFileItem item(url, QString(), KFileItem::Unknown);
+        const KFileItem item(QUrl::fromLocalFile(prefix + name), QString(), KFileItem::Unknown);
         result << item;
     }
     return result;
index 8938e6082acf2b70353a7803c21135f55e3fb86f..dcc4c87a5dc3f3c5fff090d9807873ef52bc75f3 100644 (file)
@@ -36,9 +36,9 @@ TestDir::~TestDir()
 {
 }
 
-KUrl TestDir::url() const
+QUrl TestDir::url() const
 {
-    return KUrl(name());
+    return QUrl::fromLocalFile(name());
 }
 
 /** The following function is taken from kdelibs/kio/tests/kiotesthelper.h, copyright (C) 2006 by David Faure */
index 0d3c5dd8d36ec68bd58ee1eeb31b544d2cd73e73..24c4d77b0b4d2691fcd5e2df775fb25745123161 100644 (file)
@@ -21,7 +21,7 @@
 #define TESTDIR_H
 
 #include <KTempDir>
-#include <KUrl>
+#include <QUrl>
 
 #include <QDateTime>
 
@@ -36,7 +36,7 @@ public:
     TestDir(const QString& directoryPrefix = QString());
     virtual ~TestDir();
 
-    KUrl url() const;
+    QUrl url() const;
 
     /**
      * The following functions create either a file, a list of files, or a directory.
index 3b5fbcd71948c32496ce9b6907c04fe51b66626a..fbf21c08f1c03edcb7ee31cd73d43032606b7727 100644 (file)
@@ -75,10 +75,10 @@ void DolphinRemoteEncoding::loadSettings()
 
 void DolphinRemoteEncoding::slotAboutToOpenUrl()
 {
-    KUrl oldURL = m_currentURL;
+    QUrl oldURL = m_currentURL;
     m_currentURL = m_actionHandler->currentView()->url();
 
-    if (m_currentURL.protocol() != oldURL.protocol()) {
+    if (m_currentURL.scheme() != oldURL.scheme()) {
         // This plugin works on ftp, fish, etc.
         // everything whose type is T_FILESYSTEM except for local files
         if (!m_currentURL.isLocalFile() &&
@@ -167,7 +167,7 @@ void DolphinRemoteEncoding::slotItemSelected(QAction* action)
     if (action) {
         int id = action->data().toInt();
 
-        KConfig config(("kio_" + m_currentURL.protocol() + "rc").toLatin1());
+        KConfig config(("kio_" + m_currentURL.scheme() + "rc").toLatin1());
         QString host = m_currentURL.host();
         if (m_menu->menu()->actions().at(id)->isChecked()) {
             QString charset = KCharsets::charsets()->encodingForName(m_encodingDescriptions.at(id));
@@ -185,7 +185,7 @@ void DolphinRemoteEncoding::slotDefault()
 {
     // We have no choice but delete all higher domain level
     // settings here since it affects what will be matched.
-    KConfig config(("kio_" + m_currentURL.protocol() + "rc").toLatin1());
+    KConfig config(("kio_" + m_currentURL.scheme() + "rc").toLatin1());
 
     QStringList partList = m_currentURL.host().split('.', QString::SkipEmptyParts);
     if (!partList.isEmpty()) {
index 8dec518d0560142c98de1f8fa252497b4cdee9f5..0351abad7f468fc90c7b2a51a06e216295df0baf 100644 (file)
@@ -22,7 +22,7 @@
 
 #include <QStringList>
 #include <QAction>
-#include <KUrl>
+#include <QUrl>
 #include "libdolphin_export.h"
 
 
@@ -59,7 +59,7 @@ private:
 
   KActionMenu* m_menu;
   QStringList m_encodingDescriptions;
-  KUrl m_currentURL;
+  QUrl m_currentURL;
   DolphinViewActionHandler* m_actionHandler;
 
   bool m_loaded;
index 0b3209aee7af48353647dfb0ee9671d6681ce2d6..f35c9e6ca60868867b0719e5668f2225a589c732 100644 (file)
@@ -57,7 +57,7 @@
 #include <KMessageBox>
 #include <KJobWidgets>
 #include <konq_operations.h>
-#include <KUrl>
+#include <QUrl>
 
 #include "dolphinnewfilemenuobserver.h"
 #include "dolphin_detailsmodesettings.h"
@@ -293,7 +293,7 @@ void DolphinView::setHiddenFilesShown(bool show)
 
     const KFileItemList itemList = selectedItems();
     m_selectedUrls.clear();
-    m_selectedUrls = KUrl::List(itemList.urlList());
+    m_selectedUrls = itemList.urlList();
 
     ViewProperties props(viewPropertiesUrl());
     props.setHiddenFilesShown(show);
@@ -470,7 +470,7 @@ void DolphinView::reload()
 
     const KFileItemList itemList = selectedItems();
     m_selectedUrls.clear();
-    m_selectedUrls = KUrl::List(itemList.urlList());
+    m_selectedUrls = itemList.urlList();
 
     setUrl(url());
     loadDirectory(url(), true);
@@ -591,7 +591,7 @@ QList<QAction*> DolphinView::versionControlActions(const KFileItemList& items) c
     return actions;
 }
 
-void DolphinView::setUrl(const KUrl& url)
+void DolphinView::setUrl(const QUrl& url)
 {
     if (url == m_url) {
         return;
@@ -667,12 +667,12 @@ void DolphinView::renameSelectedItems()
 
 void DolphinView::trashSelectedItems()
 {
-    const KUrl::List list = simplifiedSelectedUrls();
+    const QList<QUrl> list = simplifiedSelectedUrls();
     KIO::JobUiDelegate uiDelegate;
     uiDelegate.setWindow(window());
     if (uiDelegate.askDeleteConfirmation(list, KIO::JobUiDelegate::Trash, KIO::JobUiDelegate::DefaultConfirmation)) {
         KIO::Job* job = KIO::trash(list);
-        KIO::FileUndoManager::self()->recordJob(KIO::FileUndoManager::Trash, list, KUrl("trash:/"), job);
+        KIO::FileUndoManager::self()->recordJob(KIO::FileUndoManager::Trash, list, QUrl("trash:/"), job);
         KJobWidgets::setWindow(job, this);
         connect(job, &KIO::Job::result,
                 this, &DolphinView::slotTrashFileFinished);
@@ -681,7 +681,7 @@ void DolphinView::trashSelectedItems()
 
 void DolphinView::deleteSelectedItems()
 {
-    const KUrl::List list = simplifiedSelectedUrls();
+    const QList<QUrl> list = simplifiedSelectedUrls();
 
     KIO::JobUiDelegate uiDelegate;
     uiDelegate.setWindow(window());
@@ -819,7 +819,7 @@ void DolphinView::slotItemsActivated(const KItemSet& indexes)
 
     foreach (int index, indexes) {
         KFileItem item = m_model->fileItem(index);
-        const KUrl& url = openItemAsFolderUrl(item);
+        const QUrl& url = openItemAsFolderUrl(item);
 
         if (!url.isEmpty()) { // Open folders in new tabs
             emit tabRequested(url);
@@ -838,7 +838,7 @@ void DolphinView::slotItemsActivated(const KItemSet& indexes)
 void DolphinView::slotItemMiddleClicked(int index)
 {
     const KFileItem& item = m_model->fileItem(index);
-    const KUrl& url = openItemAsFolderUrl(item);
+    const QUrl& url = openItemAsFolderUrl(item);
     if (!url.isEmpty()) {
         emit tabRequested(url);
     } else if (isTabsForFilesEnabled()) {
@@ -1021,7 +1021,7 @@ void DolphinView::slotItemUnhovered(int index)
 
 void DolphinView::slotItemDropEvent(int index, QGraphicsSceneDragDropEvent* event)
 {
-    KUrl destUrl;
+    QUrl destUrl;
     KFileItem destItem = m_model->fileItem(index);
     if (destItem.isNull() || (!destItem.isDir() && !destItem.isDesktopFile())) {
         // Use the URL of the view as drop target if the item is no directory
@@ -1198,10 +1198,10 @@ void DolphinView::saveState(QDataStream& stream)
     if (currentIndex != -1) {
         KFileItem item = m_model->fileItem(currentIndex);
         Q_ASSERT(!item.isNull()); // If the current index is valid a item must exist
-        KUrl currentItemUrl = item.url();
+        QUrl currentItemUrl = item.url();
         stream << currentItemUrl;
     } else {
-        stream << KUrl();
+        stream << QUrl();
     }
 
     // Save view position
@@ -1228,13 +1228,13 @@ QString DolphinView::viewPropertiesContext() const
     return m_viewPropertiesContext;
 }
 
-KUrl DolphinView::openItemAsFolderUrl(const KFileItem& item, const bool browseThroughArchives)
+QUrl DolphinView::openItemAsFolderUrl(const KFileItem& item, const bool browseThroughArchives)
 {
     if (item.isNull()) {
-        return KUrl();
+        return QUrl();
     }
 
-    KUrl url = item.targetUrl();
+    QUrl url = item.targetUrl();
 
     if (item.isDir()) {
         return url;
@@ -1251,7 +1251,7 @@ KUrl DolphinView::openItemAsFolderUrl(const KFileItem& item, const bool browseTh
             // open OpenDocument files as zip folders...
             const QString& protocol = KProtocolManager::protocolForArchiveMimetype(mimetype);
             if (!protocol.isEmpty()) {
-                url.setProtocol(protocol);
+                url.setScheme(protocol);
                 return url;
             }
         }
@@ -1268,7 +1268,7 @@ KUrl DolphinView::openItemAsFolderUrl(const KFileItem& item, const bool browseTh
         }
     }
 
-    return KUrl();
+    return QUrl();
 }
 
 void DolphinView::observeCreatedItem(const QUrl& url)
@@ -1484,12 +1484,12 @@ void DolphinView::slotRoleEditingFinished(int index, const QByteArray& role, con
         const KFileItem oldItem = m_model->fileItem(index);
         const QString newName = value.toString();
         if (!newName.isEmpty() && newName != oldItem.text() && newName != QLatin1String(".") && newName != QLatin1String("..")) {
-            const KUrl oldUrl = oldItem.url();
+            const QUrl oldUrl = oldItem.url();
 
             QUrl newUrl = oldUrl.adjusted(QUrl::RemoveFilename);
             newUrl.setPath(newUrl.path() + KIO::encodeFileName(newName));
 
-            const bool newNameExistsAlready = (m_model->index(KUrl(newUrl)) >= 0);
+            const bool newNameExistsAlready = (m_model->index(newUrl) >= 0);
             if (!newNameExistsAlready) {
                 // Only change the data in the model if no item with the new name
                 // is in the model yet. If there is an item with the new name
@@ -1515,10 +1515,10 @@ void DolphinView::slotRoleEditingFinished(int index, const QByteArray& role, con
     }
 }
 
-void DolphinView::loadDirectory(const KUrl& url, bool reload)
+void DolphinView::loadDirectory(const QUrl& url, bool reload)
 {
     if (!url.isValid()) {
-        const QString location(url.pathOrUrl());
+        const QString location(url.toDisplayString(QUrl::PreferLocalFile));
         if (location.isEmpty()) {
             emit errorMessage(i18nc("@info:status", "The location is empty."));
         } else {
@@ -1644,7 +1644,7 @@ void DolphinView::applyModeToView()
     }
 }
 
-void DolphinView::pasteToUrl(const KUrl& url)
+void DolphinView::pasteToUrl(const QUrl& url)
 {
     KonqOperations* op = KonqOperations::doPaste(this, url);
     if (op) {
@@ -1654,9 +1654,9 @@ void DolphinView::pasteToUrl(const KUrl& url)
     }
 }
 
-KUrl::List DolphinView::simplifiedSelectedUrls() const
+QList<QUrl> DolphinView::simplifiedSelectedUrls() const
 {
-    KUrl::List urls;
+    QList<QUrl> urls;
 
     const KFileItemList items = selectedItems();
     foreach (const KFileItem& item, items) {
@@ -1699,15 +1699,14 @@ void DolphinView::updateWritableState()
     }
 }
 
-KUrl DolphinView::viewPropertiesUrl() const
+QUrl DolphinView::viewPropertiesUrl() const
 {
     if (m_viewPropertiesContext.isEmpty()) {
         return m_url;
     }
 
-    KUrl url;
-    url.setProtocol(m_url.protocol());
+    QUrl url;
+    url.setScheme(m_url.scheme());
     url.setPath(m_viewPropertiesContext);
     return url;
 }
-
index 9435206d90a477c26c794972ad236fec3c2192fa..17add7420d19def934db895f61f054cf0af7bd44 100644 (file)
@@ -29,8 +29,8 @@
 #include <KFileItem>
 #include <kio/fileundomanager.h>
 #include <KIO/Job>
-#include <KUrl>
-
+#include <QUrl>
+#include <QMimeData>
 #include <QWidget>
 
 typedef KIO::FileUndoManager::CommandType CommandType;
@@ -40,7 +40,6 @@ class KFileItemModel;
 class KItemListContainer;
 class KItemModelBase;
 class KItemSet;
-class KUrl;
 class ToolTipManager;
 class VersionControlObserver;
 class ViewProperties;
@@ -304,14 +303,14 @@ public:
      * @return a valid and adjusted url if the item can be opened as folder,
      * otherwise return an empty url.
      */
-    static KUrl openItemAsFolderUrl(const KFileItem& item, const bool browseThroughArchives = true);
+    static QUrl openItemAsFolderUrl(const KFileItem& item, const bool browseThroughArchives = true);
 
 public slots:
     /**
      * Changes the directory to \a url. If the current directory is equal to
      * \a url, nothing will be done (use DolphinView::reload() instead).
      */
-    void setUrl(const KUrl& url);
+    void setUrl(const QUrl& url);
 
     /**
      * Selects all items.
@@ -379,10 +378,10 @@ signals:
      * After the URL has been changed the signal urlChanged() will
      * be emitted.
      */
-    void urlAboutToBeChanged(const KUrl& url);
+    void urlAboutToBeChanged(const QUrl& url);
 
     /** Is emitted if the URL of the view has been changed to \a url. */
-    void urlChanged(const KUrl& url);
+    void urlChanged(const QUrl& url);
 
     /**
      * Is emitted when clicking on an item with the left mouse button.
@@ -403,7 +402,7 @@ signals:
     /**
      * Is emitted if a new tab should be opened for the URL \a url.
      */
-    void tabRequested(const KUrl& url);
+    void tabRequested(const QUrl& url);
 
     /**
      * Is emitted if the view mode (IconsView, DetailsView,
@@ -458,7 +457,7 @@ signals:
      */
     void requestContextMenu(const QPoint& pos,
                             const KFileItem& item,
-                            const KUrl& url,
+                            const QUrl& url,
                             const QList<QAction*>& customActions);
 
     /**
@@ -515,13 +514,13 @@ signals:
      * Emitted when the file-item-model emits redirection.
      * Testcase: fish://localhost
      */
-    void redirection(const KUrl& oldUrl, const KUrl& newUrl);
+    void redirection(const QUrl& oldUrl, const QUrl& newUrl);
 
     /**
      * Is emitted when the URL set by DolphinView::setUrl() represents a file.
      * In this case no signal errorMessage() will be emitted.
      */
-    void urlIsFileError(const KUrl& url);
+    void urlIsFileError(const QUrl& url);
 
     /**
      * Is emitted when the write state of the folder has been changed. The application
@@ -696,7 +695,7 @@ private slots:
     void calculateItemCount(int& fileCount, int& folderCount, KIO::filesize_t& totalFileSize) const;
 
 private:
-    void loadDirectory(const KUrl& url, bool reload = false);
+    void loadDirectory(const QUrl& url, bool reload = false);
 
     /**
      * Applies the view properties which are defined by the current URL
@@ -721,14 +720,14 @@ private:
      * Helper method for DolphinView::paste() and DolphinView::pasteIntoFolder().
      * Pastes the clipboard data into the URL \a url.
      */
-    void pasteToUrl(const KUrl& url);
+    void pasteToUrl(const QUrl& url);
 
     /**
      * Returns a list of URLs for all selected items. The list is
      * simplified, so that when the URLs are part of different tree
      * levels, only the parent is returned.
      */
-    KUrl::List simplifiedSelectedUrls() const;
+    QList<QUrl> simplifiedSelectedUrls() const;
 
     /**
      * Returns the MIME data for all selected items.
@@ -747,7 +746,7 @@ private:
      *         DolphinView::viewPropertiesContext(), otherwise the context
      *         is returned.
      */
-    KUrl viewPropertiesUrl() const;
+    QUrl viewPropertiesUrl() const;
 
 private:
     bool m_active;
@@ -757,7 +756,7 @@ private:
     bool m_dragging; // True if a dragging is done. Required to be able to decide whether a
                      // tooltip may be shown when hovering an item.
 
-    KUrl m_url;
+    QUrl m_url;
     QString m_viewPropertiesContext;
     Mode m_mode;
     QList<QByteArray> m_visibleRoles;
index 84025a5f8438c594eee69ce374d736caab053860..668623c8c91ab078770ba408f2b462ff95ab72c6 100644 (file)
@@ -586,7 +586,7 @@ void DolphinViewActionHandler::slotProperties()
     KPropertiesDialog* dialog = 0;
     const KFileItemList list = m_currentView->selectedItems();
     if (list.isEmpty()) {
-        const KUrl url = m_currentView->url();
+        const QUrl url = m_currentView->url();
         dialog = new KPropertiesDialog(url, m_currentView);
     } else {
         dialog = new KPropertiesDialog(list, m_currentView);
index 0dada5e5506a3f9432107d4dd4ab71b64cd3eeb6..1f3f4ba8296da59c27670563950e2c5785c48629 100644 (file)
 #include <KFileItem>
 #include <KLocalizedString>
 #include <konq_operations.h>
-#include <KUrl>
+#include <QUrl>
 #include <QApplication>
 #include <QtDBus>
 #include <QDropEvent>
+#include <KUrlMimeData>
 
-KonqOperations* DragAndDropHelper::dropUrls(const KFileItem& destItem, const KUrl& destUrl, QDropEvent* event, QString& error)
+KonqOperations* DragAndDropHelper::dropUrls(const KFileItem& destItem, const QUrl& destUrl, QDropEvent* event, QString& error)
 {
     error.clear();
 
     if (!destItem.isNull() && !destItem.isWritable()) {
-        error = xi18nc("@info:status", "Access denied. Could not write to <filename>%1</filename>", destUrl.pathOrUrl());
+        error = xi18nc("@info:status", "Access denied. Could not write to <filename>%1</filename>",
+                       destUrl.toDisplayString(QUrl::PreferLocalFile));
         return 0;
     }
 
@@ -45,12 +47,12 @@ KonqOperations* DragAndDropHelper::dropUrls(const KFileItem& destItem, const KUr
 
         QDBusMessage message = QDBusMessage::createMethodCall(remoteDBusClient, remoteDBusPath,
                                                               "org.kde.ark.DndExtract", "extractSelectedFilesTo");
-        message.setArguments(QVariantList() << destUrl.pathOrUrl());
+        message.setArguments(QVariantList() << destUrl.toDisplayString(QUrl::PreferLocalFile));
         QDBusConnection::sessionBus().call(message);
     } else if (!destItem.isNull() && (destItem.isDir() || destItem.isDesktopFile())) {
         // Drop into a directory or a desktop-file
-        const KUrl::List urls = KUrl::List::fromMimeData(event->mimeData());
-        foreach (const KUrl& url, urls) {
+        const QList<QUrl> urls = KUrlMimeData::urlsFromMimeData(mimeData);
+        foreach (const QUrl& url, urls) {
             if (url == destUrl) {
                 error = i18nc("@info:status", "A folder cannot be dropped into itself");
                 return 0;
index a6fbb7c7f6f63c90c8ba2160602e7716842b62bc..c4ae974b50ab5e0af5eb9dc749d383a8bdadb2fa 100644 (file)
@@ -26,7 +26,7 @@
 #include <QString>
 
 class KFileItem;
-class KUrl;
+class QUrl;
 class QDropEvent;
 class KonqOperations;
 
@@ -52,7 +52,7 @@ public:
      * @return          KonqOperations pointer
      */
     static KonqOperations* dropUrls(const KFileItem& destItem,
-                                    const KUrl& destUrl,
+                                    const QUrl& destUrl,
                                     QDropEvent* event,
                                     QString& error);
 };
index ca8ef3bbc25a44429c8313ba30e40496fac2bfa5..9a1079e7f247fa73709d03cc0e8e263bdfa31131 100644 (file)
@@ -280,14 +280,14 @@ int VersionControlObserver::createItemStatesList(QMap<QString, QVector<ItemState
     }
 
     if (items.count() > 0) {
-        const KUrl& url = items.first().first.url();
-        itemStates.insert(url.directory(KUrl::AppendTrailingSlash), items);
+        const QUrl& url = items.first().first.url();
+        itemStates.insert(url.adjusted(QUrl::RemoveFilename).path(), items);
     }
 
     return index - firstIndex; // number of processed items
 }
 
-KVersionControlPlugin* VersionControlObserver::searchPlugin(const KUrl& directory) const
+KVersionControlPlugin* VersionControlObserver::searchPlugin(const QUrl& directory) const
 {
     static bool pluginsAvailable = true;
     static QList<KVersionControlPlugin*> plugins;
@@ -326,7 +326,7 @@ KVersionControlPlugin* VersionControlObserver::searchPlugin(const KUrl& director
     // Verify whether the current directory contains revision information
     // like .svn, .git, ...
     foreach (KVersionControlPlugin* plugin, plugins) {
-        const QString fileName = directory.path(KUrl::AddTrailingSlash) + plugin->fileName();
+        const QString fileName = directory.path() + plugin->fileName();
         if (QFile::exists(fileName)) {
             // The score of this plugin is 0 (best), so we can just return this plugin,
             // instead of going through the plugin scoring procedure, we can't find a better one ;)
@@ -340,11 +340,11 @@ KVersionControlPlugin* VersionControlObserver::searchPlugin(const KUrl& director
         // m_versionedDirectory. Drawback: Until e. g. Git is recognized, the root directory
         // must be shown at least once.
         if (m_versionedDirectory) {
-            KUrl dirUrl(directory);
-            KUrl upUrl = dirUrl.upUrl();
+            QUrl dirUrl(directory);
+            QUrl upUrl = KIO::upUrl(dirUrl);
             int upUrlCounter = 1;
             while ((upUrlCounter < bestScore) && (upUrl != dirUrl)) {
-                const QString fileName = dirUrl.path(KUrl::AddTrailingSlash) + plugin->fileName();
+                const QString fileName = dirUrl.path() + plugin->fileName();
                 if (QFile::exists(fileName)) {
                     if (upUrlCounter < bestScore) {
                         bestPlugin = plugin;
@@ -353,7 +353,7 @@ KVersionControlPlugin* VersionControlObserver::searchPlugin(const KUrl& director
                     break;
                 }
                 dirUrl = upUrl;
-                upUrl = dirUrl.upUrl();
+                upUrl = KIO::upUrl(dirUrl);
                 ++upUrlCounter;
             }
         }
index b9ab1342731da9ca38038af3bf4d219785d7b477..034ef8bfe37645c44a3d8e4c616ae6a76e0d21c0 100644 (file)
@@ -23,7 +23,7 @@
 #include <libdolphin_export.h>
 
 #include <KFileItem>
-#include <KUrl>
+#include <QUrl>
 #include <kversioncontrolplugin2.h>
 #include <QList>
 #include <QObject>
@@ -124,7 +124,7 @@ private:
      * Returns a matching plugin for the given directory.
      * 0 is returned, if no matching plugin has been found.
      */
-    KVersionControlPlugin* searchPlugin(const KUrl& directory) const;
+    KVersionControlPlugin* searchPlugin(const QUrl& directory) const;
 
     /**
      * Returns true, if the directory contains a version control information.
index da60668879387374fd267881bb2ebbd73ebfbe28..28f9ea472b85dc05e8843accb14d8d035b547e97 100644 (file)
@@ -33,12 +33,12 @@ ViewModeController::~ViewModeController()
 {
 }
 
-KUrl ViewModeController::url() const
+QUrl ViewModeController::url() const
 {
     return m_url;
 }
 
-void ViewModeController::redirectToUrl(const KUrl& url)
+void ViewModeController::redirectToUrl(const QUrl& url)
 {
     m_url = url;
 }
@@ -76,7 +76,7 @@ int ViewModeController::zoomLevel() const
     return m_zoomLevel;
 }
 
-void ViewModeController::setUrl(const KUrl& url)
+void ViewModeController::setUrl(const QUrl& url)
 {
     if (m_url != url) {
         m_url = url;
index f4765955b2e19362fe1c02c601f624de6cf2345a..9ea717ad34c1ae6bb258828884c953641bb67cea 100644 (file)
@@ -20,7 +20,7 @@
 #ifndef VIEWMODECONTROLLER_H
 #define VIEWMODECONTROLLER_H
 
-#include <KUrl>
+#include <QUrl>
 #include <QObject>
 #include <libdolphin_export.h>
 #include <views/dolphinview.h>
@@ -44,13 +44,13 @@ public:
     /**
      * @return URL that is shown by the view mode implementation.
      */
-    KUrl url() const;
+    QUrl url() const;
 
     /**
      * Sets the URL to \a url and does nothing else. Called when
      * a redirection happens. See ViewModeController::setUrl()
      */
-    void redirectToUrl(const KUrl& url);
+    void redirectToUrl(const QUrl& url);
 
     /**
      * Informs the view mode implementation about a change of the activation
@@ -83,13 +83,13 @@ public slots:
      * Sets the URL to \a url and emits the signals cancelPreviews() and
      * urlChanged() if \a url is different for the current URL.
      */
-    void setUrl(const KUrl& url);
+    void setUrl(const QUrl& url);
 
 signals:
     /**
      * Is emitted if the URL has been changed by ViewModeController::setUrl().
      */
-    void urlChanged(const KUrl& url);
+    void urlChanged(const QUrl& url);
 
     /**
      * Is emitted, if ViewModeController::indicateActivationChange() has been
@@ -118,7 +118,7 @@ signals:
 private:
     int m_zoomLevel;
     QString m_nameFilter;
-    KUrl m_url;
+    QUrl m_url;
 };
 
 #endif
index 100b1ad2d5d7c65307ff2227520dd43fdb435d1b..018f42d2b65c70ed8eb1c46017cfcb64c7e028c1 100644 (file)
@@ -23,7 +23,7 @@
 #include "dolphin_directoryviewpropertysettings.h"
 #include "dolphin_generalsettings.h"
 
-#include <KUrl>
+#include <QUrl>
 #include <KDebug>
 #include <KGlobal>
 
@@ -48,7 +48,7 @@ namespace {
     const char ViewPropertiesFileName[] = ".directory";
 }
 
-ViewProperties::ViewProperties(const KUrl& url) :
+ViewProperties::ViewProperties(const QUrl& url) :
     m_changedProps(false),
     m_autoSave(true),
     m_node(0)
@@ -62,10 +62,10 @@ ViewProperties::ViewProperties(const KUrl& url) :
     // we store the properties information in a local file.
     if (useGlobalViewProps) {
         m_filePath = destinationDir("global");
-    } else if (url.protocol().contains("search")) {
+    } else if (url.scheme().contains("search")) {
         m_filePath = destinationDir("search/") + directoryHashForUrl(url);
         useDetailsViewWithPath = true;
-    } else if (url.protocol() == QLatin1String("trash")) {
+    } else if (url.scheme() == QLatin1String("trash")) {
         m_filePath = destinationDir("trash");
         useDetailsViewWithPath = true;
     } else if (url.isLocalFile()) {
@@ -102,9 +102,9 @@ ViewProperties::ViewProperties(const KUrl& url) :
         } else {
             // The global view-properties act as default for directories without
             // any view-property configuration. Constructing a ViewProperties 
-            // instance for an empty KUrl ensures that the global view-properties
+            // instance for an empty QUrl ensures that the global view-properties
             // are loaded.
-            KUrl emptyUrl;
+            QUrl emptyUrl;
             ViewProperties defaultProps(emptyUrl);
             setDirProperties(defaultProps);
 
@@ -464,10 +464,9 @@ bool ViewProperties::isPartOfHome(const QString& filePath)
     return filePath.startsWith(homePath);
 }
 
-QString ViewProperties::directoryHashForUrl(const KUrl& url)
+QString ViewProperties::directoryHashForUrl(const QUrl& url)
 {
-    const QByteArray hashValue = QCryptographicHash::hash(url.prettyUrl().toLatin1(),
-                                                     QCryptographicHash::Sha1);
+    const QByteArray hashValue = QCryptographicHash::hash(url.toEncoded(), QCryptographicHash::Sha1);
     QString hashString = hashValue.toBase64();
     hashString.replace('/', '-');
     return hashString;
index d794edf655164a70926216af0dd3764880134f97..d3ea4280f1e5bcfaf6f90c2a40e0cf843439ef16 100644 (file)
@@ -22,7 +22,7 @@
 #define VIEWPROPERTIES_H
 
 #include <views/dolphinview.h>
-#include <KUrl>
+#include <QUrl>
 #include <libdolphin_export.h>
 
 class ViewPropertySettings;
@@ -35,7 +35,7 @@ class ViewPropertySettings;
  * just construct an instance by passing the path of the directory:
  *
  * \code
- * ViewProperties props(KUrl("/home/peter/Documents"));
+ * ViewProperties props(QUrl::fromLocalFile("/home/peter/Documents"));
  * const DolphinView::Mode mode = props.viewMode();
  * const bool hiddenFilesShown = props.hiddenFilesShown();
  * \endcode
@@ -50,7 +50,7 @@ class ViewPropertySettings;
 class LIBDOLPHINPRIVATE_EXPORT ViewProperties
 {
 public:
-    explicit ViewProperties(const KUrl& url);
+    explicit ViewProperties(const QUrl& url);
     virtual ~ViewProperties();
 
     void setViewMode(DolphinView::Mode mode);
@@ -162,7 +162,7 @@ private:
      * @return A hash-value for an URL that can be used as directory name.
      *         Is used to be able to remember view-properties for long baloo-URLs.
      */
-    static QString directoryHashForUrl(const KUrl& url);
+    static QString directoryHashForUrl(const QUrl &url);
 
     Q_DISABLE_COPY(ViewProperties)