refact: remove unnecessary open operation

fix AM can't access some dirs due to
systemd 254's sandboxing option: PrivateUser
is true by default.

Signed-off-by: ComixHe <heyuming@deepin.org>
This commit is contained in:
ComixHe
2023-08-31 17:59:09 +08:00
committed by Comix
parent df9bb10cee
commit 4c9d4491df
4 changed files with 9 additions and 20 deletions

View File

@ -270,7 +270,7 @@ void ApplicationManager1Service::updateApplication(const QSharedPointer<Applicat
return;
}
auto mtime = getFileTimeInfo(desktopFile.sourceFileRef());
auto mtime = getFileTimeInfo(QFileInfo{desktopFile.sourceFileRef()});
if (destApp->desktopFileSource().modified(std::get<1>(mtime))) {
auto *newEntry = new (std::nothrow) DesktopEntry{};