Remove unused code
This commit is contained in:
parent
83d2cb249f
commit
835774a5a7
3 changed files with 0 additions and 39 deletions
|
|
@ -21,17 +21,6 @@ pub async fn get_current_graphics(daemon: &PowerDaemonProxy<'_>) -> Result<Graph
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn get_default_graphics(daemon: &PowerDaemonProxy<'_>) -> Result<Graphics> {
|
|
||||||
let graphics = daemon.get_default_graphics().await?;
|
|
||||||
match graphics.as_str() {
|
|
||||||
"integrated" => Ok(Graphics::Integrated),
|
|
||||||
"hybrid" => Ok(Graphics::Hybrid),
|
|
||||||
"nvidia" => Ok(Graphics::Nvidia),
|
|
||||||
"compute" => Ok(Graphics::Compute),
|
|
||||||
_ => panic!("Unknown graphics profile: {}", graphics),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub async fn set_graphics(daemon: &PowerDaemonProxy<'_>, graphics: Graphics) -> Result<()> {
|
pub async fn set_graphics(daemon: &PowerDaemonProxy<'_>, graphics: Graphics) -> Result<()> {
|
||||||
let graphics_str = match graphics {
|
let graphics_str = match graphics {
|
||||||
Graphics::Integrated => "integrated",
|
Graphics::Integrated => "integrated",
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,6 @@ extern crate relm4_macros;
|
||||||
pub mod dbus;
|
pub mod dbus;
|
||||||
pub mod graphics;
|
pub mod graphics;
|
||||||
pub mod mode_box;
|
pub mod mode_box;
|
||||||
pub mod profile;
|
|
||||||
|
|
||||||
use self::{dbus::PowerDaemonProxy, graphics::Graphics, mode_box::ModeSelection};
|
use self::{dbus::PowerDaemonProxy, graphics::Graphics, mode_box::ModeSelection};
|
||||||
use gtk4::{
|
use gtk4::{
|
||||||
|
|
|
||||||
|
|
@ -1,27 +0,0 @@
|
||||||
// SPDX-License-Identifier: LGPL-3.0-or-later
|
|
||||||
use crate::dbus::PowerDaemonProxy;
|
|
||||||
use zbus::Result;
|
|
||||||
|
|
||||||
pub enum Profile {
|
|
||||||
Performance,
|
|
||||||
Balanced,
|
|
||||||
Battery,
|
|
||||||
}
|
|
||||||
|
|
||||||
pub async fn get_current_profile(daemon: &PowerDaemonProxy<'_>) -> Result<Profile> {
|
|
||||||
let profile = daemon.get_profile().await?;
|
|
||||||
match profile.as_str() {
|
|
||||||
"Performance" => Ok(Profile::Performance),
|
|
||||||
"Balanced" => Ok(Profile::Balanced),
|
|
||||||
"Battery" => Ok(Profile::Battery),
|
|
||||||
_ => panic!("Unknown profile: {}", profile),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub async fn set_profile(daemon: &PowerDaemonProxy<'_>, profile: Profile) -> zbus::Result<()> {
|
|
||||||
match profile {
|
|
||||||
Profile::Performance => daemon.performance().await,
|
|
||||||
Profile::Balanced => daemon.balanced().await,
|
|
||||||
Profile::Battery => daemon.battery().await,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue