summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDominik Haumann <dhaumann@kde.org>2016-08-21 17:42:35 (GMT)
committerDominik Haumann <dhaumann@kde.org>2016-08-21 17:42:35 (GMT)
commit5af3e012a20ad0db7ec8bb9e85335fe44bba2c30 (patch)
tree53010cc703efbddab61ec3b1941e3285778301f3
parent3586fa5a408f401714e7b40c7336ebdbe323f6dc (diff)
Tabs > "Open Containing Folder" now highlights the file in Dolphin
KDE Frameworks v5.24 is required [optional]. REVIEW: 128729
-rw-r--r--kate/kateviewspace.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/kate/kateviewspace.cpp b/kate/kateviewspace.cpp
index 2b1fd70..fb765d6 100644
--- a/kate/kateviewspace.cpp
+++ b/kate/kateviewspace.cpp
@@ -32,6 +32,11 @@
#include <KAcceleratorManager>
#include <KConfigGroup>
#include <KLocalizedString>
+// remove #ifdef, once Kate depends on KF 5.24
+#include <kio_version.h>
+#if KIO_VERSION >= QT_VERSION_CHECK(5, 24, 0)
+#include <KIO/OpenFileManagerWindowJob>
+#endif
#include <QApplication>
#include <QClipboard>
@@ -596,7 +601,11 @@ void KateViewSpace::showContextMenu(int id, const QPoint & globalPos)
} else if (choice == aCopyPath) {
QApplication::clipboard()->setText(doc->url().toDisplayString(QUrl::PreferLocalFile));
} else if (choice == aOpenFolder) {
+#if KIO_VERSION >= QT_VERSION_CHECK(5, 24, 0)
+ KIO::highlightInFileManager({doc->url()});
+#else
QDesktopServices::openUrl(doc->url().adjusted(QUrl::RemoveFilename));
+#endif
}
}