From 9e7743494c7799d2ade7209b75f956125c85593b Mon Sep 17 00:00:00 2001 From: hjk Date: Thu, 24 Nov 2022 17:38:18 +0100 Subject: [PATCH] Utils: Use some of the FilePath convenience functions in FileCrumbLabel Change-Id: I79f6b52847106bab22454f032407eb6866012362 Reviewed-by: Qt CI Bot Reviewed-by: Reviewed-by: Christian Kandeler --- src/libs/utils/filecrumblabel.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/libs/utils/filecrumblabel.cpp b/src/libs/utils/filecrumblabel.cpp index 53f15000ee2..d5e61576427 100644 --- a/src/libs/utils/filecrumblabel.cpp +++ b/src/libs/utils/filecrumblabel.cpp @@ -17,7 +17,7 @@ FileCrumbLabel::FileCrumbLabel(QWidget *parent) setTextFormat(Qt::RichText); setWordWrap(true); connect(this, &QLabel::linkActivated, this, [this](const QString &url) { - emit pathClicked(FilePath::fromString(QUrl(url).toLocalFile())); + emit pathClicked(FilePath::fromUrl(QUrl(url))); }); setPath(FilePath()); } @@ -25,7 +25,7 @@ FileCrumbLabel::FileCrumbLabel(QWidget *parent) static QString linkForPath(const FilePath &path, const QString &display) { return "" + + path.toUrl().toString(QUrl::FullyEncoded) + "\">" + display + ""; } @@ -37,7 +37,7 @@ void FileCrumbLabel::setPath(const FilePath &path) const QString fileName = current.fileName(); if (!fileName.isEmpty()) { links.prepend(linkForPath(current, fileName)); - } else if (HostOsInfo::isWindowsHost() && QDir(current.toString()).isRoot()) { + } else if (HostOsInfo::isWindowsHost() && current.isRootPath()) { // Only on Windows add the drive letter, without the '/' at the end QString display = current.toString(); if (display.endsWith('/'))