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 683415 - UOA provider plugins should each return a unique GType
UOA provider plugins should each return a unique GType
Status: RESOLVED FIXED
Product: empathy
Classification: Core
Component: UOA
3.5.x
Other Linux
: Normal normal
: ---
Assigned To: empathy-maint
empathy-maint
Depends on:
Blocks:
 
 
Reported: 2012-09-05 12:46 UTC by David King
Modified: 2012-09-06 09:00 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Generate one GType per UOA protocol plugin (12.41 KB, patch)
2012-09-05 14:01 UTC, Guillaume Desmottes
none Details | Review
Generate one GType per UOA protocol plugin (81.09 KB, patch)
2012-09-05 14:03 UTC, Guillaume Desmottes
committed Details | Review
Move account plugins to their own dir (33.98 KB, patch)
2012-09-06 08:43 UTC, Guillaume Desmottes
committed Details | Review
UOA account plugins: move shared code to a shared lib (9.87 KB, patch)
2012-09-06 08:43 UTC, Guillaume Desmottes
committed Details | Review

Description David King 2012-09-05 12:46:05 UTC
The UOA control center panel loads each provider plugin and registers the type with the value returned from ap_module_get_object_type() in the plugin. For this to work correctly, no plugin can have the same GType as another one. The UOA panel currently crashes, after some warnings from GObject about the failed type registration, when switching between two Empathy plugins because all the Empathy provider plugins share the same ap_module_get_object_type() method and therefore the same GType.

The fix would be to make each plugin subclass the main EmpathyAccountsPlugin type (or ApPlugin directly) and return a distinct GType. This can probably be done in the plugin generator relatively easily.
Comment 1 Guillaume Desmottes 2012-09-05 14:01:13 UTC
Created attachment 223540 [details] [review]
Generate one GType per UOA protocol plugin

Each plugin now has its own GType inheriting from EmpathyAccountsPlugin.

That's cleaner and avoid to try to register the same GType more than once.
Comment 2 Guillaume Desmottes 2012-09-05 14:03:30 UTC
Created attachment 223543 [details] [review]
Generate one GType per UOA protocol plugin

Each plugin now has its own GType inheriting from EmpathyAccountsPlugin.

That's cleaner and avoid to try to register the same GType more than once.
Comment 3 Xavier Claessens 2012-09-05 14:12:04 UTC
You'll have the same problem when registering the base class type and the widget type as well. AFAIK they need to be in a shared lib.
Comment 4 Guillaume Desmottes 2012-09-06 08:43:12 UTC
Created attachment 223609 [details] [review]
Move account plugins to their own dir
Comment 5 Guillaume Desmottes 2012-09-06 08:43:22 UTC
Created attachment 223610 [details] [review]
UOA account plugins: move shared code to a shared lib

Avoid to redefine existing symbols when different plugins are loaded.
Comment 6 Guillaume Desmottes 2012-09-06 09:00:12 UTC
Attachment 223543 [details] pushed as 006b27d - Generate one GType per UOA protocol plugin
Attachment 223609 [details] pushed as b73b93e - Move account plugins to their own dir
Attachment 223610 [details] pushed as d001dd2 - UOA account plugins: move shared code to a shared lib