X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/6072005ddce81b456fdcf2e77d5156a1d86f3686..531de16cd0703882e8972bba60c9f295c2d81277:/src/dbusinterface.cpp diff --git a/src/dbusinterface.cpp b/src/dbusinterface.cpp index cf1ad53ad..2b674b968 100644 --- a/src/dbusinterface.cpp +++ b/src/dbusinterface.cpp @@ -20,8 +20,10 @@ DBusInterface::DBusInterface() : { QDBusConnection::sessionBus().registerObject(QStringLiteral("/org/freedesktop/FileManager1"), this, QDBusConnection::ExportScriptableContents | QDBusConnection::ExportAdaptors); - QDBusConnection::sessionBus().interface()->registerService(QStringLiteral("org.freedesktop.FileManager1"), - QDBusConnectionInterface::QueueService); + QDBusConnectionInterface *sessionInterface = QDBusConnection::sessionBus().interface(); + if (sessionInterface) { + sessionInterface->registerService(QStringLiteral("org.freedesktop.FileManager1"), QDBusConnectionInterface::QueueService); + } } void DBusInterface::ShowFolders(const QStringList& uriList, const QString& startUpId) @@ -59,6 +61,18 @@ void DBusInterface::ShowItemProperties(const QStringList& uriList, const QString } } +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;