From 72b9ad39a0d7fa96f40ec26944921ba1fcb75114 Mon Sep 17 00:00:00 2001
From: Lasse Holmstedt <lasse.holmstedt@nokia.com>
Date: Tue, 2 Mar 2010 12:04:11 +0100
Subject: [PATCH] Fix for crash on setting expressions to anchors in bauhaus

---
 .../components/propertyeditor/propertyeditor.cpp      | 11 ++++++++++-
 src/plugins/qmlprojectmanager/qmlprojectmanager.pro   |  3 ++-
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/src/plugins/qmldesigner/components/propertyeditor/propertyeditor.cpp b/src/plugins/qmldesigner/components/propertyeditor/propertyeditor.cpp
index cbe083fec09..16f6a568d7d 100644
--- a/src/plugins/qmldesigner/components/propertyeditor/propertyeditor.cpp
+++ b/src/plugins/qmldesigner/components/propertyeditor/propertyeditor.cpp
@@ -381,8 +381,17 @@ void PropertyEditor::changeExpression(const QString &name)
     if (m_locked)
         return;
 
+    QString underscoreName(name);
+    underscoreName.replace(QLatin1Char('.'), QLatin1Char('_'));
+
     QmlObjectNode fxObjectNode(m_selectedNode);
-    PropertyEditorValue *value = qobject_cast<PropertyEditorValue*>(QDeclarativeMetaType::toQObject(m_currentType->m_backendValuesPropertyMap.value(name)));
+    PropertyEditorValue *value = qobject_cast<PropertyEditorValue*>(QDeclarativeMetaType::toQObject(m_currentType->m_backendValuesPropertyMap.value(underscoreName)));
+
+    if (!value) {
+        qWarning() << "PropertyEditor::changeExpression no value for " << underscoreName;
+        return;
+    }
+
     try {
         if (fxObjectNode.currentState().isBaseState()) {
             fxObjectNode.modelNode().bindingProperty(name).setExpression(value->expression());
diff --git a/src/plugins/qmlprojectmanager/qmlprojectmanager.pro b/src/plugins/qmlprojectmanager/qmlprojectmanager.pro
index d156db8c68b..3fca4d496c2 100644
--- a/src/plugins/qmlprojectmanager/qmlprojectmanager.pro
+++ b/src/plugins/qmlprojectmanager/qmlprojectmanager.pro
@@ -37,4 +37,5 @@ SOURCES += qmlproject.cpp \
     qmlprojecttarget.cpp
 RESOURCES += qmlproject.qrc
 
-OTHER_FILES += QmlProjectManager.pluginspec
+OTHER_FILES += QmlProjectManager.pluginspec \
+               QmlProject.mimetypes.xml
-- 
GitLab