Skip to content

Commit 65f9166

Browse files
committed
Don't prefix save filename with path
It doesn't work well with newer GNOME versions. Unfortunately I'm not aware of any other mechanism to set a default path, so we'll have to leave this up to the user.
1 parent de6fc4c commit 65f9166

File tree

1 file changed

+3
-15
lines changed

1 file changed

+3
-15
lines changed

src/main.rs

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ use client::{RcloneClient, RcloneFileListing};
1717
use components::queue_button::QueueButton;
1818
use components::string_prompt_dialog::{StringPromptDialog, StringPromptDialogInit, StringPromptDialogOutMsg};
1919
use config::AppConfig;
20-
use dirs::{cache_dir, home_dir};
20+
use dirs::cache_dir;
2121
use globals::JOBS;
2222
use model::{RcloneJob, RcloneJobType};
2323
use path_tools::RclonePath;
@@ -1082,22 +1082,10 @@ impl Component for App {
10821082
SaveDialogResponse::Accept(path) => Self::Input::DownloadPathConfirmed(RclonePath::from(&path.into_os_string().into_string().unwrap())),
10831083
SaveDialogResponse::Cancel => Self::Input::NoOperation,
10841084
});
1085-
let mut target_directory: Option<PathBuf> = None;
1086-
if let Some(home_path) = home_dir() {
1087-
let desktop_path = home_path.join("Desktop");
1088-
if desktop_path.exists() {
1089-
target_directory = Some(desktop_path);
1090-
} else {
1091-
target_directory = Some(home_path);
1092-
}
1093-
} let position = self.file_listing_view_wrapper.selection_model.selected();
1085+
let position = self.file_listing_view_wrapper.selection_model.selected();
10941086
if let Some(item) = self.file_listing_view_wrapper.get(position) {
10951087
let selected_remote_item_path = item.borrow().model.path.clone();
1096-
if let Some(target_directory_unwrapped) = target_directory {
1097-
dialog.emit(SaveDialogMsg::SaveAs(target_directory_unwrapped.join(selected_remote_item_path.filename()).into_os_string().into_string().unwrap()));
1098-
} else {
1099-
dialog.emit(SaveDialogMsg::SaveAs(selected_remote_item_path.filename()));
1100-
}
1088+
dialog.emit(SaveDialogMsg::SaveAs(selected_remote_item_path.filename()));
11011089

11021090
self.save_copy_dialog = Some(dialog);
11031091
}

0 commit comments

Comments
 (0)