elementary / switchboard-plug-applications

Switchboard Applications Plug
https://elementary.io
GNU General Public License v3.0
14 stars 12 forks source link

Ensure app set as default only for supported types #166

Closed jeremypw closed 3 years ago

jeremypw commented 3 years ago

Fixes #164

This PR removes some code that did not seem to serve a useful purpose and was responsible for the linked issue by setting the chosen app as default for types it did not support or were irrelevant by transferring all supported types from the previous default app.

This PR also ensures that type associations are reset before assigning a new default app as it was noticed that the AppChooserButton could otherwise show apps that were not appropriate (did not support the type) if at some point they had been made default for the type (e.g. using FIles or otherwise).

If anyone knows what the original intention of the removed code was please let me know.

jeremypw commented 3 years ago

It was noted that, in the case of the "Web Browser" type at least, some of the types returned by get_types_for_app () were not supported. Different browsers support different combinations of types. Unsupported types will get opened by a fallback app I guess.