merge systemd + machinectl into one module/applet (step 1)

This commit is contained in:
Damocles 2026-05-07 17:42:10 +02:00
commit 6fc7e8bc8a

View file

@ -12,7 +12,7 @@ use cxx_qt_lib::QString;
use serde::Serialize;
use std::sync::OnceLock;
use tokio::runtime::Runtime;
use zbus::{proxy, Connection};
use zbus::{Connection, proxy};
#[cxx_qt::bridge]
pub mod qobject {
@ -72,11 +72,8 @@ trait SystemdManager {
fn list_units_filtered(&self, states: Vec<&str>) -> zbus::Result<Vec<UnitTuple>>;
fn restart_unit(
&self,
name: &str,
mode: &str,
) -> zbus::Result<zbus::zvariant::OwnedObjectPath>;
fn restart_unit(&self, name: &str, mode: &str)
-> zbus::Result<zbus::zvariant::OwnedObjectPath>;
}
#[proxy(
@ -242,9 +239,11 @@ impl qobject::SystemdService {
self.as_mut().set_system_state(QString::from(sys_state));
self.as_mut().set_user_state(QString::from(user_state));
self.as_mut().set_failed_units_json(QString::from(failed_json));
self.as_mut()
.set_failed_units_json(QString::from(failed_json));
self.as_mut().set_failed_count(count);
self.as_mut().set_containers_json(QString::from(containers_json));
self.as_mut()
.set_containers_json(QString::from(containers_json));
}
fn restart_unit(self: Pin<&mut Self>, name: QString, scope: QString, machine: QString) {