From: Olaf Wintermann Date: Sun, 6 Sep 2026 11:03:20 +0000 (+0200) Subject: fix some warnings X-Git-Url: https://uap-core.de/gitweb/?a=commitdiff_plain;h=refs%2Fheads%2Fmain;p=note.git fix some warnings --- diff --git a/application/note/src/attachments_window.rs b/application/note/src/attachments_window.rs index 58a1a44..b53e462 100644 --- a/application/note/src/attachments_window.rs +++ b/application/note/src/attachments_window.rs @@ -83,9 +83,9 @@ pub struct AttachmentsWindow { pub webview: UiWeb, } -struct Attachment { - attachment: entity::attachment::Model, - content: Option +pub struct Attachment { + pub attachment: entity::attachment::Model, + pub content: Option } impl Attachment { @@ -119,7 +119,7 @@ impl AttachmentsWindow { let proxy = obj.obj_proxy(); self.backend.get_note_attachments(self.note_id, move|result|{ - proxy.call_mainthread(move |doc, wdata|{ + proxy.call_mainthread(move |_doc, wdata|{ match result { Ok(attachments) => { println!("attachments loaded"); @@ -147,10 +147,12 @@ impl AttachmentsWindow { } pub fn show_attachment(&mut self, index: usize) { - let a = self.attachments.get(index); if let Some(attachment) = self.attachments.get(index) { if let Some(content) = &attachment.content { - self.image.image_load_data(&content.content); + let result = self.image.image_load_data(&content.content); + if result.is_err() { + println!("Cannot load image"); + } } } } @@ -171,7 +173,7 @@ impl AttachmentsWindow { let proxy = obj.obj_proxy(); let attachment_id = a?.attachment.attachment_id; self.backend.get_attachment_content(attachment_id, move|result|{ - proxy.call_mainthread(move |doc, wdata|{ + proxy.call_mainthread(move |_doc, wdata|{ match result { Ok(content) => { let a = wdata.attachments.get_mut(index); diff --git a/application/note/src/window.rs b/application/note/src/window.rs index 076595b..4ac0ca1 100644 --- a/application/note/src/window.rs +++ b/application/note/src/window.rs @@ -289,13 +289,13 @@ pub fn create_window(app: &App, ctx: &AppContext) -> UiObject() .varname("note_attachments") .container(SubContainer::HBox) - .createui(|obj, wdata, at, _i|{ - let note_id = at.attachment.note_id; - let attachment_id = at.attachment.attachment_id; + .createui(|obj, _wdata, attachment, _i|{ + let note_id = attachment.attachment.note_id; + let attachment_id = attachment.attachment.attachment_id; let imgviewer = imageviewer!(obj, scrollview = false, @@ -304,7 +304,7 @@ pub fn create_window(app: &App, ctx: &AppContext) -> UiObject