fix: relink to autostart when dekstopFile has been changed

Signed-off-by: ComixHe <heyuming@deepin.org>
This commit is contained in:
ComixHe
2023-09-15 14:44:27 +08:00
committed by Comix
parent b2b5c23a2b
commit 7d94a8b71d
5 changed files with 38 additions and 4 deletions

View File

@ -421,12 +421,12 @@ qulonglong ApplicationService::lastLaunchedTime() const noexcept
return m_lastLaunch;
}
bool ApplicationService::autostartCheck(const QString &linkPath) noexcept
bool ApplicationService::autostartCheck(const QString &linkPath) const noexcept
{
QFileInfo info{linkPath};
if (info.exists()) {
if (info.isSymbolicLink()) {
if (info.isSymbolicLink() and info.symLinkTarget() == m_desktopSource.sourcePath()) {
return true;
}
qWarning() << "same name desktop file exists:" << linkPath << "but this may not created by AM.";