diff --git a/api/dbus/org.desktopspec.ApplicationManager1.Application.xml b/api/dbus/org.desktopspec.ApplicationManager1.Application.xml index 135a647b..a3515a0b 100644 --- a/api/dbus/org.desktopspec.ApplicationManager1.Application.xml +++ b/api/dbus/org.desktopspec.ApplicationManager1.Application.xml @@ -174,6 +174,7 @@ + diff --git a/src/dbus/applicationservice.cpp b/src/dbus/applicationservice.cpp index 61b45ccb..539703da 100644 --- a/src/dbus/applicationservice.cpp +++ b/src/dbus/applicationservice.cpp @@ -718,6 +718,11 @@ QString ApplicationService::X_CreatedBy() const noexcept return findEntryValue(DesktopFileEntryKey, "X-Created-By", EntryValueType::String).toString(); } +QString ApplicationService::desktopSourcePath() const noexcept +{ + return m_desktopSource.sourcePath(); +} + bool ApplicationService::terminal() const noexcept { auto val = findEntryValue(DesktopFileEntryKey, "Terminal", EntryValueType::String); @@ -1096,6 +1101,7 @@ void ApplicationService::resetEntry(DesktopEntry *newEntry) noexcept emit xDeepinCreatedByChanged(); emit execsChanged(); emit xCreatedByChanged(); + emit desktopSourcePathChanged(); } enum class SpliterState : uint8_t { Normal, InSingleQuote, InDoubleQuotes }; diff --git a/src/dbus/applicationservice.h b/src/dbus/applicationservice.h index ebbac183..32412d51 100644 --- a/src/dbus/applicationservice.h +++ b/src/dbus/applicationservice.h @@ -119,6 +119,9 @@ class ApplicationService : public QObject, protected QDBusContext Q_PROPERTY(QString X_CreatedBy READ X_CreatedBy NOTIFY xCreatedByChanged) [[nodiscard]] QString X_CreatedBy() const noexcept; + Q_PROPERTY(QString DesktopSourcePath READ desktopSourcePath NOTIFY desktopSourcePathChanged) + [[nodiscard]] QString desktopSourcePath() const noexcept; + [[nodiscard]] QDBusObjectPath findInstance(const QString &instanceId) const; [[nodiscard]] const QString &getLauncher() const noexcept { return m_launcher; } @@ -179,6 +182,7 @@ public Q_SLOTS: void xDeepinCreatedByChanged(); void execsChanged(); void xCreatedByChanged(); + void desktopSourcePathChanged(); private: friend class ApplicationManager1Service;