From bfb5a9d5e46037a51240cb06f71cf4c07e9cdfed Mon Sep 17 00:00:00 2001
From: Thomas Hartmann <Thomas.Hartmann@digia.com>
Date: Tue, 11 Dec 2012 14:27:54 +0100
Subject: [PATCH] QmlDesigner.PropertyEditor: also checking for url and not
 just QUrl

We ensure that file paths are relative, but only checked for QUrl.

Change-Id: I971f6633e60ab512eab978929359838af491e2ae
Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
---
 .../qmldesigner/components/propertyeditor/propertyeditor.cpp | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/plugins/qmldesigner/components/propertyeditor/propertyeditor.cpp b/src/plugins/qmldesigner/components/propertyeditor/propertyeditor.cpp
index cd22c46bad4..9cafd340a71 100644
--- a/src/plugins/qmldesigner/components/propertyeditor/propertyeditor.cpp
+++ b/src/plugins/qmldesigner/components/propertyeditor/propertyeditor.cpp
@@ -485,8 +485,9 @@ void PropertyEditor::changeValue(const QString &propertyName)
     }
 
     if (fxObjectNode.modelNode().metaInfo().isValid() && fxObjectNode.modelNode().metaInfo().hasProperty(propertyName))
-        if (fxObjectNode.modelNode().metaInfo().propertyTypeName(propertyName) == QLatin1String("QUrl")) { //turn absolute local file paths into relative paths
-        QString filePath = castedValue.toUrl().toString();
+        if (fxObjectNode.modelNode().metaInfo().propertyTypeName(propertyName) == QLatin1String("QUrl")
+                || fxObjectNode.modelNode().metaInfo().propertyTypeName(propertyName) == QLatin1String("url")) { //turn absolute local file paths into relative paths
+            QString filePath = castedValue.toUrl().toString();
         if (QFileInfo(filePath).exists() && QFileInfo(filePath).isAbsolute()) {
             QDir fileDir(QFileInfo(model()->fileUrl().toLocalFile()).absolutePath());
             castedValue = QUrl(fileDir.relativeFilePath(filePath));
-- 
GitLab