update recently used on dialog open
This commit is contained in:
parent
dc5842e5d5
commit
da52e8aa6e
1 changed files with 8 additions and 1 deletions
|
|
@ -25,6 +25,7 @@ use notify_debouncer_full::{
|
|||
notify::{self, RecommendedWatcher, Watcher},
|
||||
DebouncedEvent, Debouncer, FileIdMap,
|
||||
};
|
||||
use recently_used_xbel::update_recently_used;
|
||||
use std::{
|
||||
any::TypeId,
|
||||
collections::{HashMap, HashSet},
|
||||
|
|
@ -440,7 +441,7 @@ impl Application for App {
|
|||
let accept_label = flags.kind.accept_label();
|
||||
|
||||
let mut nav_model = segmented_button::ModelBuilder::default();
|
||||
|
||||
|
||||
nav_model = nav_model.insert(move |b| {
|
||||
b.text(fl!("recents"))
|
||||
.icon(widget::icon::from_name("accessories-clock-symbolic").size(16))
|
||||
|
|
@ -673,6 +674,12 @@ impl Application for App {
|
|||
if item.selected {
|
||||
if let Some(path) = &item.path_opt {
|
||||
paths.push(path.clone());
|
||||
let _ = update_recently_used(
|
||||
&path.clone(),
|
||||
App::APP_ID.to_string(),
|
||||
"cosmic-files".to_string(),
|
||||
None,
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue