Symlink Support for Dolphin Plugins (#5428)
authoroctotree <octotree@users.noreply.github.com>
Thu, 5 Jan 2017 12:24:22 +0000 (13:24 +0100)
committerMarkus Goetz <markus@woboq.com>
Thu, 5 Jan 2017 12:24:22 +0000 (13:24 +0100)
Add Symlink Support to Dolphin Overlay Plugin

shell_integration/dolphin/ownclouddolphinactionplugin.cpp
shell_integration/dolphin/ownclouddolphinoverlayplugin.cpp

index 058f5c2652a67af5590dcf93269dd2783eb556ab..dfb2bdff77adf60da6582dba9f4aba848efaf3e2 100644 (file)
@@ -24,6 +24,7 @@
 #include <KIOCore/kfileitem.h>
 #include <KIOCore/KFileItemListProperties>
 #include <QtWidgets/QAction>
+#include <QtCore/QDir>
 #include <QtCore/QTimer>
 #include "ownclouddolphinpluginhelper.h"
 
@@ -43,7 +44,8 @@ public:
         auto url = urls.first();
         if (!url.isLocalFile())
             return {};
-        auto localFile = url.toLocalFile();
+        QDir localPath(url.toLocalFile());
+        auto localFile = localPath.canonicalPath();
 
         const auto paths = helper->paths();
         if (!std::any_of(paths.begin(), paths.end(), [&](const QString &s) {
index 4d3230c81846162edf4908468f9c8e9b78e74435..56300f4dfb0527edd3cdb4c56635f232c5e46878 100644 (file)
@@ -21,6 +21,7 @@
 #include <KPluginFactory>
 #include <QtNetwork/QLocalSocket>
 #include <KIOCore/kfileitem.h>
+#include <QDir>
 #include <QTimer>
 #include "ownclouddolphinpluginhelper.h"
 
@@ -46,7 +47,8 @@ public:
             return QStringList();
         if (!url.isLocalFile())
             return QStringList();
-        const QByteArray localFile = url.toLocalFile().toUtf8();
+        QDir localPath(url.toLocalFile());
+        const QByteArray localFile = localPath.canonicalPath().toUtf8();
 
         helper->sendCommand(QByteArray("RETRIEVE_FILE_STATUS:" + localFile + "\n"));