app: Use new "node" api from graphview

This commit is contained in:
Stéphane Cerveau 2022-01-18 10:51:06 +01:00
parent 9ef073d3c3
commit 7a37e5b736
2 changed files with 7 additions and 7 deletions

View file

@ -693,7 +693,7 @@ impl GPSApp {
move |_,_| {
let app = upgrade_weak!(app_weak);
GPS_DEBUG!("node.add-to-favorite {}", node_id);
if let Some(node) = app.graphview.borrow().node(&node_id) {
if let Some(node) = app.graphview.borrow().node(node_id) {
app.add_to_favorite_list(node.name());
};
}
@ -713,7 +713,7 @@ impl GPSApp {
move |_,_| {
let app = upgrade_weak!(app_weak);
GPS_DEBUG!("node.request-pad-input {}", node_id);
let mut node = app.graphview.borrow_mut().node(&node_id).unwrap();
let mut node = app.graphview.borrow().node(node_id).unwrap();
let port_id = app.graphview.borrow().next_port_id();
node.add_port(port_id, "in", PortDirection::Input);
}
@ -724,7 +724,7 @@ impl GPSApp {
move |_,_| {
let app = upgrade_weak!(app_weak);
GPS_DEBUG!("node.request-pad-output {}", node_id);
let mut node = app.graphview.borrow_mut().node(&node_id).unwrap();
let mut node = app.graphview.borrow_mut().node(node_id).unwrap();
let port_id = app.graphview.borrow_mut().next_port_id();
node.add_port(port_id, "out", PortDirection::Output);
@ -736,7 +736,7 @@ impl GPSApp {
move |_,_| {
let app = upgrade_weak!(app_weak);
GPS_DEBUG!("node.properties {}", node_id);
let node = app.graphview.borrow().node(&node_id).unwrap();
let node = app.graphview.borrow().node(node_id).unwrap();
plugindialogs::display_plugin_properties(&app, &node.name(), node_id);
}
);
@ -775,7 +775,7 @@ impl GPSApp {
if Pipeline::element_is_uri_src_handler(element_name) {
GPSApp::get_file_from_dialog(self, false, move |app, filename| {
GPS_DEBUG!("Open file {}", filename);
let node = app.graphview.borrow().node(&node_id).unwrap();
let node = app.graphview.borrow().node(node_id).unwrap();
let mut properties: HashMap<String, String> = HashMap::new();
properties.insert(String::from("location"), filename);
node.update_properties(&properties);
@ -790,7 +790,7 @@ impl GPSApp {
}
pub fn update_element_properties(&self, node_id: u32, properties: &HashMap<String, String>) {
let node = self.graphview.borrow().node(&node_id).unwrap();
let node = self.graphview.borrow().node(node_id).unwrap();
node.update_properties(properties);
}

View file

@ -405,7 +405,7 @@ impl Pipeline {
} else {
description.push_str("! ");
}
if let Some(node) = graphview.node(&node_to) {
if let Some(node) = graphview.node(node_to) {
if elements.contains_key(&node.unique_name()) {
description.push_str(&format!("{}. ", node.unique_name()));
} else {