]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/panels/folders/folderspanel.cpp
Load KFileItemAction plugins with json metadata
[dolphin.git] / src / panels / folders / folderspanel.cpp
index b83e950e5c2020ef2f9a804b9a68a850034c1828..3ad1bf3ffd6743e720578f1c11a3a08f392b4dc6 100644 (file)
@@ -49,7 +49,7 @@
 
 #include <views/draganddrophelper.h>
 
-#include <KDebug>
+#include "dolphindebug.h"
 
 FoldersPanel::FoldersPanel(QWidget* parent) :
     Panel(parent),
@@ -109,7 +109,7 @@ void FoldersPanel::rename(const KFileItem& item)
 
 bool FoldersPanel::urlChanged()
 {
-    if (!url().isValid() || url().scheme().contains("search")) {
+    if (!url().isValid() || url().scheme().contains(QStringLiteral("search"))) {
         // Skip results shown by a search, as possible identical
         // directory names are useless without parent-path information.
         return false;
@@ -208,7 +208,7 @@ void FoldersPanel::slotItemContextMenuRequested(int index, const QPointF& pos)
 
     const KFileItem fileItem = m_model->fileItem(index);
 
-    QWeakPointer<TreeViewContextMenu> contextMenu = new TreeViewContextMenu(this, fileItem);
+    QPointer<TreeViewContextMenu> contextMenu = new TreeViewContextMenu(this, fileItem);
     contextMenu.data()->open();
     if (contextMenu.data()) {
         delete contextMenu.data();
@@ -219,7 +219,7 @@ void FoldersPanel::slotViewContextMenuRequested(const QPointF& pos)
 {
     Q_UNUSED(pos);
 
-    QWeakPointer<TreeViewContextMenu> contextMenu = new TreeViewContextMenu(this, KFileItem());
+    QPointer<TreeViewContextMenu> contextMenu = new TreeViewContextMenu(this, KFileItem());
     contextMenu.data()->open();
     if (contextMenu.data()) {
         delete contextMenu.data();
@@ -274,7 +274,7 @@ void FoldersPanel::slotLoadingCompleted()
         // animations.
         // TODO: Check whether it makes sense to allow accessing the
         // view-internal delay for usecases like this.
-        QTimer::singleShot(250, this, SLOT(startFadeInAnimation()));
+        QTimer::singleShot(250, this, &FoldersPanel::startFadeInAnimation);
     }
 
     if (!m_updateCurrentItem) {
@@ -305,7 +305,7 @@ void FoldersPanel::loadTree(const QUrl& url)
     QUrl baseUrl;
     if (url.isLocalFile()) {
         // Use the root directory as base for local URLs (#150941)
-        baseUrl = QDir::rootPath();
+        baseUrl = QUrl::fromLocalFile(QDir::rootPath());
     } else {
         // Clear the path for non-local URLs and use it as base
         baseUrl = url;