mirror of
https://gitlab.freedesktop.org/dabrain34/GstPipelineStudio.git
synced 2024-11-15 21:31:03 +00:00
graphmanager: update description on property remove
The node must update its description when a property value has been removed.
This commit is contained in:
parent
1eb49731e1
commit
72dcde0ad3
2 changed files with 3 additions and 1 deletions
|
@ -350,6 +350,7 @@ impl PropertyExt for Node {
|
||||||
let private = imp::Node::from_instance(self);
|
let private = imp::Node::from_instance(self);
|
||||||
trace!("property name={} removed", name);
|
trace!("property name={} removed", name);
|
||||||
private.properties.borrow_mut().remove(name);
|
private.properties.borrow_mut().remove(name);
|
||||||
|
self.update_description();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Retrieves node properties.
|
/// Retrieves node properties.
|
||||||
|
|
|
@ -16,9 +16,9 @@
|
||||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
//
|
//
|
||||||
// SPDX-License-Identifier: GPL-3.0-only
|
// SPDX-License-Identifier: GPL-3.0-only
|
||||||
|
use log::info;
|
||||||
use std::cell::Ref;
|
use std::cell::Ref;
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
|
|
||||||
pub trait PropertyExt {
|
pub trait PropertyExt {
|
||||||
fn hidden_property(&self, name: &str) -> bool {
|
fn hidden_property(&self, name: &str) -> bool {
|
||||||
name.starts_with('_')
|
name.starts_with('_')
|
||||||
|
@ -38,6 +38,7 @@ pub trait PropertyExt {
|
||||||
///
|
///
|
||||||
fn update_properties(&self, new_properties: &HashMap<String, String>) {
|
fn update_properties(&self, new_properties: &HashMap<String, String>) {
|
||||||
for (key, value) in new_properties {
|
for (key, value) in new_properties {
|
||||||
|
info!("Updating property name={} value={}", key, value);
|
||||||
if value.is_empty() {
|
if value.is_empty() {
|
||||||
self.remove_property(key);
|
self.remove_property(key);
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue