Skip to content

Commit

Permalink
fix: unable get docked entriy by soft link path
Browse files Browse the repository at this point in the history
set canonicalFilePath instead of absoluteFilePath for deskfileinfo
and find it by canonicalFilePath instead of user input path

log: use canonicalFilePath instead of absoluteFilePath
  • Loading branch information
tsic404 authored and deepin-bot[bot] committed Jan 23, 2024
1 parent 0300e28 commit 3939ca9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion frame/taskmanager/desktopinfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ DesktopInfo::DesktopInfo(const QString &desktopfile)
}
}

m_desktopFilePath = desktopFileInfo.absoluteFilePath();
m_desktopFilePath = desktopFileInfo.canonicalFilePath();
m_isValid = desktopFileInfo.isAbsolute() && QFile::exists(desktopFileInfo.absoluteFilePath());
m_desktopFile.reset(new QSettings(m_desktopFilePath, QSettings::IniFormat));
m_desktopFile->setIniCodec("utf-8");
Expand Down
4 changes: 3 additions & 1 deletion frame/taskmanager/entries.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,11 @@ QList<Entry*> Entries::getEntries()

Entry *Entries::getDockedEntryByDesktopFile(const QString &desktopFile)
{
QFileInfo desktopFileInfo(desktopFile);

Entry *ret = nullptr;
for (auto entry : filterDockedEntries()) {
if ((entry->isValid()) && desktopFile == entry->getFileName()) {
if ((entry->isValid()) && desktopFileInfo.canonicalFilePath() == entry->getFileName()) {
ret = entry;
break;
}
Expand Down

0 comments on commit 3939ca9

Please sign in to comment.