Skip to content

Commit

Permalink
gui: Gracefully handle zero performance profiles
Browse files Browse the repository at this point in the history
  • Loading branch information
AaronErhardt committed Jul 31, 2023
1 parent d7530a3 commit b428c81
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tailor_gui/src/components/factories/profile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ impl FactoryComponent for Profile {

#[template]
add_row = &templates::ProfileListItem {
set_visible: !self.performance.model().variants.is_empty(),

#[template_child]
image -> gtk::Image {
set_icon_name: Some(icon_name::SPEEDOMETER),
Expand Down
3 changes: 3 additions & 0 deletions tuxedo_ioctl/src/hal/uniwill.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,9 @@ impl HardwareDevice for UniwillHardware {
fn get_available_odm_performance_profiles(&self) -> IoctlResult<Vec<String>> {
let available_profs = read::uw::profs_available(&self.file)?;
let profiles = match available_profs {
0 => {
Vec::new()
}
2 => {
vec![PERF_PROF_BALANCED.into(), PERF_PROF_ENTHUSIAST.into()]
}
Expand Down

0 comments on commit b428c81

Please sign in to comment.