Skip to content

Commit 3939ca9

Browse files
tsic404deepin-bot[bot]
authored andcommitted
fix: unable get docked entriy by soft link path
set canonicalFilePath instead of absoluteFilePath for deskfileinfo and find it by canonicalFilePath instead of user input path log: use canonicalFilePath instead of absoluteFilePath
1 parent 0300e28 commit 3939ca9

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

frame/taskmanager/desktopinfo.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ DesktopInfo::DesktopInfo(const QString &desktopfile)
4040
}
4141
}
4242

43-
m_desktopFilePath = desktopFileInfo.absoluteFilePath();
43+
m_desktopFilePath = desktopFileInfo.canonicalFilePath();
4444
m_isValid = desktopFileInfo.isAbsolute() && QFile::exists(desktopFileInfo.absoluteFilePath());
4545
m_desktopFile.reset(new QSettings(m_desktopFilePath, QSettings::IniFormat));
4646
m_desktopFile->setIniCodec("utf-8");

frame/taskmanager/entries.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,9 +162,11 @@ QList<Entry*> Entries::getEntries()
162162

163163
Entry *Entries::getDockedEntryByDesktopFile(const QString &desktopFile)
164164
{
165+
QFileInfo desktopFileInfo(desktopFile);
166+
165167
Entry *ret = nullptr;
166168
for (auto entry : filterDockedEntries()) {
167-
if ((entry->isValid()) && desktopFile == entry->getFileName()) {
169+
if ((entry->isValid()) && desktopFileInfo.canonicalFilePath() == entry->getFileName()) {
168170
ret = entry;
169171
break;
170172
}

0 commit comments

Comments
 (0)