Wunderfitz / harbour-fernschreiber

Fernschreiber is a Telegram client for Sailfish OS
GNU General Public License v3.0
42 stars 33 forks source link

fernschreiber overrides https:/ and tg:/ mime handlers #151

Open elros34 opened 3 years ago

elros34 commented 3 years ago

After first start fernschreiber creates harbour-fernschreiber-open-url.desktop in ~/.local/share/applications and run update-desktop-database as user thus all mime handlers which use x-scheme-handler/https (some apps) or x-scheme-handler/tg (depecher) and are installed in /usr/share/applications/ are now ignored by xdg-open and Open file dialog. Also removing application doesn't clean up mess in ~/.local/share/applications/ directory.

I know this is old way to fool harbour rules used by some apps but please do not enable such a behavior by default.

Wunderfitz commented 3 years ago

Yep, a well-known issue - sorry for the inconvenience! Ideally, Jolla comes up with a solution to integrate properly with the MIME handlers in a Harbour-compatible way without harming other apps. But as that's unlikely we probably need to find a proper solution which everybody can live with:

  1. Fernschreiber would probably need to ask before actually adding itself to the MIME types
  2. If it does integrate, the existing ones from the main directories should be copied over to keep on working, right? (I'm anyway wondering why the different valid XDG directories are not merged by the system)

However, from my point of view there are still open questions:

Until this is fixed entirely, there is the possibility to remove the changes made by Fernschreiber by going to its Settings and uncheck the "Integration with Open-With menu" option. If there are still problems, you can try https://openrepos.net/content/llelectronics/mimer

elros34 commented 3 years ago

A few popular apps use same approach so I don't see any proper solution except merging mimeinfo.cache from both directories (maybe also /usr/local/share/applications/) in libcontentaction. Asking about adding fernschreiber to MIME types at first start or just keep it false by default is perfectly fine solution for me.

If you really want to handle it for all cases and don't plan do upload it to harbour then yes copying is the workaround

~/.local/share/applications/mimeinfo.cache takes precedence of /usr/share/applications/mimeinfo.cache so installing other apps which register https will not help.

jgibbon commented 3 years ago

This seems to belong to a bunch of related issues: #151, #276, #312, #412 (this comment is copied to all of them) Proposed way to hopefully fix most of them: