After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 667138 - Preferred applications display gedit as calendar
Preferred applications display gedit as calendar
Status: RESOLVED OBSOLETE
Product: gtk+
Classification: Platform
Component: Widget: GtkAppChooser
3.2.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
Cosimo Cecchi
Depends on:
Blocks:
 
 
Reported: 2012-01-02 15:33 UTC by sam_
Modified: 2018-05-02 15:16 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description sam_ 2012-01-02 15:33:27 UTC
Evolution and Thunderbird aren't installed.
Monthly calendar view in indicator-datetime can be en- or disabled.
Open g-c-c, system-information (renamed to 'Details' gnome-bugs 661696), click on preferred applications, the value for calendar is 'gedit'.
Expected:
Leave the value empty or recognize other calendar apps, e.g. Osmo.

First reported there.
https://bugs.launchpad.net/ubuntu/+source/gnome-control-center/+bug/910872
Comment 1 sam_ 2012-01-03 01:59:53 UTC
Correction, above LP bug is a dupe, the first one reported is there.
https://bugs.launchpad.net/ubuntu/+source/gnome-control-center/+bug/841409
Comment 2 Bastien Nocera 2012-01-06 15:36:25 UTC
You can see the list of recommended and all available applications to handle a particular mime-type (text/calendar) for the case of a calendar using:

gvfs-mime --query text/calendar

(after that commit: http://git.gnome.org/browse/gvfs/commit/?id=6f485b42a7172e3604ea0eec937bbe0553a76db5)

If you see gedit.desktop listed in the recommended applications then it's a bug in the gedit package.

(In reply to comment #0)
<snip>
> Leave the value empty or recognize other calendar apps, e.g. Osmo.

They just need to advertise text/calendar as a supported type.
Comment 3 Sebastien Bacher 2012-01-06 16:38:08 UTC
Bastien, isn't that issue the same than bug #661659

"> calendar: gedit (?!)

text/calendar is a subclass of text/plain, which is why gedit would be handling
it. I suspect that there is a bug in the app chooser combo box.

I requested the output of:
gvfs-mime --query text/calendar

which should show whether evolution is an option. Might be missing a desktop
mime update in the evo package?
...
gvfs-mime --query text/calendar
Default application for 'text/calendar': gedit.desktop
Registered applications:
    gedit.desktop
    evolution.desktop"


if you remove evolution and install tb you get actually no calendar and that combo should probably be unactive rather that listing gedit but that's corner case...
Comment 4 Bastien Nocera 2012-01-06 16:47:05 UTC
(In reply to comment #3)
> Bastien, isn't that issue the same than bug #661659

Pretty much

> "> calendar: gedit (?!)
> 
> text/calendar is a subclass of text/plain, which is why gedit would be handling
> it. I suspect that there is a bug in the app chooser combo box.

No. The app chooser button we use calls g_app_info_get_recommended_for_type("text/calendar") which is defined as:
"
Gets a list of recommended GAppInfos for a given content type, i.e. those applications which claim to support the given content type exactly, and not by MIME type subclassing. Note that the first application of the list is the last used one, i.e. the last one for which g_app_info_set_as_last_used_for_type has been called.
"

> 
> I requested the output of:
> gvfs-mime --query text/calendar
> 
> which should show whether evolution is an option. Might be missing a desktop
> mime update in the evo package?
> ...
> gvfs-mime --query text/calendar
> Default application for 'text/calendar': gedit.desktop
> Registered applications:
>     gedit.desktop
>     evolution.desktop"

Missing the patch I mentioned above to list the recommended apps. The recommended apps is all that's shown.

> if you remove evolution and install tb you get actually no calendar and that
> combo should probably be unactive rather that listing gedit but that's corner
> case...

In any case, it's not a bug in gnome-control-center, or the app chooser.
Comment 5 Sebastien Bacher 2012-01-06 17:30:39 UTC
on my GNOME 3.2 system with the gvfs patch to get the infos:

"$ ./gvfs-mime --query text/calendar
Default application for 'text/calendar': evolution.desktop
Registered applications:
	evolution.desktop
	gedit.desktop
	gobby-0.5.desktop"

the g-c-c combo lists evolution and gedit as calendar choices, evolution being the default one
Comment 6 Sebastien Bacher 2012-01-06 17:36:02 UTC
sorry copied the wrong output:

$ ./gvfs-mime --query text/calendar
Default application for 'text/calendar': evolution.desktop
Registered applications:
	evolution.desktop
	gedit.desktop
	gobby-0.5.desktop
Recommended applications:
	evolution.desktop
	gedit.desktop
Comment 7 Sebastien Bacher 2012-01-06 17:44:46 UTC
Ok some details:

- the "recommended" gedit was coming from .local/share/applications/mimeapps.list, probably written by an old version of g-c-c,glib before the fixes that went in 3.2 (it was added to the add applications section

- we have in Ubuntu a bug similar to the one you fixed in fedora (evolution is not set as default for the text/calendar type in defaults.list)

- if you have no default set for the type and run gnome-control-center dialog "gedit" is listed and selected by default, when that happens 

"$ ./gvfs-mime --query text/calendar
Default application for 'text/calendar': gedit.desktop
Registered applications:
	gedit.desktop
	evolution.desktop
	gobby-0.5.desktop
Recommended applications:
	evolution.desktop"

gedit is not listed in the recommended applications

- if you select evolution, close the dialog and go back only evolution is listed

so the bug seems to happen only when evolution is not set as default in defaults.list
Comment 8 Sebastien Bacher 2012-01-06 17:47:16 UTC
ok, another set of infos:

if you move evolution.desktop away from the xdg path:

$ ./gvfs-mime --query text/calendar
Default application for 'text/calendar': gedit.desktop
Registered applications:
	gedit.desktop
	gobby-0.5.desktop

then open g-c-c info, gedit is listed in the combo (and only it)

then if gedit.desktop is moved away gobby is listed
Comment 9 sam_ 2012-01-06 21:12:36 UTC
Outputs in Oneiric and Precise are the same:
~$ gvfs-mime --query text/calendar
Default application for 'text/calendar': gedit.desktop
Registered applications:
	gedit.desktop

Same with:
~$ xdg-mime query default text/plain
gedit.desktop

The /etc/gnome/defaults.list doesn't content calendar or evolution.
It contents (among others):
text/plain=gedit.desktop
x-scheme-handler/mailto=thunderbird.desktop

In Oneirc the ~/.local/share/applications/mimeapps.list only contents:
[Added Associations]
application/x-shellscript=gedit.desktop;
application/x-trash=gedit.desktop;
text/css=gedit.desktop;
text/plain=gedit.desktop;

In Precise it contents among others:
text/calendar=gedit.desktop;evolution.desktop;

Removing gedit.desktop makes no change in g-c-c.

Who does register gedit as calendar, gedit itself?
Comment 10 Bastien Nocera 2012-01-09 14:17:27 UTC
The problem is that gtkappchooserbutton.c adds the recommended apps, as well as the default app. The recommended apps are the ones that match text/calendar exactly.

The problem comes when adding the default app with g_app_info_get_default_for_type() which will also look in the sub-classes for a match, as evolution isn't available. We want the default app being shown, but only if it's explicitely set, and it matches exactly the content type.

So, in gtkappchooserbutton.c's gtk_app_chooser_button_populate(), we would only add default_app to the popup if it's listed in recommended_apps).

Cosimo, opinion?
Comment 11 Cosimo Cecchi 2012-01-10 16:18:20 UTC
(In reply to comment #10)

> The problem comes when adding the default app with
> g_app_info_get_default_for_type() which will also look in the sub-classes for a
> match, as evolution isn't available. We want the default app being shown, but
> only if it's explicitely set, and it matches exactly the content type.
> 
> So, in gtkappchooserbutton.c's gtk_app_chooser_button_populate(), we would only
> add default_app to the popup if it's listed in recommended_apps).

Yeah, this makes sense to me and would fix the bug.
We should still make sure to display something meaningful in the combobox even in the case where there are no recommended apps available though (maybe making the combobox insensitive with a "No applications available" string?)
Comment 12 Karl Fischer 2015-05-14 12:57:29 UTC
I can confirm that the bug is still here.
Comment 13 Eino Väisänen 2017-06-03 17:08:50 UTC
Why this bug is still not fixed (after five years)? You won't find bugs like this in MacOS or Microsoft Windows. Unity has also inherited this bug: https://bugs.launchpad.net/ubuntu/+source/gtk+3.0/+bug/841409 Please fix this bug ASAP. Thank you!
Comment 14 Daniel Boles 2017-08-29 21:45:52 UTC
(In reply to Eino Väisänen from comment #13)
> Please fix this bug ASAP.

I'm afraid open source is now a case of ordering people to do what you want.


> Why this bug is still not fixed (after five years)?

Because no one has written a patch that fixes it.

There are plenty of directions above, though, if you'd like to try fixing it before anyone else does.

Note that bugs are many and complex, and developers are few and busy. Not all of them can be fixed; that's just physics.


> You won't find bugs like this in MacOS or Microsoft Windows

But you'll find different ones, and not have the option to edit the source code yourself. So it's swings and roundabouts.
Comment 15 Daniel Boles 2017-08-29 21:47:05 UTC
(In reply to Daniel Boles from comment #14)
> (In reply to Eino Väisänen from comment #13)
> > Please fix this bug ASAP.
> 
> I'm afraid open source is now a case of ordering people to do what you want.

LOL, I meant 'not', but I guess that works too, sarcastically.
Comment 16 GNOME Infrastructure Team 2018-05-02 15:16:57 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gtk/issues/377.