Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support files without an extension in XDG portal filters #215

Merged
merged 1 commit into from
Sep 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
- Make `set_parent` require `HasWindowHandle + HasDisplayHandle`
- Add support for `set_parent` in XDG Portals
- Update `ashpd` to 0.9.
- Add support for files without an extension in XDG Portal filters

## 0.14.0
- i18n for GTK and XDG Portal
Expand All @@ -29,18 +30,18 @@
- Fix `FileHandle::inner` (under feature `file-handle-inner`) on wasm

## 0.12.0
- Add title support for WASM (#132)
- Add title support for WASM (#132)
- Add Create folder button to `pick_folder` on macOS (#127)
- Add support for Yes/No/Cancel buttons (#123)
- Change a string method signatures #117
- Change a string method signatures #117
- WASM `save_file` (#134)
- Update `gtk-sys` to `0.18` (#143)
- Update `ashpd` to `0.6` (#133)
- Replace windows with `windows-sys` (#118)
- Replace windows with `windows-sys` (#118)
- Make zenity related deps optional (#141)

## 0.11.3
- Zenity message dialogs for xdg portal backend
- Zenity message dialogs for xdg portal backend

## 0.10.1
- Update `gtk-sys` to `0.16` and `windows-rs` to `0.44`
Expand All @@ -53,8 +54,8 @@
- feat: Add support for selecting multiple folders, fixes #73

## 0.8.4
- XDG: decode URI before converting to PathBuf #70
- XDG: decode URI before converting to PathBuf #70

## 0.8.3
- Windows-rs update 0.37

Expand All @@ -67,7 +68,7 @@

## 0.8.0
- `parent` feature was removed, it is always on now
- New feature `xdg-portal`
- New feature `xdg-portal`
- Now you have to choose one of the features `gtk3` or `xdg-portal`, gtk is on by default
- `window` crate got updated to 0.32

Expand All @@ -79,7 +80,7 @@
- Update `windows` crate to 0.30.

## 0.6.2
- Strip Win32 namespaces from directory paths
- Strip Win32 namespaces from directory paths

## 0.6.0
- FreeBSD support
Expand Down
6 changes: 5 additions & 1 deletion src/backend/xdg_desktop_portal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@ impl From<&Filter> for FileFilter {
fn from(filter: &Filter) -> Self {
let mut ashpd_filter = FileFilter::new(&filter.name);
for file_extension in &filter.extensions {
ashpd_filter = ashpd_filter.glob(&format!("*.{file_extension}"));
if file_extension == "*" || file_extension == "" {
ashpd_filter = ashpd_filter.glob("*");
} else {
ashpd_filter = ashpd_filter.glob(&format!("*.{file_extension}"));
}
}
ashpd_filter
}
Expand Down
Loading