! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Thunar writes mimeapps.list over every time a file is opened.
Status:
RESOLVED: FIXED

Comments

Description komqinxit 2019-06-02 12:20:33 CEST
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.
Comment 1 Theo Linkspfeifer editbugs 2019-06-03 00:42:08 CEST
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.
Comment 2 Theo Linkspfeifer editbugs 2019-06-04 15:08:10 CEST
Created attachment 8617 
diff

Maybe like this.
Comment 3 alexxcons editbugs 2019-06-06 11:26:27 CEST
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.
Comment 4 Git Bot editbugs 2019-06-15 22:53:24 CEST
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
Comment 5 alexxcons editbugs 2019-06-15 22:56:09 CEST
fixed for master (updated patch) , thanks for your contribution !
Comment 6 Git Bot editbugs 2019-06-17 10:41:45 CEST
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
Comment 7 alexxcons editbugs 2019-06-17 10:42:50 CEST
.. and now as well fixed for 4.14 branch.

Bug #15533

Reported by:
komqinxit
Reported on: 2019-06-02
Last modified on: 2019-06-17

People

Assignee:
Xfce Bug Triage
CC List:
2 users

Version

Attachments

diff (1.60 KB, patch)
2019-06-04 15:08 CEST , Theo Linkspfeifer
no flags

Additional information