aboutsummaryrefslogtreecommitdiff
path: root/src/app.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/app.rs')
-rw-r--r--src/app.rs27
1 files changed, 20 insertions, 7 deletions
diff --git a/src/app.rs b/src/app.rs
index f751716..15cdfe3 100644
--- a/src/app.rs
+++ b/src/app.rs
@@ -350,7 +350,19 @@ impl App {
entry.filepath.unwrap().iter().for_each(|p| {
items.push((
"File (PDF/EPUB): ".into(),
- p.clone().into_string().unwrap(),
+ // p.clone().into_string().unwrap(),
+ if entry.file_field && cfg.general.file_prefix.is_some() {
+ cfg.general
+ .file_prefix
+ .clone()
+ .unwrap()
+ .join(p)
+ .into_os_string()
+ .into_string()
+ .unwrap()
+ } else {
+ p.clone().into_string().unwrap()
+ },
))
});
}
@@ -360,7 +372,7 @@ impl App {
} else {
self.bibiman.open_popup(
PopupKind::MessageError,
- Some("Selected entry has no connected ressources: "),
+ Some("Selected entry has no connected resources: "),
Some(&entry.citekey),
None,
)?;
@@ -389,11 +401,12 @@ pub fn open_connected_file(cfg: &BibiConfig, file: &OsStr) -> Result<()> {
// Build command to execute pdf-reader. 'xdg-open' is Linux standard
let cmd = &cfg.general.pdf_opener;
// If necessary, replace ~ with /home dir
- let file = if cfg.general.file_prefix.is_some() {
- cfg.general.file_prefix.clone().unwrap().join(file)
- } else {
- PathBuf::from(file)
- };
+ // let file = if cfg.general.file_prefix.is_some() {
+ // cfg.general.file_prefix.clone().unwrap().join(file)
+ // } else {
+ // PathBuf::from(file)
+ // };
+ let file = PathBuf::from(file);
let file = expand_home(&file).into_os_string();