forked from qt-creator/qt-creator
QmlDesigner: Avoid some unneeded QFileInfo constructions
Change-Id: I0289c3187f07e26d05a7ca591cc8b12b767c3502 Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
@@ -693,7 +693,7 @@ static inline QString fixComponentPathForIncompatibleQt(const QString &component
|
|||||||
//plugin directories might contain the version number
|
//plugin directories might contain the version number
|
||||||
fixedPath.chop(4);
|
fixedPath.chop(4);
|
||||||
fixedPath += QLatin1Char('/') + QFileInfo(componentPath).fileName();
|
fixedPath += QLatin1Char('/') + QFileInfo(componentPath).fileName();
|
||||||
if (QFileInfo(fixedPath).exists())
|
if (QFileInfo::exists(fixedPath))
|
||||||
return fixedPath;
|
return fixedPath;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -194,7 +194,8 @@ void PropertyEditorView::changeValue(const QString &name)
|
|||||||
if (qmlObjectNode.modelNode().metaInfo().propertyTypeName(propertyName) == "QUrl"
|
if (qmlObjectNode.modelNode().metaInfo().propertyTypeName(propertyName) == "QUrl"
|
||||||
|| qmlObjectNode.modelNode().metaInfo().propertyTypeName(propertyName) == "url") { //turn absolute local file paths into relative paths
|
|| qmlObjectNode.modelNode().metaInfo().propertyTypeName(propertyName) == "url") { //turn absolute local file paths into relative paths
|
||||||
QString filePath = castedValue.toUrl().toString();
|
QString filePath = castedValue.toUrl().toString();
|
||||||
if (QFileInfo(filePath).exists() && QFileInfo(filePath).isAbsolute()) {
|
QFileInfo fi(filePath);
|
||||||
|
if (fi.exists() && fi.isAbsolute()) {
|
||||||
QDir fileDir(QFileInfo(model()->fileUrl().toLocalFile()).absolutePath());
|
QDir fileDir(QFileInfo(model()->fileUrl().toLocalFile()).absolutePath());
|
||||||
castedValue = QUrl(fileDir.relativeFilePath(filePath));
|
castedValue = QUrl(fileDir.relativeFilePath(filePath));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user