diff options
| author | Marco Martin <[email protected]> | 2021-06-04 12:04:14 +0000 |
|---|---|---|
| committer | Nate Graham <[email protected]> | 2021-06-04 12:04:14 +0000 |
| commit | dbabe22249781242c789d691c1f887046e71580e (patch) | |
| tree | f8347d9be97aa1bf26ba1d3f4dcd2bf19c9b8a6c /src/global.cpp | |
| parent | 9fcfbfb6e3b05d99e92472b78a6686e7526e77c6 (diff) | |
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
Diffstat (limited to 'src/global.cpp')
| -rw-r--r-- | src/global.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
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 <KConfigWatcher> #include <KDialogJobUiDelegate> @@ -140,6 +141,12 @@ QVector<QPair<QSharedPointer<OrgKdeDolphinMainWindowInterface>, QStringList>> Do return dolphinInterfaces; } +QPair<QString, Qt::SortOrder> Dolphin::sortOrderForUrl(QUrl &url) +{ + ViewProperties globalProps(url); + return QPair<QString, Qt::SortOrder>(globalProps.sortRole(), globalProps.sortOrder()); +} + double GlobalConfig::animationDurationFactor() { if (s_animationDurationFactor >= 0.0) { |
