update formats
Some checks are pending
/ test (push) Waiting to run

This commit is contained in:
Chris Cochrun 2025-10-02 13:19:58 -05:00
parent 20843f1b2c
commit 894c68338d
3 changed files with 26 additions and 21 deletions

View file

@ -1,4 +1,8 @@
use std::{borrow::Cow, mem::replace, path::{Path, PathBuf}}; use std::{
borrow::Cow,
mem::replace,
path::{Path, PathBuf},
};
use cosmic::iced::clipboard::mime::{AllowedMimeTypes, AsMimeTypes}; use cosmic::iced::clipboard::mime::{AllowedMimeTypes, AsMimeTypes};
use miette::{IntoDiagnostic, Result, miette}; use miette::{IntoDiagnostic, Result, miette};
@ -44,7 +48,7 @@ impl TryFrom<(Vec<u8>, String)> for KindWrapper {
"application/service-item" => { "application/service-item" => {
ron::de::from_bytes(&data).into_diagnostic() ron::de::from_bytes(&data).into_diagnostic()
} }
_ => Err(miette!("Wrong mime type: {mime}")) _ => Err(miette!("Wrong mime type: {mime}")),
} }
} }
} }

View file

@ -870,7 +870,9 @@ impl cosmic::Application for App {
slide_index, slide_index,
), ),
); );
if let presenter::Action::Task(task) = action { if let presenter::Action::Task(task) =
action
{
tasks.push(task.map(|m| { tasks.push(task.map(|m| {
cosmic::Action::App( cosmic::Action::App(
Message::Present(m), Message::Present(m),
@ -892,13 +894,11 @@ impl cosmic::Application for App {
let action = self.presenter.update(presenter::Message::ActivateSlide(self.current_item.0, self.current_item.1)); let action = self.presenter.update(presenter::Message::ActivateSlide(self.current_item.0, self.current_item.1));
if let presenter::Action::Task( if let presenter::Action::Task(
task, task,
) = action { ) = action
tasks {
.push(task.map(|m| { tasks.push(task.map(|m| {
cosmic::Action::App( cosmic::Action::App(
Message::Present( Message::Present(m),
m,
),
) )
})); }));
} }
@ -924,7 +924,9 @@ impl cosmic::Application for App {
slide_index, slide_index,
), ),
); );
if let presenter::Action::Task(task) = action { if let presenter::Action::Task(task) =
action
{
tasks.push(task.map(|m| { tasks.push(task.map(|m| {
cosmic::Action::App( cosmic::Action::App(
Message::Present(m), Message::Present(m),
@ -961,13 +963,11 @@ impl cosmic::Application for App {
let action = self.presenter.update(presenter::Message::ActivateSlide(self.current_item.0, self.current_item.1)); let action = self.presenter.update(presenter::Message::ActivateSlide(self.current_item.0, self.current_item.1));
if let presenter::Action::Task( if let presenter::Action::Task(
task, task,
) = action { ) = action
tasks {
.push(task.map(|m| { tasks.push(task.map(|m| {
cosmic::Action::App( cosmic::Action::App(
Message::Present( Message::Present(m),
m,
),
) )
})); }));
} }
@ -1056,7 +1056,8 @@ impl cosmic::Application for App {
let (id, spawn_window) = let (id, spawn_window) =
window::open(window::Settings { window::open(window::Settings {
position: Position::Centered, position: Position::Centered,
exit_on_close_request: count.is_multiple_of(2), exit_on_close_request: count
.is_multiple_of(2),
decorations: false, decorations: false,
..Default::default() ..Default::default()
}); });
@ -1797,6 +1798,7 @@ where
vec!["application/service-item".into(), "text/uri-list".into(), "x-special/gnome-copied-files".into()], vec!["application/service-item".into(), "text/uri-list".into(), "x-special/gnome-copied-files".into()],
) )
.on_finish(move |mime, data, _, _, _| { .on_finish(move |mime, data, _, _, _| {
match mime.as_str() { match mime.as_str() {
"application/service-item" => { "application/service-item" => {
let Ok(item) = let Ok(item) =

View file

@ -555,7 +555,6 @@ impl<'a> Library {
}; };
if items.contains(&(kind, index)) { if items.contains(&(kind, index)) {
} else { } else {
items.push((kind, index)); items.push((kind, index));
} }