fix: compile without the logind feature
This commit is contained in:
parent
499f13a634
commit
14cc125fcd
2 changed files with 10 additions and 7 deletions
|
|
@ -279,8 +279,6 @@ pub fn main() -> Result<(), Box<dyn Error>> {
|
||||||
sessions
|
sessions
|
||||||
};
|
};
|
||||||
|
|
||||||
let logind_available = cfg!(feature = "logind") && crate::logind::is_available();
|
|
||||||
|
|
||||||
let flags = Flags {
|
let flags = Flags {
|
||||||
user_icons: user_datas
|
user_icons: user_datas
|
||||||
.iter_mut()
|
.iter_mut()
|
||||||
|
|
@ -290,7 +288,10 @@ pub fn main() -> Result<(), Box<dyn Error>> {
|
||||||
sessions,
|
sessions,
|
||||||
greeter_config,
|
greeter_config,
|
||||||
greeter_config_handler,
|
greeter_config_handler,
|
||||||
logind_available,
|
#[cfg(feature = "logind")]
|
||||||
|
logind_available: crate::logind::is_available(),
|
||||||
|
#[cfg(not(feature = "logind"))]
|
||||||
|
logind_available: false,
|
||||||
};
|
};
|
||||||
|
|
||||||
let settings = Settings::default().no_main_window(true);
|
let settings = Settings::default().no_main_window(true);
|
||||||
|
|
|
||||||
|
|
@ -79,8 +79,6 @@ pub fn main(user: pwd::Passwd) -> Result<(), Box<dyn std::error::Error>> {
|
||||||
// We are already the user at this point
|
// We are already the user at this point
|
||||||
user_data.load_config_as_user();
|
user_data.load_config_as_user();
|
||||||
|
|
||||||
let logind_available = cfg!(feature = "logind") && crate::logind::is_available();
|
|
||||||
|
|
||||||
let flags = Flags {
|
let flags = Flags {
|
||||||
user_icon: user_data
|
user_icon: user_data
|
||||||
.icon_opt
|
.icon_opt
|
||||||
|
|
@ -88,7 +86,10 @@ pub fn main(user: pwd::Passwd) -> Result<(), Box<dyn std::error::Error>> {
|
||||||
.map(widget::image::Handle::from_bytes),
|
.map(widget::image::Handle::from_bytes),
|
||||||
user_data,
|
user_data,
|
||||||
lockfile_opt: lockfile_opt(),
|
lockfile_opt: lockfile_opt(),
|
||||||
logind_available,
|
#[cfg(feature = "logind")]
|
||||||
|
logind_available: crate::logind::is_available(),
|
||||||
|
#[cfg(not(feature = "logind"))]
|
||||||
|
logind_available: false,
|
||||||
};
|
};
|
||||||
|
|
||||||
let settings = Settings::default().no_main_window(true);
|
let settings = Settings::default().no_main_window(true);
|
||||||
|
|
@ -1226,7 +1227,8 @@ impl cosmic::Application for App {
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
|
|
||||||
if cfg!(feature = "logind") && self.flags.logind_available {
|
#[cfg(feature = "logind")]
|
||||||
|
if self.flags.logind_available {
|
||||||
subscriptions.push(crate::logind::subscription());
|
subscriptions.push(crate::logind::subscription());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue