Re: [Rhythmbox-devel] Context menu in nautilus



> Hi
> 
> I've downloaded the patch and overwritten my one with what is there. It
> works fine when rhythmbox is running (the selected files are added to
> the library), but when rhythmbox is not running, it successfully
> activates, but then crashes. Nothing is output to .xession-errors.
> 
> I believe that Yann is getting the same issue. What can we do to look at
> what is causing this?

Well in fact I was able to have it work !
As I said the problem was that Rhythmbox registered 
"OAFIID:GNOME_Rhythmbox" instead of "OAFIID:GNOME_Rhythmbox_Factory" so 
I changed this in main.c
I also added this registration in rb_shell_construct (now it registers 
"OAFIID:GNOME_Rhythmbox_Factory" and "OAFIID:GNOME_Rhythmbox" I would 
think at least one isn't useful but it doesn't work if I remove one 
bonobo registration).

Then I got a segfault because rb_library_add_uri received a null 
parameter for the library argument, because the library thing is 
initialized after the bonobo registration so I moved the registration 
near the end of the function.

Now it works but I would happy if someone could explain how we're 
supposed to do the corba/bonobo registration and why.

Following the patch for the modifictaions I've made.

Yann

Index: main.c
===================================================================
RCS file: /cvs/gnome/rhythmbox/shell/main.c,v
retrieving revision 1.22
diff -b -u -2 -r1.22 main.c
--- main.c	19 Jul 2003 04:14:10 -0000	1.22
+++ main.c	26 Jul 2003 10:25:36 -0000
@@ -125,5 +125,5 @@
  	if (no_registration == FALSE)
  	{
-		object = bonobo_activation_activate_from_id (RB_SHELL_OAFIID,
+		object = bonobo_activation_activate_from_id 
("OAFIID:GNOME_Rhythmbox_Factory",
  			 				     Bonobo_ACTIVATION_FLAG_EXISTING_ONLY,
  							     NULL, NULL);
Index: rb-shell.c
===================================================================
RCS file: /cvs/gnome/rhythmbox/shell/rb-shell.c,v
retrieving revision 1.120
diff -b -u -2 -r1.120 rb-shell.c
--- rb-shell.c	24 Jul 2003 04:42:11 -0000	1.120
+++ rb-shell.c	26 Jul 2003 10:25:39 -0000
@@ -565,23 +565,4 @@
  	rb_debug ("Constructing shell");

-	/* register with CORBA */
-	CORBA_exception_init (&ev);
-	
-	corba_object = bonobo_object_corba_objref (BONOBO_OBJECT (shell));
-	if (bonobo_activation_active_server_register (RB_SHELL_OAFIID, 
corba_object) != Bonobo_ACTIVATION_REG_SUCCESS)
-	{
-		/* this is not critical, but worth a warning nevertheless */
-		char *msg = rb_shell_corba_exception_to_string (&ev);
-		g_message (_("Failed to register the shell: %s\n"
-			     "This probably means that you installed RB in a\n"
-			     "different prefix than bonobo-activation; this\n"
-			     "warning is harmless, but IPC will not work.\n"), msg);
-		g_free (msg);
-	}
-
-	CORBA_exception_free (&ev);
-
-	rb_debug ("Registered with Bonobo Activation");
-
  	/* initialize UI */
  	win = BONOBO_WINDOW (bonobo_window_new ("Rhythmbox shell",
@@ -774,4 +755,36 @@
  	gtk_widget_show_all (GTK_WIDGET (shell->priv->tray_icon));

+	/* register with CORBA */
+	CORBA_exception_init (&ev);
+
+	corba_object = bonobo_object_corba_objref (BONOBO_OBJECT (shell));
+
+	if (bonobo_activation_active_server_register 
("OAFIID:GNOME_Rhythmbox_Factory", corba_object) != 
Bonobo_ACTIVATION_REG_SUCCESS)
+	{
+		/* this is not critical, but worth a warning nevertheless */
+		char *msg = rb_shell_corba_exception_to_string (&ev);
+		g_message (_("Failed to register the shell: %s\n"
+			     "This probably means that you installed RB in a\n"
+			     "different prefix than bonobo-activation; this\n"
+			     "warning is harmless, but IPC will not work.\n"), msg);
+		g_free (msg);
+	}
+
+	if (bonobo_activation_active_server_register (RB_SHELL_OAFIID, 
corba_object) != Bonobo_ACTIVATION_REG_SUCCESS)
+	{
+		/* this is not critical, but worth a warning nevertheless */
+		char *msg = rb_shell_corba_exception_to_string (&ev);
+		g_message (_("Failed to register the shell: %s\n"
+			     "This probably means that you installed RB in a\n"
+			     "different prefix than bonobo-activation; this\n"
+			     "warning is harmless, but IPC will not work.\n"), msg);
+		g_free (msg);
+	}
+
+	CORBA_exception_free (&ev);
+
+	rb_debug ("Registered with Bonobo Activation");
+
+
  	GDK_THREADS_ENTER ();

@@ -1670,5 +1683,5 @@
  }





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]