From 9abdac88c960c7103540f73400d26824d9154e1e Mon Sep 17 00:00:00 2001
From: Peter Albrecht <usnlf@student.kit.edu>
Date: Sat, 28 Dec 2024 17:06:32 +0100
Subject: [PATCH] fix: check for updated description does not work

---
 .../skill_details/SkillDetailsTreeWidget.cpp        | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/source/RobotAPI/libraries/skills_gui/skill_details/SkillDetailsTreeWidget.cpp b/source/RobotAPI/libraries/skills_gui/skill_details/SkillDetailsTreeWidget.cpp
index 7d507847c..c7ec8c4d9 100644
--- a/source/RobotAPI/libraries/skills_gui/skill_details/SkillDetailsTreeWidget.cpp
+++ b/source/RobotAPI/libraries/skills_gui/skill_details/SkillDetailsTreeWidget.cpp
@@ -115,8 +115,11 @@ namespace armarx::skills::gui
         auto descr = update.skills.at(sid.providerId.value()).at(sid);
 
         // only triggers if the description does not match
-        if (descr != shownSkill->descr)
+        // TODO: for some reason the == operator does not work for the aron ObjectPtrs (data and type) in the description.
+        // We exclude them here, but it should be adressed elsewhere...
+        if (descr.skillId != shownSkill->descr.skillId || descr.timeout != shownSkill->descr.timeout || descr.description != shownSkill->descr.description)
         {
+            ARMARX_WARNING << "The skill description of the currently shown skill has changed. Resetting the widget...";
             this->updateContents(sid, descr);
         }
     }
@@ -173,12 +176,16 @@ namespace armarx::skills::gui
         auto defaults = shownSkill->originalParameters;
 
         auto params = this->aronTreeWidgetController->convertToAron();
+
+        if (defaults == nullptr && params == nullptr)
+        {
+            return false;
+        }
+
         bool modified = *defaults.get() != *params.get();
         if (modified)
         {
             ARMARX_INFO << "The parameters have been modified. Asking the user to save.";
-            ARMARX_INFO << "Defaults:\n" << defaults.get();
-            ARMARX_INFO << "Params:\n" << params.get();
         }
         return modified;
     }
-- 
GitLab