graphmanager: update description on property remove

The node must update its description when
a property value has been removed.
This commit is contained in:
Stéphane Cerveau 2022-02-08 14:53:12 +01:00
parent 1eb49731e1
commit 72dcde0ad3
2 changed files with 3 additions and 1 deletions

View file

@ -350,6 +350,7 @@ impl PropertyExt for Node {
let private = imp::Node::from_instance(self);
trace!("property name={} removed", name);
private.properties.borrow_mut().remove(name);
self.update_description();
}
/// Retrieves node properties.

View file

@ -16,9 +16,9 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// SPDX-License-Identifier: GPL-3.0-only
use log::info;
use std::cell::Ref;
use std::collections::HashMap;
pub trait PropertyExt {
fn hidden_property(&self, name: &str) -> bool {
name.starts_with('_')
@ -38,6 +38,7 @@ pub trait PropertyExt {
///
fn update_properties(&self, new_properties: &HashMap<String, String>) {
for (key, value) in new_properties {
info!("Updating property name={} value={}", key, value);
if value.is_empty() {
self.remove_property(key);
} else {