Add support for drag and drop files in Windows (#1953)

* Add support for drag and drop files in Windows

* Add two drag and drop filename quoting patterns (mainly) for Windows, change doc examples.

* Code style cleanup

* Improve Windows quoting pattern and rename DoubleQuoteAlways to WindowsAlwaysQuoted

* Improve special char finding for DroppedFileQuoting::Windows and fix doc.
This commit is contained in:
datasone authored and GitHub committed 2022-05-09 07:38:52 -07:00
1 parent 7858f652fb
commit 74e1cdcb40
3 files changed
+67 -9

No files matched your search

+12 -8
View File
@@ -3,25 +3,29 @@
*Since: nightly builds only*
Controls how file names are quoted (or not) when dragging and dropping.
There are three possible values:
There are five possible values:
* `"None"` - no quoting is performed, the file name is passed through as-is.
* `"SpacesOnly"` - backslash-escape only spaces, leaving all other characters as-is. This is the default.
* `"SpacesOnly"` - backslash-escape only spaces, leaving all other characters as-is. This is the default for non-Windows platforms.
* `"Posix"` - use POSIX style shell word escaping.
* `"Windows"` - use Windows style shell word escaping: double-quote filename with space characters in it, and leaving others as-is. This is the default on Windows.
* `"WindowsAlwaysQuoted"` - like `"Windows"`, while always double-quote the filename.
For example:
|`quote_dropped_files` |file name |quoted result |
|----------------------|-------------|---------------|
|`"None"` |`hello world`|`hello world` |
|`"SpacesOnly"` |`hello world`|`hello\ world` |
|`"Posix"` |`hello world`|`"hello world"`|
| `quote_dropped_files` | file name | quoted result |
|-------------------------|------------------|---------------------|
| `"None"` | `hello ($world)` | `hello ($world)` |
| `"SpacesOnly"` | `hello ($world)` | `hello\ ($world)` |
| `"Posix"` | `hello ($world)` | `"hello (\$world)"` |
| `"Windows"` | `hello ($world)` | `"hello ($world)"` |
| `"WindowsAlwaysQuoted"` | `hello ($world)` | `"hello ($world)"` |
Drag and drop support for files is a platform dependent feature
|Platform |Supported since |
|----------|-------------------|
|macOS |nightly builds only|
|Windows |Not yet |
|Windows |nightly builds only|
|X11 |Not yet |
|Wayland |Not yet |