Skip to content

Commit 728b61a

Browse files
committed
Fix canonicalPath for drives (c:)
1 parent ef0d08e commit 728b61a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/gui/folderman.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -546,7 +546,8 @@ QString FolderMan::trayTooltipStatusString(
546546
// parent directories.
547547
static QString canonicalPath(const QString &path)
548548
{
549-
QFileInfo selFile(path);
549+
// QFile::canonicalFilePath for C: returns the current working dir 🤷‍♀️
550+
QFileInfo selFile(Utility::ensureTrailingSlash(path));
550551
if (!selFile.exists()) {
551552
const auto parentPath = selFile.dir().path();
552553

@@ -557,7 +558,7 @@ static QString canonicalPath(const QString &path)
557558
return path;
558559
}
559560

560-
return canonicalPath(parentPath) + QLatin1Char('/') + selFile.fileName();
561+
return canonicalPath(parentPath) + '/'_L1 + selFile.fileName();
561562
}
562563
return selFile.canonicalFilePath();
563564
}

0 commit comments

Comments
 (0)