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

@ -276,6 +276,17 @@ bool ApplicationService::isOnDesktop() const noexcept
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
{
auto val = findEntryValue(DesktopFileEntryKey, "Actions", EntryValueType::String);

View File

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