Remove gee dependency and replace it with GLib native types

Bug #1745877 reported by Timothy
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Diodon
Fix Released
Medium
Unassigned

Bug Description

Gee is highly Vala specific and causes issues with GObject introspection to be used e.g. by gjs or python. Hence dependency on Gee should be completely removed.

Original description:

Gee collections shouldn't really be returned from publicly visible API. Other languages (notable Gjs) have trouble with Gee do to its heavy use of generics. The solution would be to return the Gee collection wrapped in a class with a hardcoded type.

Something like

public class ClipboardItemList {
  private List<IClipboardItem> list;

  public ClipboardItemList(List<IClipboardItem> list) {
    this.list = list;
  }

  public IClipboardItem get (int i) {
    return this.list[i];
  }

  ...

}

Is this something we want to address?

description: updated
description: updated
description: updated
Revision history for this message
Timothy (redhatter271-deactivatedaccount) wrote :

Another simpler options would be to call 'to_array()' on the collection before returning it.

Revision history for this message
Oliver Sauder (sao) wrote :

Gee is not heavily used within Diodon and is highly Vala specific.

I would actually like to remove the Gee dependency altogether and use GLib native types like GLib.List
<https://valadoc.org/glib-2.0/GLib.List.html>.

Would this work with gjs?

Changed in diodon:
status: New → Confirmed
Revision history for this message
Timothy (redhatter271-deactivatedaccount) wrote :

It would. GLib.List is seamlessly transformed into an array.

Revision history for this message
Oliver Sauder (sao) wrote :

Then let's try to move to GLib.List that seems to be the cleanest way.

summary: - libdion is not accessible from Gjs
+ Remove gee dependency and replace it with GLib native types
description: updated
Changed in diodon:
status: Confirmed → Triaged
importance: Undecided → Medium
Revision history for this message
Timothy (redhatter271-deactivatedaccount) wrote :

I went ahead and made the changes. I needed most of them to get the GNOME Shell indicator working anyway.

Revision history for this message
Oliver Sauder (sao) wrote :

Great thanks. Patch looks good. Applied and pushed.

Changed in diodon:
status: Triaged → Fix Committed
Oliver Sauder (sao)
Changed in diodon:
milestone: none → 1.8.0
Oliver Sauder (sao)
Changed in diodon:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.