rnote
rnote copied to clipboard
fix: filters with native file pickers and forcing file extensions
this allows for the filepicker to stay as the native one on windows and, this makes the extension automatically apply on both windows and linux even if the file name doesn't include the extension.
To fix #1114
Some notes
- I think only having one of
filter.add_patternandfilter.add_suffixis enough for it to work - for import, we have to remove the mimetype for the filter to apply with the native file picker on windows but it's a little more restrictive on imports when used on linux. If you want I can set a conditional compilation flag to keep the mimetypes on linux (or at least on non windows targets)
- for the export of doc pages I actually removed the previous fix, but in this case adding a mimetype worked on windows. Also, as it is fundamentally a choice of folders, I don't understand why jpg/pdf/svg filters are added there, seems like an error.
- Tested on windows and linux but not yet on mac os.
I would like to keep the MIME-type based filtering on linux so this is probably better implemented as a windows-specific workaround - at least until it is fixed upstream
Then a in-code comment about this being a temporary workaround and maybe linking the gitlab issue in there would be nice, so that anyone going over this part in the future will know why it is done like that
alright, looks good now!