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 629369 - Make get_sources and get_sources_by_operations accessible from JavaScript
Make get_sources and get_sources_by_operations accessible from JavaScript
Status: RESOLVED FIXED
Product: grilo
Classification: Other
Component: core
git master
Other Linux
: Normal normal
: ---
Assigned To: grilo-maint
grilo-maint
Depends on:
Blocks:
 
 
Reported: 2010-09-11 16:25 UTC by Simon Pena
Modified: 2010-09-16 06:53 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
core: Make get_sources return a GList (8.05 KB, patch)
2010-09-11 16:28 UTC, Simon Pena
none Details | Review
core: Make get_sources_by_operations return a GList (12.50 KB, patch)
2010-09-11 16:28 UTC, Simon Pena
none Details | Review

Description Simon Pena 2010-09-11 16:25:32 UTC
Currently GrlPluginRegistry's get_sources and get_sources_by_operations return a zero-terminated array of GrlMediaPlugins. While GObject Introspection supports it, and they can be accessed from PyGObject, currently JavaScript doesn't support it.
See JavaScript's bug #560567 and a previous mailing list discussion[1] for more details on the issue.

[1] http://mail.gnome.org/archives/grilo-list/2010-August/msg00102.html
Comment 1 Simon Pena 2010-09-11 16:28:35 UTC
Created attachment 170029 [details] [review]
core: Make get_sources return a GList

* GrlPluginRegistry's get_sources now returns a GList
* Added a compare_by_rank method to use with g_list_sort
* Updated grilo-test-ui, grl-inspect and tests to expect a GList
Comment 2 Simon Pena 2010-09-11 16:28:46 UTC
Created attachment 170030 [details] [review]
core: Make get_sources_by_operations return a GList
Comment 3 Simon Pena 2010-09-11 16:39:26 UTC
The patches attached change both functions to return GLists. As a result, they
can be accessed from both JavaScript and PyGObject.
Comment 4 Iago Toral 2010-09-16 06:53:09 UTC
Pushed. 

Your compare_by_rank function was not sorting properly, I fixed that.

---

commit a8f314fdbd9b3196b8a1e89e13da1a686ac3548c
Author: Iago Toral Quiroga <itoral@igalia.com>
Date:   Thu Sep 16 08:45:52 2010 +0200

    core: Fix incorrect sorting of ranked plugins.

commit 723f3a0e8738a3d4a78232eb6c26b459ee3a2497
Author: Simón Pena <spenap@gmail.com>
Date:   Tue Sep 14 21:18:29 2010 +0200

    core: Make get_sources_by_operations return a GList
    
    https://bugzilla.gnome.org/show_bug.cgi?id=629369
    
    Signed-off-by: Iago Toral Quiroga <itoral@igalia.com>

commit 21c8f46cb4b64c852f7d659ad5201fd178e83666
Author: Simón Pena <spenap@gmail.com>
Date:   Tue Sep 14 21:18:28 2010 +0200

    core: Make get_sources return a GList
    
    * GrlPluginRegistry's get_sources now returns a GList
    * Added a compare_by_rank method to use with g_list_sort
    * Updated grilo-test-ui, grl-inspect and tests to expect a GList
    
    https://bugzilla.gnome.org/show_bug.cgi?id=629369
    
    Signed-off-by: Iago Toral Quiroga <itoral@igalia.com>