feat: add property installedTime,X-flatpak,X-linglong
Signed-off-by: black-desk <me@black-desk.cn>
This commit is contained in:
@ -270,9 +270,9 @@ void ApplicationManager1Service::updateApplication(const QSharedPointer<Applicat
|
||||
return;
|
||||
}
|
||||
|
||||
auto mtime = getFileModifiedTime(desktopFile.sourceFileRef());
|
||||
auto mtime = getFileTimeInfo(desktopFile.sourceFileRef());
|
||||
|
||||
if (destApp->desktopFileSource().modified(mtime)) {
|
||||
if (destApp->desktopFileSource().modified(std::get<1>(mtime))) {
|
||||
auto *newEntry = new (std::nothrow) DesktopEntry{};
|
||||
if (newEntry == nullptr) {
|
||||
qCritical() << "new DesktopEntry failed.";
|
||||
|
@ -264,6 +264,23 @@ QString ApplicationService::id() const noexcept
|
||||
return m_desktopSource.desktopId();
|
||||
}
|
||||
|
||||
bool ApplicationService::x_Flatpak() const noexcept
|
||||
{
|
||||
auto val = findEntryValue(DesktopFileEntryKey, "X-flatpak", EntryValueType::String);
|
||||
return val.isNull();
|
||||
}
|
||||
|
||||
bool ApplicationService::x_linglong() const noexcept
|
||||
{
|
||||
auto val = findEntryValue(DesktopFileEntryKey, "X-linglong", EntryValueType::String);
|
||||
return val.isNull();
|
||||
}
|
||||
|
||||
qulonglong ApplicationService::installedTime() const noexcept
|
||||
{
|
||||
return m_desktopSource.createTime();
|
||||
}
|
||||
|
||||
qulonglong ApplicationService::lastLaunchedTime() const noexcept
|
||||
{
|
||||
return m_lastLaunch;
|
||||
|
@ -60,6 +60,15 @@ public:
|
||||
Q_PROPERTY(QList<QDBusObjectPath> Instances READ instances)
|
||||
[[nodiscard]] QList<QDBusObjectPath> instances() const noexcept;
|
||||
|
||||
Q_PROPERTY(bool X_Flatpak READ x_Flatpak)
|
||||
[[nodiscard]] bool x_Flatpak() const noexcept;
|
||||
|
||||
Q_PROPERTY(bool X_linglong READ x_linglong)
|
||||
[[nodiscard]] bool x_linglong() const noexcept;
|
||||
|
||||
Q_PROPERTY(qulonglong installedTime READ installedTime)
|
||||
[[nodiscard]] qulonglong installedTime() const noexcept;
|
||||
|
||||
[[nodiscard]] QDBusObjectPath findInstance(const QString &instanceId) const;
|
||||
|
||||
[[nodiscard]] const QString &getLauncher() const noexcept { return m_launcher; }
|
||||
|
Reference in New Issue
Block a user