diff options
-rw-r--r-- | shell/ChangeLog | 13 | ||||
-rw-r--r-- | shell/GNOME_Evolution_TestComponent.oaf | 14 | ||||
-rw-r--r-- | shell/evolution-test-component.c | 26 |
3 files changed, 23 insertions, 30 deletions
diff --git a/shell/ChangeLog b/shell/ChangeLog index 940f2ed41c..b4e60fffb3 100644 --- a/shell/ChangeLog +++ b/shell/ChangeLog @@ -1,5 +1,18 @@ 2001-09-05 Ettore Perazzoli <ettore@ximian.com> + [Fix #958, ShellComponents should not be created by factories, for + the test component.] + + * GNOME_Evolution_TestComponent.oaf: Remove the factory. + + * evolution-test-component.c (COMPONENT_FACTORY_ID): Removed. + (component_factory_init): Removed. + (register_component): Rename from `component_fn'. No args, no + return value. Register the thing on OAF by yourself instead of + using a factory. + +2001-09-05 Ettore Perazzoli <ettore@ximian.com> + * e-shortcuts-view.c (get_shortcut_info): New. (get_efolder_from_shortcut): Removed. (impl_shortcut_dropped): Use `get_shortcut_info()' instead. diff --git a/shell/GNOME_Evolution_TestComponent.oaf b/shell/GNOME_Evolution_TestComponent.oaf index 5a203b51b4..d5ef5333be 100644 --- a/shell/GNOME_Evolution_TestComponent.oaf +++ b/shell/GNOME_Evolution_TestComponent.oaf @@ -1,22 +1,10 @@ <oaf_info> -<oaf_server iid="OAFIID:GNOME_Evolution_TestComponent_ShellComponentFactory" +<oaf_server iid="OAFIID:GNOME_Evolution_TestComponent_ShellComponent" type="exe" location="evolution-test-component"> <oaf_attribute name="repo_ids" type="stringv"> - <item value="IDL:GNOME/ObjectFactory:1.0"/> - </oaf_attribute> - - <oaf_attribute name="description" type="string" - value="Factory for the Evolution test component."/> -</oaf_server> - -<oaf_server iid="OAFIID:GNOME_Evolution_TestComponent_ShellComponent" - type="factory" - location="OAFIID:GNOME_Evolution_TestComponent_ShellComponentFactory"> - - <oaf_attribute name="repo_ids" type="stringv"> <item value="IDL:GNOME/Evolution/ShellComponent:1.0"/> </oaf_attribute> diff --git a/shell/evolution-test-component.c b/shell/evolution-test-component.c index e29773e4dd..3e64464cbb 100644 --- a/shell/evolution-test-component.c +++ b/shell/evolution-test-component.c @@ -36,8 +36,7 @@ #include <gdk-pixbuf/gdk-pixbuf.h> -#define COMPONENT_FACTORY_ID "OAFIID:GNOME_Evolution_TestComponent_ShellComponentFactory" -#define COMPONENT_ID "OAFIID:GNOME_Evolution_TestComponent_ShellComponent" +#define COMPONENT_ID "OAFIID:GNOME_Evolution_TestComponent_ShellComponent" static const EvolutionShellComponentFolderType folder_types[] = { { "test", "/usr/share/pixmaps/gnome-money.png", N_("Test"), N_("Test type"), FALSE, NULL, NULL }, @@ -279,11 +278,11 @@ user_create_new_item_callback (EvolutionShellComponent *shell_component, } -static BonoboObject * -factory_fn (BonoboGenericFactory *factory, - void *closure) +static void +register_component (void) { EvolutionShellComponent *shell_component; + int result; shell_component = evolution_shell_component_new (folder_types, NULL, @@ -301,18 +300,11 @@ factory_fn (BonoboGenericFactory *factory, gtk_signal_connect (GTK_OBJECT (shell_component), "user_create_new_item", GTK_SIGNAL_FUNC (user_create_new_item_callback), NULL); - return BONOBO_OBJECT (shell_component); -} - -static void -component_factory_init (void) -{ - BonoboGenericFactory *factory; - - factory = bonobo_generic_factory_new (COMPONENT_FACTORY_ID, factory_fn, NULL); + result = oaf_active_server_register (COMPONENT_ID, + bonobo_object_corba_objref (BONOBO_OBJECT (shell_component))); - if (factory == NULL) - g_error ("Cannot initialize test component."); + if (result == OAF_REG_ERROR) + g_error ("Cannot register active server into OAF"); } @@ -332,7 +324,7 @@ main (int argc, char **argv) if (bonobo_init (orb, CORBA_OBJECT_NIL, CORBA_OBJECT_NIL) == FALSE) g_error ("Cannot initialize the test component."); - component_factory_init (); + register_component (); bonobo_main (); |