Thunar writes ~/.config/mimeapps.list over every time a file is opened with Thunar. Nothing changes, no new mime associations, but Thunar writes mimeapps.list over every time.
https://git.xfce.org/xfce/thunar/commit/?id=5df98970639d472733910a391ddf186497bf8d03 The last used application is always updated, even when nothing has changed. This could be prevented by doing a check with g_app_info_get_recommended_for_type() first.
Created attachment 8617 diff Maybe like this.
Thanks for reporting & for the patch (though Theo, you meanwhile should know that "git format-patch" is the way to go :P ) Some improvements are needed: > * thunar_file_get_default_handler: > * @file : a #ThunarFile instance. > * > * Returns the default #GAppInfo for @file or %NULL if there is none. So a NULL check is required to prevent seg faults. > GList * >g_app_info_get_recommended_for_type (const gchar *content_type); > .... > Returns > > GList of GAppInfos for given content_type or NULL on error. Same here. Could you please add these checks ? As well it would be nice to have a comment, telling that the first entry of "g_app_info_get_recommended_for_type()" is the last used application.
Theo Linkspfeifer referenced this bugreport in commit 36a57d6cfe7493d031b616f92eb52eaff38c9a77 Update mimeapps.list only when necessary (Bug #15533) https://git.xfce.org/xfce/thunar/commit?id=36a57d6cfe7493d031b616f92eb52eaff38c9a77
fixed for master (updated patch) , thanks for your contribution !
Theo Linkspfeifer referenced this bugreport in commit 1dbc13db4bd249adf7a43c9cf54510731bef6ca1 Update mimeapps.list only when necessary (Bug #15533) https://git.xfce.org/xfce/thunar/commit?id=1dbc13db4bd249adf7a43c9cf54510731bef6ca1
.. and now as well fixed for 4.14 branch.