From: Olaf Wintermann Date: Mon, 13 Jul 2026 19:15:35 +0000 (+0200) Subject: add note type for raw files X-Git-Url: https://uap-core.de/gitweb/?a=commitdiff_plain;ds=sidebyside;p=note.git add note type for raw files --- diff --git a/application/backend/src/backend.rs b/application/backend/src/backend.rs index 0550be8..e22b060 100644 --- a/application/backend/src/backend.rs +++ b/application/backend/src/backend.rs @@ -34,8 +34,6 @@ use sea_orm::{ActiveModelTrait, Database, DatabaseConnection, EntityTrait, Query use tokio::runtime::Runtime; use std::sync::{Arc}; use std::thread::JoinHandle; -use rand::distr::Alphanumeric; -use rand::RngExt; use tokio::fs; use tokio::sync::{broadcast, mpsc}; use tokio::sync::broadcast::error::SendError; diff --git a/application/backend/src/note.rs b/application/backend/src/note.rs index bd2e32d..f83b71d 100644 --- a/application/backend/src/note.rs +++ b/application/backend/src/note.rs @@ -34,6 +34,7 @@ pub fn notetype2ext(t: &NoteType) -> &'static str { match t { NoteType::PlainTextNote => { ".txt" } NoteType::MDTextNote => { ".md" } + NoteType::File => { "" } } } diff --git a/application/note/src/note.rs b/application/note/src/note.rs index 171be4c..6307b1e 100644 --- a/application/note/src/note.rs +++ b/application/note/src/note.rs @@ -152,6 +152,7 @@ impl Note { let tab = match model.kind { NoteType::PlainTextNote => NoteTypeTabView::TextArea, NoteType::MDTextNote => NoteTypeTabView::TextArea, + _ => NoteTypeTabView::Empty }; self.note_type.set(tab as i64); } diff --git a/application/note/src/window.rs b/application/note/src/window.rs index d51bcef..14269ea 100644 --- a/application/note/src/window.rs +++ b/application/note/src/window.rs @@ -297,7 +297,7 @@ fn find_notebook(sourcelist: &UiSourceList, collection_id: i32) -> } pub enum NoteTypeTabView { - _Empty = 0, + Empty = 0, TextArea = 1 } diff --git a/entity/src/note.rs b/entity/src/note.rs index e0d91da..9cf3278 100644 --- a/entity/src/note.rs +++ b/entity/src/note.rs @@ -31,6 +31,7 @@ pub enum NoteType { #[default] PlainTextNote = 0, MDTextNote = 1, + File = 2 } impl ActiveModelBehavior for ActiveModel {}