diff --git a/melib/src/backends/imap/watch.rs b/melib/src/backends/imap/watch.rs index b827300d..05af897e 100644 --- a/melib/src/backends/imap/watch.rs +++ b/melib/src/backends/imap/watch.rs @@ -477,7 +477,6 @@ fn examine_updates( *v = ok.uidvalidity; } } else { - // FIXME: Handle this case in ui/src/conf/accounts.rs sender.send(RefreshEvent { hash: folder_hash, kind: RefreshEventKind::Rescan, diff --git a/ui/src/components/mail/listing/thread.rs b/ui/src/components/mail/listing/thread.rs index 6003a7cc..77bb3331 100644 --- a/ui/src/components/mail/listing/thread.rs +++ b/ui/src/components/mail/listing/thread.rs @@ -250,7 +250,6 @@ impl ThreadListing { if !(self.cursor_pos.0 == self.new_cursor_pos.0 && self.cursor_pos.1 == self.new_cursor_pos.1) { - //TODO: store cursor_pos in each folder self.cursor_pos.2 = 0; self.new_cursor_pos.2 = 0; } @@ -451,15 +450,14 @@ impl ThreadListing { s.push('>'); } + s.push_str(if envelope.has_attachments() { + "📎" + } else { + "" + }); if show_subject { s.push_str(&format!("{:.85}", envelope.subject())); } - /* TODO Very slow since we have to build all attachments - let attach_count = envelope.body(op).count_attachments(); - if attach_count > 1 { - s.push_str(&format!(" {}∞ ", attach_count - 1)); - } - */ s } fn format_date(envelope: &Envelope) -> String { diff --git a/ui/src/conf/accounts.rs b/ui/src/conf/accounts.rs index 35869b59..5e07df8b 100644 --- a/ui/src/conf/accounts.rs +++ b/ui/src/conf/accounts.rs @@ -166,30 +166,37 @@ pub struct Account { impl Drop for Account { fn drop(&mut self) { - //TODO: Avoid panics - let data_dir = xdg::BaseDirectories::with_profile("meli", &self.name).unwrap(); - if let Ok(data) = data_dir.place_data_file("addressbook") { - /* place result in cache directory */ - let f = match fs::File::create(data) { - Ok(f) => f, - Err(e) => { - panic!("{}", e); - } + if let Ok(data_dir) = xdg::BaseDirectories::with_profile("meli", &self.name) { + if let Ok(data) = data_dir.place_data_file("addressbook") { + /* place result in cache directory */ + let f = match fs::File::create(data) { + Ok(f) => f, + Err(e) => { + eprintln!("{}", e); + return; + } + }; + let writer = io::BufWriter::new(f); + if let Err(err) = serde_json::to_writer(writer, &self.address_book) { + eprintln!("{}", err); + return; + }; }; - let writer = io::BufWriter::new(f); - serde_json::to_writer(writer, &self.address_book).unwrap(); - }; - if let Ok(data) = data_dir.place_data_file("mailbox") { - /* place result in cache directory */ - let f = match fs::File::create(data) { - Ok(f) => f, - Err(e) => { - panic!("{}", e); - } + if let Ok(data) = data_dir.place_data_file("mailbox") { + /* place result in cache directory */ + let f = match fs::File::create(data) { + Ok(f) => f, + Err(e) => { + eprintln!("{}", e); + return; + } + }; + let writer = io::BufWriter::new(f); + if let Err(err) = bincode::serialize_into(writer, &self.folders) { + eprintln!("{}", err); + }; }; - let writer = io::BufWriter::new(f); - bincode::serialize_into(writer, &self.folders).unwrap(); - }; + } } } diff --git a/ui/src/terminal/cells.rs b/ui/src/terminal/cells.rs index 79ce13e4..bc9c1362 100644 --- a/ui/src/terminal/cells.rs +++ b/ui/src/terminal/cells.rs @@ -641,7 +641,6 @@ pub enum Attr { BoldReverseUnderline = 0b111, } -// TODO: word break. pub fn copy_area_with_break( grid_dest: &mut CellBuffer, grid_src: &CellBuffer,