Refactored gfx switch session monitor

This commit is contained in:
Luke D Jones
2021-03-16 21:06:18 +13:00
parent 35438e2e77
commit cec4016862
17 changed files with 317 additions and 307 deletions

View File

@@ -4,7 +4,7 @@ use rog_types::error::GraphicsError;
use std::convert::From;
use std::fmt;
use crate::{ctrl_gfx::error::GfxError, session_manager::SessionError};
use crate::ctrl_gfx::error::GfxError;
#[derive(Debug)]
pub enum RogError {
@@ -28,7 +28,7 @@ pub enum RogError {
Initramfs(String),
Modprobe(String),
Command(String, std::io::Error),
Session(SessionError),
Zbus(zbus::Error),
}
impl fmt::Display for RogError {
@@ -55,7 +55,7 @@ impl fmt::Display for RogError {
RogError::Initramfs(detail) => write!(f, "Initiramfs error: {}", detail),
RogError::Modprobe(detail) => write!(f, "Modprobe error: {}", detail),
RogError::Command(func, error) => write!(f, "Command exec error: {}: {}", func, error),
RogError::Session(detail) => write!(f, "Session error: {}", detail),
RogError::Zbus(detail) => write!(f, "Zbus error: {}", detail),
}
}
}
@@ -82,8 +82,8 @@ impl From<GraphicsError> for RogError {
}
}
impl From<SessionError> for RogError {
fn from(err: SessionError) -> Self {
RogError::Session(err)
impl From<zbus::Error> for RogError {
fn from(err: zbus::Error) -> Self {
RogError::Zbus(err)
}
}
}