GNOME Bugzilla – Bug 753649
Re-work the GtkSourceCompletionItem API
Last modified: 2016-10-20 06:59:22 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).
> 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.
Done with: commit 9118e3cd8c963eeea3d292a894a4314bb0ee52eb commit 4b1cd883924d039e8a3575a4a9fdd7fb0f52bf11