fix: update infos after app was launched

Signed-off-by: ComixHe <heyuming@deepin.org>
This commit is contained in:
ComixHe 2023-11-07 14:58:36 +08:00 committed by Comix
parent 733c9103b3
commit 74931e3d1a
2 changed files with 3 additions and 2 deletions

View File

@ -237,7 +237,7 @@ void ApplicationManager1Service::scanApplications() noexcept
const auto &desktopFileDirs = getDesktopFileDirs();
applyIteratively(
QList<QDir>(desktopFileDirs.cbegin(), desktopFileDirs.cend()),
QList<QDir>(desktopFileDirs.crbegin(), desktopFileDirs.crend()),
[this](const QFileInfo &info) -> bool {
ParserError err{ParserError::NoError};
auto ret = DesktopFile::searchDesktopFileByPath(info.absoluteFilePath(), err);

View File

@ -993,10 +993,11 @@ void ApplicationService::updateAfterLaunch(bool isLaunch) noexcept
}
auto timestamp = QDateTime::currentMSecsSinceEpoch();
if (auto ptr = m_storage.lock(); ptr) {
m_lastLaunch = timestamp;
ptr->updateApplicationValue(
m_desktopSource.desktopId(), ApplicationPropertiesGroup, ::LastLaunchedTime, QVariant::fromValue(timestamp));
emit lastLaunchedTimeChanged();
}
}