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
}
}
+void DBusInterface::SortOrderForUrl(const QString &url, QString &role, QString &order)
+{
+ QUrl qurl(url);
+ auto sort = Dolphin::sortOrderForUrl(qurl);
+ role = sort.first;
+ if (sort.second == Qt::AscendingOrder) {
+ order = QStringLiteral("ascending");
+ } else {
+ order = QStringLiteral("descending");
+ }
+}
+
void DBusInterface::setAsDaemon()
{
m_isDaemon = true;
Q_SCRIPTABLE void ShowItems(const QStringList& uriList, const QString& startUpId);
Q_SCRIPTABLE void ShowItemProperties(const QStringList& uriList, const QString& startUpId);
+ Q_SCRIPTABLE void SortOrderForUrl(const QString &url, QString &role, QString &order);
+
/**
* Set whether this interface has been created by dolphin --daemon.
*/
#include "dolphin_generalsettings.h"
#include "dolphindebug.h"
#include "dolphinmainwindowinterface.h"
+#include "views/viewproperties.h"
#include <KConfigWatcher>
#include <KDialogJobUiDelegate>
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) {
*/
QVector<QPair<QSharedPointer<OrgKdeDolphinMainWindowInterface>, QStringList>> dolphinGuiInstances(const QString& preferredService);
+ QPair<QString, Qt::SortOrder> sortOrderForUrl(QUrl &url);
+
/**
* TODO: Move this somewhere global to all KDE apps, not just Dolphin
*/