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 753649 - Re-work the GtkSourceCompletionItem API
Re-work the GtkSourceCompletionItem API
Status: RESOLVED FIXED
Product: gtksourceview
Classification: Platform
Component: General
unspecified
Other Linux
: Normal enhancement
: 4.0
Assigned To: GTK Sourceview maintainers
GTK Sourceview maintainers
Depends on:
Blocks:
 
 
Reported: 2015-08-15 12:14 UTC by Sébastien Wilmet
Modified: 2016-10-20 06:59 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Sébastien Wilmet 2015-08-15 12:14:43 UTC
After the addition of the icon-name and gicon properties, the constructors are no longer convenient to use.

Maybe we should just document to use g_object_new() or g_object_set(). Or provide an empty constructor, and add setters for all properties. Or provide a constructor with the most common properties except the icons, and have setters only for the icons. There are many choices, but anyway for such a small and simple API, it doesn't matter a lot.

Also, the name of the class could be renamed to GtkSourceCompletionSimpleProposal, to follow the pattern used in GIO when a class provides a simple implementation of an interface (e.g. GAction -> GSimpleAction).
Comment 1 Sébastien Wilmet 2016-10-19 18:21:41 UTC
> Or provide an empty constructor, and add setters for all properties.

I think it's the best solution. By calling all the setters, the code will also be easier to understand, more explicit.

The empty constructor can be added in GSV 3 with the name new2(). The setters can of course be added too. The other constructors can be deprecated, and for GSV 4 new2() would be renamed to new(). So the port to GSV 4 is trivial.
Comment 2 Sébastien Wilmet 2016-10-20 06:59:22 UTC
Done with:
commit 9118e3cd8c963eeea3d292a894a4314bb0ee52eb
commit 4b1cd883924d039e8a3575a4a9fdd7fb0f52bf11