From 89403daf4ef0db7fd8c4a5c8a61050d0df3a0364 Mon Sep 17 00:00:00 2001 From: hjk Date: Tue, 13 Dec 2022 08:35:55 +0100 Subject: [PATCH] Utils: Skip roundtrip through QUrl in FileCrumbLabel Change-Id: I4796070ef2a3bb0b4d778c5b0db224574dbf4823 Reviewed-by: Christian Stenger Reviewed-by: Eike Ziller Reviewed-by: --- src/libs/utils/filecrumblabel.cpp | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/libs/utils/filecrumblabel.cpp b/src/libs/utils/filecrumblabel.cpp index d5e61576427..552cda71e1e 100644 --- a/src/libs/utils/filecrumblabel.cpp +++ b/src/libs/utils/filecrumblabel.cpp @@ -6,9 +6,6 @@ #include "filepath.h" #include "hostosinfo.h" -#include -#include - namespace Utils { FileCrumbLabel::FileCrumbLabel(QWidget *parent) @@ -16,17 +13,15 @@ FileCrumbLabel::FileCrumbLabel(QWidget *parent) { setTextFormat(Qt::RichText); setWordWrap(true); - connect(this, &QLabel::linkActivated, this, [this](const QString &url) { - emit pathClicked(FilePath::fromUrl(QUrl(url))); + connect(this, &QLabel::linkActivated, this, [this](const QString &filePath) { + emit pathClicked(FilePath::fromString(filePath)); }); setPath(FilePath()); } static QString linkForPath(const FilePath &path, const QString &display) { - return "" - + display + ""; + return "" + display + ""; } void FileCrumbLabel::setPath(const FilePath &path)