change uri to path in folder chooser

This commit is contained in:
ochibani 2024-12-08 21:17:27 +02:00
parent d17b5dc80d
commit 28949521be
No known key found for this signature in database
GPG Key ID: 2C6B61CE0C704ED4
2 changed files with 16 additions and 17 deletions

View File

@ -12,6 +12,7 @@ fn default() {
set_default_video_bitrate(&format.to_string()); set_default_video_bitrate(&format.to_string());
set_default_frame(&format.to_string()); set_default_frame(&format.to_string());
} }
set("default", "areacheck", "1"); set("default", "areacheck", "1");
set("default", "audiobitrate", "0"); set("default", "audiobitrate", "0");
set("default", "audio_input_check", "1"); set("default", "audio_input_check", "1");
@ -20,22 +21,20 @@ fn default() {
set("default", "filename", ""); set("default", "filename", "");
set("default", "followmousecheck", "0"); set("default", "followmousecheck", "0");
set("default", "format", "0"); set("default", "format", "0");
set( set("default",
"default",
"folder", "folder",
String::from( &String::from(
glib::get_user_special_dir(glib::UserDirectory::Videos) glib::get_user_special_dir(glib::UserDirectory::Videos)
.unwrap_or_else(|| { .unwrap_or_else(|| {
PathBuf::from( PathBuf::from(
std::env::var("HOME") std::env::var("HOME")
.unwrap_or_else(|_| "/".to_string()) .unwrap_or_else(|_| "/".to_string())
.as_str(), .as_str(),
) )
}) })
.to_str() .to_str()
.unwrap(), .unwrap(),
) )
.as_str(),
); );
set("default", "hidecheck", "0"); set("default", "hidecheck", "0");
set("default", "mode", "screen"); set("default", "mode", "screen");

View File

@ -474,11 +474,11 @@ fn build_ui(application: &Application, error_dialog: MessageDialog, error_messag
folder_chooser_native.set_transient_for(Some(&main_window)); folder_chooser_native.set_transient_for(Some(&main_window));
folder_chooser_native.set_modal(true); folder_chooser_native.set_modal(true);
folder_chooser_native folder_chooser_native
.set_file(&File::for_uri(&config_management::get( .set_file(&File::for_path(&config_management::get(
"default", "folder", "default", "folder",
))) )))
.unwrap(); .unwrap();
let folder_chooser = Some(File::for_uri(&config_management::get( let folder_chooser = Some(File::for_path(&config_management::get(
"default", "folder", "default", "folder",
))) )))
.unwrap(); .unwrap();