rnote icon indicating copy to clipboard operation
rnote copied to clipboard

fix: filters with native file pickers and forcing file extensions

Open Doublonmousse opened this issue 1 year ago • 1 comments

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_pattern and filter.add_suffix is 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.

Doublonmousse avatar Jun 08 '24 13:06 Doublonmousse

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

flxzt avatar Jun 09 '24 05:06 flxzt

alright, looks good now!

flxzt avatar Jul 06 '24 17:07 flxzt