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 648425 - GDesktopAppInfo: Add "filename" property for bindings
GDesktopAppInfo: Add "filename" property for bindings
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: gio
unspecified
Other All
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2011-04-21 20:55 UTC by Colin Walters
Modified: 2011-04-26 19:09 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
GDesktopAppInfo: Add "filename" property for bindings (6.36 KB, patch)
2011-04-21 20:55 UTC, Colin Walters
committed Details | Review

Description Colin Walters 2011-04-21 20:55:34 UTC
GDesktopAppInfo violates the GObject rule that your C constructors
should just be thin wrappers around g_object_new().  While GKeyFile
isn't introspctable, this patch allows from JavaScript:

var app = new Gio.DesktopAppInfo({ filename: '/path/to/foo.desktop' });
Comment 1 Colin Walters 2011-04-21 20:55:36 UTC
Created attachment 186454 [details] [review]
GDesktopAppInfo: Add "filename" property for bindings
Comment 2 Matthias Clasen 2011-04-26 13:39:26 UTC
Review of attachment 186454 [details] [review]:

::: gio/gdesktopappinfo.c
@@ +430,3 @@
+      g_object_unref (info);
+      return NULL;
+    }

Hmm

it may be a small step in the right direction, but this still isn't the trivial g_object_new wrapper that binders long for...
Comment 3 Colin Walters 2011-04-26 13:59:00 UTC
(In reply to comment #2)
> Review of attachment 186454 [details] [review]:
> 
> ::: gio/gdesktopappinfo.c
> @@ +430,3 @@
> +      g_object_unref (info);
> +      return NULL;
> +    }
> 
> Hmm
> 
> it may be a small step in the right direction, but this still isn't the trivial
> g_object_new wrapper that binders long for...

Well I can't change the semantics of g_desktop_app_info_new_from_filename().  But bindings don't actually call that function (at least not when using the sample code).
Comment 4 Colin Walters 2011-04-26 19:09:53 UTC
Attachment 186454 [details] pushed as 2a3f7f4 - GDesktopAppInfo: Add "filename" property for bindings