forked from qt-creator/qt-creator
Utils: Fix for invalid docker paths from installer
Some installers wrote "docker:/" into the settings instead of "docker://". This adds a workaround for that. Fixes: QTCREATORBUG-29474 Change-Id: I49a69d6fa9e4fe383257313e534660814c4a011f Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -1269,7 +1269,16 @@ FilePath FilePath::fromSettings(const QVariant &variant)
|
||||
const QUrl url = variant.toUrl();
|
||||
return FilePath::fromParts(url.scheme(), url.host(), url.path());
|
||||
}
|
||||
return FilePath::fromUserInput(variant.toString());
|
||||
|
||||
// The installer sometimes fails and adds "docker:/..." instead of "docker://...
|
||||
// So we fix these paths here in those cases.
|
||||
QString data = variant.toString();
|
||||
if (data.length() > 8 && data.startsWith("docker:/") && data[8] != '/') {
|
||||
qWarning() << "Broken path in settings:" << data << ", applying workaround.";
|
||||
data.insert(8, '/');
|
||||
}
|
||||
|
||||
return FilePath::fromUserInput(data);
|
||||
}
|
||||
|
||||
QVariant FilePath::toSettings() const
|
||||
|
Reference in New Issue
Block a user