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 628194 - Add new API peas_engine_get_default()
Add new API peas_engine_get_default()
Status: RESOLVED FIXED
Product: libpeas
Classification: Platform
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: libpeas-maint
libpeas-maint
Depends on:
Blocks:
 
 
Reported: 2010-08-28 15:36 UTC by Steve Frécinaux
Modified: 2010-10-03 21:42 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Add new API peas_engine_get_default() (2.38 KB, patch)
2010-08-28 15:36 UTC, Steve Frécinaux
reviewed Details | Review
Drop "engine" construct properties from libpeas-gtk widgets. (18.07 KB, patch)
2010-08-28 15:36 UTC, Steve Frécinaux
committed Details | Review
Add new API peas_engine_get_default() (2.32 KB, patch)
2010-10-02 13:30 UTC, Steve Frécinaux
committed Details | Review
Drop peas_engine_new() (1.79 KB, patch)
2010-10-03 07:22 UTC, Steve Frécinaux
committed Details | Review

Description Steve Frécinaux 2010-08-28 15:36:44 UTC
This allows applications to access the engine instance from anywhere.
In particular we do not need to pass the engine to the widgets we create.
Comment 1 Steve Frécinaux 2010-08-28 15:36:47 UTC
Created attachment 168950 [details] [review]
Add new API peas_engine_get_default()
Comment 2 Steve Frécinaux 2010-08-28 15:36:52 UTC
Created attachment 168951 [details] [review]
Drop "engine" construct properties from libpeas-gtk widgets.

We can use peas_engine_get_default() instead, and hopefully be able to
construct the widgets from GtkBuilder.
Comment 3 Ignacio Casal Quinteiro (nacho) 2010-09-24 18:44:52 UTC
Review of attachment 168950 [details] [review]:

::: libpeas/peas-engine.c
@@ +1156,3 @@
+ */
+PeasEngine *
+peas_engine_get_default (void)

Why not remove the peas_engine_new and have only the get_default?
Comment 4 Ignacio Casal Quinteiro (nacho) 2010-09-24 18:47:11 UTC
Oh well I see the issue, the new has the app name parameter.
Not sure I like this approach. We could have several instances, do you check on peas_engine_new that an instance already exists?
Comment 5 Steve Frécinaux 2010-09-24 19:08:31 UTC
Actually I'd like the app name to be specified in some other way (so using _new() would be limited to people subclassing PeasEngine) but I don't know how to do that nicely.
Comment 6 Steve Frécinaux 2010-10-02 13:30:50 UTC
Created attachment 171574 [details] [review]
Add new API peas_engine_get_default()
Comment 7 Steve Frécinaux 2010-10-02 23:18:47 UTC
Comment on attachment 171574 [details] [review]
Add new API peas_engine_get_default()

Attachment 171574 [details] pushed as b579068 - Add new API peas_engine_get_default()
Comment 8 Ignacio Casal Quinteiro (nacho) 2010-10-02 23:26:24 UTC
Not sure I like this patch :(
I think we should also remove the peas_engine_new and rework the get_default as I don't like too much how it is created right now in the init. Any thoughts on this?
Comment 9 Steve Frécinaux 2010-10-03 07:16:28 UTC
Well, I guess the _new() could be dropped. Anyway, I see default_engine being set in _init() as a feature: it means you can initialize your own PeasEngine subclass instance before _get_default() has a chance, and use this one instead of ours.
Comment 10 Steve Frécinaux 2010-10-03 07:22:27 UTC
Created attachment 171616 [details] [review]
Drop peas_engine_new()

People should not be using peas_engine_new() at all: either they should
use peas_engine_get_default() or provide their own subclass.
Comment 11 Steve Frécinaux 2010-10-03 21:31:33 UTC
Comment on attachment 171616 [details] [review]
Drop peas_engine_new()

Attachment 171616 [details] pushed as 6b95f31 - Drop peas_engine_new()
Comment 12 Steve Frécinaux 2010-10-03 21:42:04 UTC
Attachment 168951 [details] pushed as 3a7e467 - Drop "engine" construct properties from libpeas-gtk widgets.