Set the window title when opening a file on the command line
[pspp-builds.git] / src / ui / gui / psppire-window.c
index b40ccf141c7bfbf8a07666cb0c55f0187518bbfa..78eda412c5746ad568f85cd04da89329d9367305 100644 (file)
@@ -325,14 +325,12 @@ remove_menuitem (PsppireWindowRegister *reg, const gchar *key, gpointer data)
   PsppireWindow *window = PSPPIRE_WINDOW (data);
   GtkWidget *item ;
 
-  if ( !GTK_WIDGET_REALIZED (window))
-    return;
-
   item = g_hash_table_lookup (window->menuitem_table, key);
 
   g_hash_table_remove (window->menuitem_table, key);
 
-  gtk_container_remove (GTK_CONTAINER (window->menu), item);
+  if (GTK_IS_CONTAINER (window->menu))
+    gtk_container_remove (GTK_CONTAINER (window->menu), item);
 }
 
 static void
@@ -378,7 +376,7 @@ const gchar *
 psppire_window_get_filename (PsppireWindow *w)
 {
   const gchar *name = NULL;
-  g_object_get (w, "filename", name, NULL);
+  g_object_get (w, "filename", &name, NULL);
   return name;
 }