feat: add property 'NoDisplay'

Signed-off-by: ComixHe <heyuming@deepin.org>
This commit is contained in:
ComixHe 2023-09-07 12:01:08 +08:00 committed by Comix
parent 2c1f35b820
commit 55e3aa2fae
3 changed files with 15 additions and 0 deletions

View File

@ -10,6 +10,7 @@
<property name="X_linglong" type="b" access="read"/> <property name="X_linglong" type="b" access="read"/>
<property name="X_Flatpak" type="b" access="read"/> <property name="X_Flatpak" type="b" access="read"/>
<property name="installedTime" type="t" access="read"/> <property name="installedTime" type="t" access="read"/>
<property name="NoDisplay" type="b" access="read"/>
<property name="Actions" type="as" access="read"> <property name="Actions" type="as" access="read">
<annotation <annotation

View File

@ -276,6 +276,17 @@ bool ApplicationService::isOnDesktop() const noexcept
return info.symLinkTarget() == m_desktopSource.sourcePath(); return info.symLinkTarget() == m_desktopSource.sourcePath();
} }
bool ApplicationService::noDisplay() const noexcept
{
auto val = findEntryValue(DesktopFileEntryKey, "NoDisplay", EntryValueType::Boolean);
if (val.isNull()) {
return false;
}
return val.toBool();
}
QStringList ApplicationService::actions() const noexcept QStringList ApplicationService::actions() const noexcept
{ {
auto val = findEntryValue(DesktopFileEntryKey, "Actions", EntryValueType::String); auto val = findEntryValue(DesktopFileEntryKey, "Actions", EntryValueType::String);

View File

@ -76,6 +76,9 @@ public:
Q_PROPERTY(bool isOnDesktop READ isOnDesktop) Q_PROPERTY(bool isOnDesktop READ isOnDesktop)
[[nodiscard]] bool isOnDesktop() const noexcept; [[nodiscard]] bool isOnDesktop() const noexcept;
Q_PROPERTY(bool NoDisplay READ noDisplay)
[[nodiscard]] bool noDisplay() const noexcept;
[[nodiscard]] QDBusObjectPath findInstance(const QString &instanceId) const; [[nodiscard]] QDBusObjectPath findInstance(const QString &instanceId) const;
[[nodiscard]] const QString &getLauncher() const noexcept { return m_launcher; } [[nodiscard]] const QString &getLauncher() const noexcept { return m_launcher; }