diff --git a/src/components/input/output_stream_entry.rs b/src/components/input/output_stream_entry.rs index bae7433..2400c19 100644 --- a/src/components/input/output_stream_entry.rs +++ b/src/components/input/output_stream_entry.rs @@ -81,6 +81,7 @@ impl OutputStreamEntry { for entry in 0..*index { if model_list.string(entry) == Some(name.2.clone().into()) { imp.reset_source_selection.set_selected(entry); + break; } } } else { @@ -92,6 +93,7 @@ impl OutputStreamEntry { for entry in 0..*index { if model_list.string(entry) == Some(name.alias.clone().into()) { imp.reset_source_selection.set_selected(entry); + break; } } } diff --git a/src/components/input/source_box.rs b/src/components/input/source_box.rs index beae0e6..20a5793 100644 --- a/src/components/input/source_box.rs +++ b/src/components/input/source_box.rs @@ -166,7 +166,7 @@ pub fn populate_sources(input_box: Arc) { for entry in 0..*index { if model_list.string(entry) == Some(name.alias.clone().into()) { input_box_imp.reset_source_dropdown.set_selected(entry); - return; + break; } } input_box_imp.reset_source_dropdown.connect_selected_notify( @@ -261,7 +261,7 @@ pub fn refresh_default_source(new_source: Source, input_box: Arc, ent for entry in 0..*imp.reset_model_index.read().unwrap() { if model_list.string(entry) == Some(new_source.alias.clone().into()) { imp.reset_source_dropdown.set_selected(entry); - return; + break; } } } @@ -471,7 +471,7 @@ pub fn start_input_box_listener(conn: Connection, source_box: Arc) -> for entry in 0..*index { if model_list.string(entry) == Some(alias.clone().into()) { model_list.remove(entry); - return; + break; } } if *index > 1 { @@ -612,6 +612,7 @@ pub fn start_input_box_listener(conn: Connection, source_box: Arc) -> for entry in 0..*index { if model_list.string(entry) == Some(alias.clone().into()) { imp.reset_source_selection.set_selected(entry); + break; } } }); diff --git a/src/components/output/audio_box.rs b/src/components/output/audio_box.rs deleted file mode 100644 index e69de29..0000000 diff --git a/src/components/output/input_stream_entry.rs b/src/components/output/input_stream_entry.rs index 2824515..52de3ba 100644 --- a/src/components/output/input_stream_entry.rs +++ b/src/components/output/input_stream_entry.rs @@ -90,6 +90,7 @@ impl InputStreamEntry { for entry in 0..*index { if model_list.string(entry) == Some(name.2.clone().into()) { imp.reset_sink_selection.set_selected(entry); + break; } } } else { @@ -101,6 +102,7 @@ impl InputStreamEntry { for entry in 0..*index { if model_list.string(entry) == Some(name.alias.clone().into()) { imp.reset_sink_selection.set_selected(entry); + break; } } } diff --git a/src/components/output/mod.rs b/src/components/output/mod.rs index 6087421..f26058a 100644 --- a/src/components/output/mod.rs +++ b/src/components/output/mod.rs @@ -1,4 +1,3 @@ -pub mod audio_box; pub mod input_stream_entry; pub mod input_stream_entry_impl; pub mod sink_box; diff --git a/src/components/output/sink_box.rs b/src/components/output/sink_box.rs index a3838e0..4da71a5 100644 --- a/src/components/output/sink_box.rs +++ b/src/components/output/sink_box.rs @@ -169,7 +169,7 @@ pub fn populate_sinks(output_box: Arc) { for entry in 0..*index { if model_list.string(entry) == Some(name.alias.clone().into()) { output_box_imp.reset_sink_dropdown.set_selected(entry); - return; + break; } } output_box_imp.reset_sink_dropdown.connect_selected_notify( @@ -265,7 +265,7 @@ pub fn refresh_default_sink(new_sink: Sink, output_box: Arc, entry: boo for entry in 0..*index { if model_list.string(entry) == Some(new_sink.alias.clone().into()) { imp.reset_sink_dropdown.set_selected(entry); - return; + break; } } } @@ -474,7 +474,7 @@ pub fn start_output_box_listener(conn: Connection, sink_box: Arc) -> Co for entry in 0..*index { if model_list.string(entry) == Some(alias.clone().into()) { model_list.remove(entry); - return; + break; } } if *index > 1 { @@ -611,7 +611,7 @@ pub fn start_output_box_listener(conn: Connection, sink_box: Arc) -> Co for entry in 0..*index { if model_list.string(entry) == Some(alias.clone().into()) { imp.reset_sink_selection.set_selected(entry); - return; + break; } } });