From c7f0c4a743056ff553e727844f2ec8abd2711380 Mon Sep 17 00:00:00 2001 From: Daniel Teske Date: Mon, 2 Jun 2014 14:25:47 +0200 Subject: [PATCH] ResourceNodes: Fix paths in copy url/path actions Simplify qrc:/// to qrc:/, since that's the documented form. Also work around QDir::cleanPath() not cleaning up leading '//' on windows. Task-number: QTCREATORBUG-12299 Change-Id: Ifa75196b8682d4d9e8d5dc6045820000335b26c2 Reviewed-by: Alessandro Portale --- src/plugins/resourceeditor/resourceeditorplugin.cpp | 2 +- src/plugins/resourceeditor/resourcenode.cpp | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/plugins/resourceeditor/resourceeditorplugin.cpp b/src/plugins/resourceeditor/resourceeditorplugin.cpp index 72cb090abb1..75fce8a13d0 100644 --- a/src/plugins/resourceeditor/resourceeditorplugin.cpp +++ b/src/plugins/resourceeditor/resourceeditorplugin.cpp @@ -65,7 +65,7 @@ using namespace ResourceEditor::Internal; static const char resourcePrefix[] = ":"; -static const char urlPrefix[] = "qrc://"; +static const char urlPrefix[] = "qrc:"; class PrefixLangDialog : public QDialog { diff --git a/src/plugins/resourceeditor/resourcenode.cpp b/src/plugins/resourceeditor/resourcenode.cpp index 450538dac2f..d270507f797 100644 --- a/src/plugins/resourceeditor/resourcenode.cpp +++ b/src/plugins/resourceeditor/resourcenode.cpp @@ -161,7 +161,10 @@ void ResourceTopLevelNode::update() // Note: this is wrong, but the qrceditor doesn't allow it either // only aliases need to be unique } else { - const QString qrcPath = QDir::cleanPath(prefix + QLatin1Char('/') + alias); + QString prefixWithSlash = prefix; + if (!prefixWithSlash.endsWith(QLatin1Char('/'))) + prefixWithSlash.append(QLatin1Char('/')); + const QString qrcPath = QDir::cleanPath(prefixWithSlash + alias); fileNames.insert(fileName); filesToAdd[qMakePair(prefix, lang)] << new ResourceFileNode(fileName, qrcPath, this);