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 674084 - Preferred application setting only affects one specific mime type
Preferred application setting only affects one specific mime type
Status: RESOLVED FIXED
Product: gnome-control-center
Classification: Core
Component: Other Preferences
3.4.x
Other Linux
: Normal normal
: ---
Assigned To: Control-Center Maintainers
Control-Center Maintainers
: 621093 662191 681571 (view as bug list)
Depends on: 674111
Blocks:
 
 
Reported: 2012-04-14 00:12 UTC by Giovanni Campagna
Modified: 2013-01-11 08:50 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
system info: set related mime types when changing preferred apps (7.41 KB, patch)
2012-04-14 00:15 UTC, Giovanni Campagna
needs-work Details | Review
system info: set related mime types when changing preferred apps (6.88 KB, patch)
2012-04-14 18:00 UTC, Giovanni Campagna
none Details | Review
system info: set related mime types when changing preferred apps (6.86 KB, patch)
2012-04-29 20:15 UTC, Giovanni Campagna
needs-work Details | Review
system info: set related mime types when changing preferred apps (6.92 KB, patch)
2012-07-04 17:57 UTC, Giovanni Campagna
committed Details | Review

Description Giovanni Campagna 2012-04-14 00:12:59 UTC
(Filed under "Other Preferences" because "Preferred applications" is said to be obsolete. This is about the GNOME 3 Details panel, not the 2.* preferred app capplet).

It is confusing when changing the preferred application in system info seems to have no effect, because you don't actually have any .ogv or .oga, but only .mkv and .mp3. So, instead of changing just one mime-type association, it should change all that make sense at once.
This is very visible with music and video (where many formats exists, and ogg is not even the most common), but also affects web, as x-scheme-handler/http is not associated with text/html

See patch for details.
Comment 1 Giovanni Campagna 2012-04-14 00:15:33 UTC
Created attachment 212025 [details] [review]
system info: set related mime types when changing preferred apps

Setting the preferred music or video app only changed the handler
for ogg audio/video, leaving an inconsistent state where the previous
(system default) app would be used for almost everything.
Instead this commit makes it so, when the user changes the default,
the most common related types are affected too.
Nothing changes if configuration is modified externally (e.g.
by hand or through nautilus), we only pick the primary content type
as the preferred app.
Comment 2 Bastien Nocera 2012-04-14 16:39:22 UTC
Review of attachment 212025 [details] [review]:

I don't like the fact that all the mime-types are hard-coded. I'd rather it be more extensible, and used the application's advertised mime-types.

For example, the movie player would then become the default player for all that it handles, minus what the audio player handles.
Comment 3 Giovanni Campagna 2012-04-14 18:00:44 UTC
Created attachment 212051 [details] [review]
system info: set related mime types when changing preferred apps

Setting the preferred music or video app only changed the handler
for ogg audio/video, leaving an inconsistent state where the previous
(system default) app would be used for almost everything.
Instead this commit makes it so, when the user changes his preferences,
the application becomes the default for all mime types in the same
group that it supports.
Nothing changes if configuration is modified externally (e.g.
by hand or through nautilus), we only pick the primary content type
as the preferred app.

Here it is. Still, I liked previous version better, as for example changing
Music to Rhythmbox now changes only a fraction of mime types, compared to
Totem, because its desktop file is more conservative.
Comment 4 Giovanni Campagna 2012-04-29 20:15:45 UTC
Created attachment 213062 [details] [review]
system info: set related mime types when changing preferred apps

Setting the preferred music or video app only changed the handler
for ogg audio/video, leaving an inconsistent state where the previous
(system default) app would be used for almost everything.
Instead this commit makes it so, when the user changes his preferences,
the application becomes the default for all mime types in the same
group that it supports.
Nothing changes if configuration is modified externally (e.g.
by hand or through nautilus), we only pick the primary content type
as the preferred app.

Updated following comments on gio patch.
Comment 5 Sebastien Bacher 2012-05-25 13:05:50 UTC
duplicate of bug #662191?
Comment 6 Giovanni Campagna 2012-06-27 12:11:44 UTC
Bastien: ping?
Is this ready to go?
Comment 7 Bastien Nocera 2012-06-28 08:43:35 UTC
*** Bug 662191 has been marked as a duplicate of this bug. ***
Comment 8 Bastien Nocera 2012-06-28 08:50:43 UTC
Review of attachment 213062 [details] [review]:

> for almost everything
For other images, audio files, or videos.

> Instead this commit
There's no need to reference the commit itself, it's in the commit log

> we only pick the primary content type as the preferred app.
How can a content type be a preferred app?

I think you tried to create a system which is far more generic than it needs to be.

- Setting the default audio, image, web, mail and calendar handlers should make it the default handler for all the mime-types they handle
- Setting the default video app should make it the default handler for all the mime-types it handles minus the ones the audio app handles

::: panels/info/cc-info-panel.c
@@ +984,3 @@
 
+static DefaultAppData preferred_app_infos[] = {
+  /* XXX: for web, we need to support text/html,

That strikes me as not ready to go.
Comment 9 Giovanni Campagna 2012-07-04 17:51:37 UTC
(In reply to comment #8)
> Review of attachment 213062 [details] [review]:
> [...]
> 
> I think you tried to create a system which is far more generic than it needs to
> be.
> 
> - Setting the default audio, image, web, mail and calendar handlers should make
> it the default handler for all the mime-types they handle
> - Setting the default video app should make it the default handler for all the
> mime-types it handles minus the ones the audio app handles

You're wrong:
- Setting the audio player must only affect audio/* mime-types, or setting Totem for audio and MPlayer for video has different effects depending on the order (which is weird). By the same reasoning, changing the video player must only affect video/*.
- Setting mail must only affect mailto, or you cannot have Thunderbird for mail and Evolution for calendar
- Setting web must only affect web, or choosing Chromium modifies your mail app (yes, they expose that)

> ::: panels/info/cc-info-panel.c
> @@ +984,3 @@
> 
> +static DefaultAppData preferred_app_infos[] = {
> +  /* XXX: for web, we need to support text/html,
> 
> That strikes me as not ready to go.

The XXX there is wrong, the commit is meant to explain the "*" pattern (there is no single pattern that covers all of those)
Comment 10 Giovanni Campagna 2012-07-04 17:57:38 UTC
Created attachment 218030 [details] [review]
system info: set related mime types when changing preferred apps

Setting the preferred music or video app only changed the handler
for ogg audio/video, leaving an inconsistent state where the previous
(system default) app would be used for other images, audio and video
formats.
Instead make it so that when the user changes his preferences,
the application becomes the default for all mime types in the same
group that it supports.
Nothing changes if configuration is modified externally (e.g.
by hand or through nautilus): expose as preferred app the one that
is configured to handle the primary content type.
Comment 11 Sebastien Bacher 2012-08-10 16:38:41 UTC
*** Bug 681571 has been marked as a duplicate of this bug. ***
Comment 12 Giovanni Campagna 2012-08-13 16:45:28 UTC
Ping again?
Comment 13 Bastien Nocera 2012-08-24 17:05:57 UTC
Review of attachment 218030 [details] [review]:

Looks good. Thanks for making the changes. I'm not sure how we could implement this better right now, so I'll leave it to bug reporters to explain their particular problems with the UI if we ever run into that.
Comment 14 Giovanni Campagna 2012-08-24 18:09:37 UTC
Attachment 218030 [details] pushed as 4d80e47 - system info: set related mime types when changing preferred apps
Comment 15 Bastien Nocera 2013-01-11 08:50:23 UTC
*** Bug 621093 has been marked as a duplicate of this bug. ***