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 674111 - Provide an accessor for MimeType desktop entry key
Provide an accessor for MimeType desktop entry key
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: gio
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks: 674084
 
 
Reported: 2012-04-14 18:01 UTC by Giovanni Campagna
Modified: 2012-05-16 10:44 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
GDesktopAppInfo: add a mechanism to query supported mime types (4.63 KB, patch)
2012-04-14 18:02 UTC, Giovanni Campagna
needs-work Details | Review
GAppInfo: add a mechanism to query supported content types (7.25 KB, patch)
2012-04-29 20:03 UTC, Giovanni Campagna
needs-work Details | Review
GAppInfo: add a mechanism to query supported content types (7.33 KB, patch)
2012-05-15 15:07 UTC, Giovanni Campagna
committed Details | Review

Description Giovanni Campagna 2012-04-14 18:01:49 UTC
To be used by control center's system info panel (bug 674084).
Comment 1 Giovanni Campagna 2012-04-14 18:02:13 UTC
Created attachment 212052 [details] [review]
GDesktopAppInfo: add a mechanism to query supported mime types

Add an accessor for the MimeType field in desktop files, to retrieve
the list of all mime types supported by an application.
Comment 2 Matthias Clasen 2012-04-16 12:23:52 UTC
Review of attachment 212052 [details] [review]:

If the existing GAppInfo machinery for dealing with content types is not sufficient for this, that is the level where this functionality needs to be added
Comment 3 Bastien Nocera 2012-04-16 12:29:02 UTC
It needs to deal with "content-types" at the GAppInfo level, and should use "type" as the name in function names. For example:
g_app_info_get_supported_types (GAppInfo *appinfo);
Comment 4 Giovanni Campagna 2012-04-29 20:03:54 UTC
Created attachment 213061 [details] [review]
GAppInfo: add a mechanism to query supported content types

This essentially adds an accessor for the MimeType field in desktop files,
to retrieve the list of all mime types supported by an application.
The interface though is part of GAppInfo, so it could be implemented
in the future by other backends.

Here you are. I explicitly don't want mimeapps.list to be in the round, otherwise
if you by chance or by mistake assign a type to an app, it ends as "supported"
forever.
Comment 5 Matthias Clasen 2012-05-13 04:02:01 UTC
Review of attachment 213061 [details] [review]:

Please add the new function to gio.symbols and docs/reference/gio/gio-sections.txt

::: gio/gappinfo.c
@@ +465,3 @@
+ * Retrieves the list of content types that @app_info claims to support.
+ * If this information is provided by the environment, this function will
+ * return NULL.

I think you meant 'is _not_ provided' ?
And %NULL, please

::: gio/gdesktopappinfo.c
@@ +2632,3 @@
+
+  return (const char* const*) info->mime_types;
+}

This one is no longer needed.
Comment 6 Giovanni Campagna 2012-05-15 15:07:06 UTC
Created attachment 214111 [details] [review]
GAppInfo: add a mechanism to query supported content types

This essentially adds an accessor for the MimeType field in desktop files,
to retrieve the list of all mime types supported by an application.
The interface though is part of GAppInfo, so it could be implemented
in the future by other backends.
Comment 7 Matthias Clasen 2012-05-15 17:30:48 UTC
Review of attachment 214111 [details] [review]:

Looks good now
Comment 8 Giovanni Campagna 2012-05-16 10:44:28 UTC
Attachment 214111 [details] pushed as 0417dda - GAppInfo: add a mechanism to query supported content types