feat: change dbus interface api

1. remove method: Application, Launch. (ApplicationManager1)
2. add property: IconName, DisplayName. (Application1)
3. refact the way of construct ApplicationService.
4. if Desktop Entry Key `Hidden` is true, this application wouldn't
   export to DBus.

Signed-off-by: ComixHe <heyuming@deepin.org>
This commit is contained in:
ComixHe
2023-08-16 17:44:56 +08:00
committed by Comix
parent a3dd315e33
commit bb83716d27
11 changed files with 140 additions and 113 deletions

View File

@ -56,7 +56,9 @@ DesktopErrorCode DesktopEntry::parseEntry(const QString &str, decltype(m_entryMa
re.optimize();
auto matcher = re.match(keyStr);
if (!matcher.hasMatch()) {
#ifdef DEBUG_MODE
qWarning() << "invalid key: " << keyStr;
#endif
return DesktopErrorCode::EntryKeyInvalid;
}
@ -205,7 +207,9 @@ DesktopErrorCode DesktopEntry::parse(QTextStream &stream) noexcept
if (auto error = parseEntry(line, currentGroup); error != DesktopErrorCode::NoError) {
err = error;
#ifdef DEBUG_MODE
qWarning() << "an error occurred,this line will be skipped:" << line;
#endif
}
}
return err;
@ -223,13 +227,17 @@ std::optional<DesktopEntry::Value> DesktopEntry::value(const QString &groupKey,
{
const auto &destGroup = group(groupKey);
if (!destGroup) {
#ifdef DEBUG_MODE
qWarning() << "group " << groupKey << " can't be found.";
#endif
return std::nullopt;
}
auto it = destGroup->find(valueKey);
if (it == destGroup->cend()) {
#ifdef DEBUG_MODE
qWarning() << "value " << valueKey << " can't be found.";
#endif
return std::nullopt;
}
return *it;