forked from qt-creator/qt-creator
ProjectExplorer: Split deployment data using last colon on the line
The original approach does not work with absolute file paths on Windows Change-Id: I9f284dfa7c0fe145a99e216a571d3f0eb1289f94 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -87,11 +87,11 @@ QString DeploymentData::addFilesFromDeploymentFile(const QString &deploymentFile
|
|||||||
QString line = deploymentStream.readLine();
|
QString line = deploymentStream.readLine();
|
||||||
if (!line.contains(':'))
|
if (!line.contains(':'))
|
||||||
continue;
|
continue;
|
||||||
QStringList file = line.split(':');
|
int splitPoint = line.lastIndexOf(':');
|
||||||
QString sourceFile = file.at(0);
|
QString sourceFile = line.left(splitPoint);
|
||||||
if (QFileInfo(sourceFile).isRelative())
|
if (QFileInfo(sourceFile).isRelative())
|
||||||
sourceFile.prepend(sourcePrefix);
|
sourceFile.prepend(sourcePrefix);
|
||||||
QString targetFile = file.at(1);
|
QString targetFile = line.mid(splitPoint + 1);
|
||||||
if (QFileInfo(targetFile).isRelative())
|
if (QFileInfo(targetFile).isRelative())
|
||||||
targetFile.prepend(deploymentPrefix);
|
targetFile.prepend(deploymentPrefix);
|
||||||
addFile(sourceFile, targetFile);
|
addFile(sourceFile, targetFile);
|
||||||
|
Reference in New Issue
Block a user