From 64ff0c87cb3f50457d98bf5ca0ad89a05b28f801 Mon Sep 17 00:00:00 2001
From: Cedric Seehausen <usdnr@student.kit.edu>
Date: Thu, 7 Jul 2016 11:45:48 +0200
Subject: [PATCH] Required Properties behaviour fix

---
 .../gui/detailedapplicationview.cpp           | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/source/ArmarXGui/gui-plugins/ScenarioManager/gui/detailedapplicationview.cpp b/source/ArmarXGui/gui-plugins/ScenarioManager/gui/detailedapplicationview.cpp
index f5439e2f..41b4db89 100644
--- a/source/ArmarXGui/gui-plugins/ScenarioManager/gui/detailedapplicationview.cpp
+++ b/source/ArmarXGui/gui-plugins/ScenarioManager/gui/detailedapplicationview.cpp
@@ -519,15 +519,16 @@ void DetailedApplicationView::itemChanged(QtProperty* property, const QVariant&
 
                 updateTimer.start(UPDATE_TIMER_INTERVAL);
             }
-            else if (property->propertyName().compare("Instance Name") && properties->getProperty(property->propertyName().toStdString()).compare(value.toString().toStdString())
-                     && value.toString().compare("<set value!>")
-                     && value.toString().compare("::NOT_DEFINED::")
-                     && value.toString().compare("::_NOT_SET_::"))
+            else if (property->propertyName().compare("Instance Name") && properties->getProperty(property->propertyName().toStdString()).compare(value.toString().toStdString()))
             {
                 lastAppInstance->modifyProperty(property->propertyName().toStdString(), property->valueText().toStdString());
-                lastAppInstance->setDefaultPropertyEnabled(property->propertyName().toStdString(), true);
-                variantManager->setAttribute(property, QLatin1String("enabled"), true);
-
+                if (value.toString().compare("<set value!>")
+                    && value.toString().compare("::NOT_DEFINED::")
+                    && value.toString().compare("::_NOT_SET_::"))
+                {
+                    lastAppInstance->setDefaultPropertyEnabled(property->propertyName().toStdString(), true);
+                    variantManager->setAttribute(property, QLatin1String("enabled"), true);
+                }
                 updateTimer.start(UPDATE_TIMER_INTERVAL);
             }
             //showApplicationInstance(lastAppInstance);
@@ -575,8 +576,8 @@ void DetailedApplicationView::itemAttributeChanged(QtProperty* property, const Q
 
                 if (definition.isRequired())
                 {
-                    properties->getProperties()->setProperty(property->propertyName().toStdString(), "");
-                    internalManager->setValue(property, "");
+                    properties->getProperties()->setProperty(property->propertyName().toStdString(), "::_NOT_SET_::");
+                    internalManager->setValue(property, "::_NOT_SET_::");
                 }
                 else
                 {
-- 
GitLab