]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/panels/folders/treeviewcontextmenu.cpp
port Dolphin from KUrl to QUrl
[dolphin.git] / src / panels / folders / treeviewcontextmenu.cpp
index 56e6d44b39963179e4c74746ef28fd0dfa22dd47..4afe9e8e39360b235413a5e9cdee07393faaa344 100644 (file)
@@ -21,7 +21,6 @@
 #include "treeviewcontextmenu.h"
 
 #include <KFileItem>
-#include <KIconLoader>
 #include <KIO/CopyJob>
 #include <KIO/DeleteJob>
 #include <KIO/JobUiDelegate>
@@ -33,7 +32,7 @@
 #include <kurlmimedata.h>
 #include <KFileItemListProperties>
 #include <konq_operations.h>
-#include <KLocale>
+#include <KLocalizedString>
 #include <KIO/Paste>
 #include <KIO/FileUndoManager>
 #include <KPropertiesDialog>
@@ -93,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);
@@ -156,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);
@@ -191,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);
     }
@@ -204,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)) {