From dbabe22249781242c789d691c1f887046e71580e Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Fri, 4 Jun 2021 12:04:14 +0000 Subject: Add SortOrderForUrl method to DBus interface adds a method to ask what's the sorting strategy (column and order) for a particular Url, as Dolphin can have directory-specific sorting strategies This makes possible for other apps that have lists of files, like Gwenview to use the same sorting when invoked from dolphin, ie opening an image CCBUG:236059 --- src/global.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/global.cpp') diff --git a/src/global.cpp b/src/global.cpp index 3d17a733b..197d6ec28 100644 --- a/src/global.cpp +++ b/src/global.cpp @@ -9,6 +9,7 @@ #include "dolphin_generalsettings.h" #include "dolphindebug.h" #include "dolphinmainwindowinterface.h" +#include "views/viewproperties.h" #include #include @@ -140,6 +141,12 @@ QVector, QStringList>> Do return dolphinInterfaces; } +QPair Dolphin::sortOrderForUrl(QUrl &url) +{ + ViewProperties globalProps(url); + return QPair(globalProps.sortRole(), globalProps.sortOrder()); +} + double GlobalConfig::animationDurationFactor() { if (s_animationDurationFactor >= 0.0) { -- cgit v1.3