Skip to content

Commit ed7c796

Browse files
committed
More minor changes
1 parent f4cd648 commit ed7c796

File tree

3 files changed

+13
-10
lines changed

3 files changed

+13
-10
lines changed

objdiff-core/src/arch/ppc/flow_analysis.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use alloc::{
22
boxed::Box,
33
collections::{BTreeMap, BTreeSet},
44
format,
5-
string::String,
5+
string::{String, ToString},
66
vec::Vec,
77
};
88
use core::{

objdiff-gui/src/views/diff.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -284,15 +284,19 @@ pub fn diff_view_ui(
284284

285285
// Only need to check the first Object. Technically the first could not have a flow analysis
286286
// result while the second does but we don't want to waste space on two separate checkboxes.
287-
if result.first_obj.as_ref().is_some_and(|(first, _)| first.has_flow_analysis_result())
287+
if state.current_view == View::FunctionDiff
288+
&& result
289+
.first_obj
290+
.as_ref()
291+
.is_some_and(|(first, _)| first.has_flow_analysis_result())
288292
{
289-
let mut placeholder = diff_config.show_data_flow;
293+
let mut value = diff_config.show_data_flow;
290294
if ui
291-
.checkbox(&mut placeholder, "Show data flow")
295+
.checkbox(&mut value, "Show data flow")
292296
.on_hover_text("Show data flow analysis results in place of register names")
293297
.clicked()
294298
{
295-
ret = Some(DiffViewAction::ToggleShowDataFlow);
299+
ret = Some(DiffViewAction::SetShowDataFlow(value));
296300
}
297301
}
298302
} else if column == 1 {

objdiff-gui/src/views/symbol_diff.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ pub enum DiffViewAction {
7979
SetMapping(usize, usize),
8080
/// Set the show_mapped_symbols flag
8181
SetShowMappedSymbols(bool),
82-
/// Toggle the show_data_flow flag
83-
ToggleShowDataFlow,
82+
/// Set the show_data_flow flag
83+
SetShowDataFlow(bool),
8484
}
8585

8686
#[derive(Debug, Clone, Default, Eq, PartialEq)]
@@ -352,12 +352,11 @@ impl DiffViewState {
352352
DiffViewAction::SetShowMappedSymbols(value) => {
353353
self.symbol_state.show_mapped_symbols = value;
354354
}
355-
DiffViewAction::ToggleShowDataFlow => {
355+
DiffViewAction::SetShowDataFlow(value) => {
356356
let Ok(mut state) = state.write() else {
357357
return;
358358
};
359-
state.config.diff_obj_config.show_data_flow =
360-
!state.config.diff_obj_config.show_data_flow;
359+
state.config.diff_obj_config.show_data_flow = value;
361360
}
362361
}
363362
}

0 commit comments

Comments
 (0)