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 <alessandro.portale@digia.com>
This commit is contained in:
Daniel Teske
2014-06-02 14:25:47 +02:00
parent b79449bedd
commit c7f0c4a743
2 changed files with 5 additions and 2 deletions

View File

@@ -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);