mirror of
https://github.com/linuxdeepin/dde-dock.git
synced 2025-06-01 07:05:48 +00:00
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
This commit is contained in:
parent
0300e28332
commit
3939ca9c12
@ -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");
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user