chore: make dbus-config optional

Also fixes some lints.
This commit is contained in:
Vukašin Vojinović 2025-09-13 11:00:48 +02:00 committed by Jeremy Soller
parent 6d9cd3e7e5
commit 131cf7e8cd
6 changed files with 123 additions and 90 deletions

View file

@ -1616,7 +1616,7 @@ impl App {
Task::none()
}
fn network_drive(&self) -> Element<Message> {
fn network_drive(&self) -> Element<'_, Message> {
let cosmic_theme::Spacing {
space_xxs, space_m, ..
} = theme::active().cosmic().spacing;
@ -1647,7 +1647,7 @@ impl App {
.into()
}
fn desktop_view_options(&self) -> Element<Message> {
fn desktop_view_options(&self) -> Element<'_, Message> {
let cosmic_theme::Spacing {
space_m, space_l, ..
} = theme::active().cosmic().spacing;
@ -1729,7 +1729,7 @@ impl App {
.into()
}
fn edit_history(&self) -> Element<Message> {
fn edit_history(&self) -> Element<'_, Message> {
let cosmic_theme::Spacing { space_m, .. } = theme::active().cosmic().spacing;
let mut children = Vec::new();
@ -1879,7 +1879,7 @@ impl App {
.into()
}
fn settings(&self) -> Element<Message> {
fn settings(&self) -> Element<'_, Message> {
let tab_config = self.config.tab;
// TODO: Should dialog be updated here too?
@ -2195,7 +2195,7 @@ impl Application for App {
(app, Task::batch(commands))
}
fn nav_bar(&self) -> Option<Element<cosmic::Action<Self::Message>>> {
fn nav_bar(&self) -> Option<Element<'_, cosmic::Action<Self::Message>>> {
if !self.core.nav_bar_active() {
return None;
}
@ -4687,7 +4687,7 @@ impl Application for App {
Task::none()
}
fn context_drawer(&self) -> Option<context_drawer::ContextDrawer<Message>> {
fn context_drawer(&self) -> Option<context_drawer::ContextDrawer<'_, Message>> {
if !self.core.window.show_context {
return None;
}
@ -4755,7 +4755,7 @@ impl Application for App {
})
}
fn dialog(&self) -> Option<Element<Message>> {
fn dialog(&self) -> Option<Element<'_, Message>> {
//TODO: should gallery view just be a dialog?
let entity = self.tab_model.active();
if let Some(tab) = self.tab_model.data::<Tab>(entity) {
@ -5455,7 +5455,7 @@ impl Application for App {
Some(dialog.into())
}
fn footer(&self) -> Option<Element<Message>> {
fn footer(&self) -> Option<Element<'_, Message>> {
if self.progress_operations.is_empty() {
return None;
}
@ -5568,7 +5568,7 @@ impl Application for App {
Some(container.into())
}
fn header_start(&self) -> Vec<Element<Self::Message>> {
fn header_start(&self) -> Vec<Element<'_, Self::Message>> {
vec![menu::menu_bar(
&self.core,
self.tab_model.active_data::<Tab>(),
@ -5578,7 +5578,7 @@ impl Application for App {
)]
}
fn header_end(&self) -> Vec<Element<Self::Message>> {
fn header_end(&self) -> Vec<Element<'_, Self::Message>> {
let mut elements = Vec::with_capacity(2);
if let Some(term) = self.search_get() {
@ -5614,7 +5614,7 @@ impl Application for App {
}
/// Creates a view after each update.
fn view(&self) -> Element<Self::Message> {
fn view(&self) -> Element<'_, Self::Message> {
let cosmic_theme::Spacing {
space_xxs, space_s, ..
} = theme::active().cosmic().spacing;
@ -5680,7 +5680,7 @@ impl Application for App {
content
}
fn view_window(&self, id: WindowId) -> Element<Self::Message> {
fn view_window(&self, id: WindowId) -> Element<'_, Self::Message> {
let content = match self.windows.get(&id) {
Some(WindowKind::ContextMenu(entity, id)) => {
match self.tab_model.data::<Tab>(*entity) {

View file

@ -375,7 +375,7 @@ impl<M: Send + 'static> Dialog<M> {
}
}
pub fn view(&self, window_id: window::Id) -> Element<M> {
pub fn view(&self, window_id: window::Id) -> Element<'_, M> {
self.cosmic
.view(window_id)
.map(DialogMessage)
@ -518,7 +518,7 @@ struct App {
}
impl App {
fn button_view(&self) -> Element<Message> {
fn button_view(&self) -> Element<'_, Message> {
let cosmic_theme::Spacing {
space_xxxs,
space_xxs,
@ -991,7 +991,7 @@ impl Application for App {
(app, commands)
}
fn context_drawer(&self) -> Option<context_drawer::ContextDrawer<Message>> {
fn context_drawer(&self) -> Option<context_drawer::ContextDrawer<'_, Message>> {
if !self.core.window.show_context {
return None;
}
@ -1022,7 +1022,7 @@ impl Application for App {
}
}
fn dialog(&self) -> Option<Element<Message>> {
fn dialog(&self) -> Option<Element<'_, Message>> {
let cosmic_theme::Spacing { space_xxs, .. } = theme::active().cosmic().spacing;
//TODO: should gallery view just be a dialog?
@ -1122,11 +1122,11 @@ impl Application for App {
Some(dialog.into())
}
fn footer(&self) -> Option<Element<Message>> {
fn footer(&self) -> Option<Element<'_, Message>> {
Some(self.button_view())
}
fn header_end(&self) -> Vec<Element<Message>> {
fn header_end(&self) -> Vec<Element<'_, Message>> {
let mut elements = Vec::with_capacity(3);
if let Some(term) = self.search_get() {
@ -1177,7 +1177,7 @@ impl Application for App {
elements
}
fn nav_bar(&self) -> Option<Element<cosmic::Action<Self::Message>>> {
fn nav_bar(&self) -> Option<Element<'_, cosmic::Action<Self::Message>>> {
if !self.core().nav_bar_active() {
return None;
}
@ -1879,7 +1879,7 @@ impl Application for App {
}
/// Creates a view after each update.
fn view(&self) -> Element<Message> {
fn view(&self) -> Element<'_, Message> {
let cosmic_theme::Spacing { space_xxs, .. } = theme::active().cosmic().spacing;
let mut col = widget::column::with_capacity(2);

View file

@ -2070,7 +2070,7 @@ impl Item {
}
}
pub fn preview_header(&self) -> Vec<Element<Message>> {
pub fn preview_header(&self) -> Vec<Element<'_, Message>> {
let mut row = Vec::with_capacity(3);
row.push(
widget::button::icon(widget::icon::from_name("go-previous-symbolic"))
@ -4167,7 +4167,7 @@ impl Tab {
container.into()
}
pub fn gallery_view(&self) -> Element<Message> {
pub fn gallery_view(&self) -> Element<'_, Message> {
let cosmic_theme::Spacing {
space_xxs,
space_xs,
@ -4298,7 +4298,7 @@ impl Tab {
.into()
}
pub fn location_view(&self) -> Element<Message> {
pub fn location_view(&self) -> Element<'_, Message> {
//TODO: responsiveness is done in a hacky way, potentially move this to a custom widget?
fn text_width<'a>(
content: &'a str,
@ -4648,7 +4648,7 @@ impl Tab {
popover.into()
}
pub fn empty_view(&self, has_hidden: bool) -> Element<Message> {
pub fn empty_view(&self, has_hidden: bool) -> Element<'_, Message> {
let cosmic_theme::Spacing { space_xxs, .. } = theme::active().cosmic().spacing;
mouse_area::MouseArea::new(widget::column::with_children(vec![
@ -4680,7 +4680,13 @@ impl Tab {
.into()
}
pub fn grid_view(&self) -> (Option<Element<'static, Message>>, Element<Message>, bool) {
pub fn grid_view(
&self,
) -> (
Option<Element<'static, Message>>,
Element<'_, Message>,
bool,
) {
let cosmic_theme::Spacing {
space_xxs,
space_xxxs,
@ -5014,7 +5020,13 @@ impl Tab {
(drag_list, mouse_area.into(), true)
}
pub fn list_view(&self) -> (Option<Element<'static, Message>>, Element<Message>, bool) {
pub fn list_view(
&self,
) -> (
Option<Element<'static, Message>>,
Element<'_, Message>,
bool,
) {
let cosmic_theme::Spacing {
space_s, space_xxs, ..
} = theme::active().cosmic().spacing;
@ -5404,7 +5416,7 @@ impl Tab {
&self,
key_binds: &HashMap<KeyBind, Action>,
size: Size,
) -> Element<Message> {
) -> Element<'_, Message> {
// Update cached size
self.size_opt.set(Some(size));