Skip to content

Commit

Permalink
Implement FileDialog.starting_directory for xdg desktop portal back…
Browse files Browse the repository at this point in the history
…end (#179)
  • Loading branch information
theRookieCoder committed Feb 21, 2024
1 parent 8646b50 commit 4271d21
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/backend/xdg_desktop_portal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ impl AsyncFilePickerDialogImpl for FileDialog {
.multiple(false)
.title(self.title.as_deref().or(None))
.filters(self.filters.iter().map(From::from))
.current_folder::<&PathBuf>(&self.starting_directory)
.expect("File path should not be nul-terminated")
.send()
.await;

Expand Down Expand Up @@ -78,6 +80,8 @@ impl AsyncFilePickerDialogImpl for FileDialog {
.multiple(true)
.title(self.title.as_deref().or(None))
.filters(self.filters.iter().map(From::from))
.current_folder::<&PathBuf>(&self.starting_directory)
.expect("File path should not be nul-terminated")
.send()
.await;

Expand Down Expand Up @@ -130,6 +134,8 @@ impl AsyncFolderPickerDialogImpl for FileDialog {
.directory(true)
.title(self.title.as_deref().or(None))
.filters(self.filters.iter().map(From::from))
.current_folder::<&PathBuf>(&self.starting_directory)
.expect("File path should not be nul-terminated")
.send()
.await;

Expand Down Expand Up @@ -162,6 +168,8 @@ impl AsyncFolderPickerDialogImpl for FileDialog {
.directory(true)
.title(self.title.as_deref().or(None))
.filters(self.filters.iter().map(From::from))
.current_folder::<&PathBuf>(&self.starting_directory)
.expect("File path should not be nul-terminated")
.send()
.await;

Expand Down

0 comments on commit 4271d21

Please sign in to comment.