]> Pileus Git - ~andy/gtk/commitdiff
Make this work when the slider buttons have been destroyed.
authorMorten Welinder <terra@gnome.org>
Wed, 17 Mar 2004 15:29:06 +0000 (15:29 +0000)
committerMorten Welinder <mortenw@src.gnome.org>
Wed, 17 Mar 2004 15:29:06 +0000 (15:29 +0000)
2004-03-17  Morten Welinder  <terra@gnome.org>

* gtk/gtkpathbar.c (gtk_path_bar_forall): Make this work when the
slider buttons have been destroyed.
(gtk_path_bar_remove): Make this work for slider buttons too.
Fixes http://bugzilla.gnome.org/show_bug.cgi?id=137257

ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gtk/gtkpathbar.c

index b31a6ee6e68d2b0f65d0e4eb5e3d8e52ee00223f..7dcb74831c4cfb2d7b3692d85fa47c202ebb97e7 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2004-03-17  Morten Welinder  <terra@gnome.org>
+
+       * gtk/gtkpathbar.c (gtk_path_bar_forall): Make this work when the
+       slider buttons have been destroyed.
+       (gtk_path_bar_remove): Make this work for slider buttons too.
+       Fixes http://bugzilla.gnome.org/show_bug.cgi?id=137257
+
+2004-03-15  Morten Welinder  <terra@gnome.org>
+
+       * gtk/gtkfilechooserdefault.c (shortcuts_add_bookmark_from_path):
+       Sanitize and plug leak.
+       (check_icon_theme): Only do something if the widget has a screen.
+
 Wed Mar 17 01:20:28 2004  Matthias Clasen  <maclas@gmx.de>
 
        * gtk/gtkentrycompletion.c (_gtk_entry_completion_resize_popup): 
index b31a6ee6e68d2b0f65d0e4eb5e3d8e52ee00223f..7dcb74831c4cfb2d7b3692d85fa47c202ebb97e7 100644 (file)
@@ -1,3 +1,16 @@
+2004-03-17  Morten Welinder  <terra@gnome.org>
+
+       * gtk/gtkpathbar.c (gtk_path_bar_forall): Make this work when the
+       slider buttons have been destroyed.
+       (gtk_path_bar_remove): Make this work for slider buttons too.
+       Fixes http://bugzilla.gnome.org/show_bug.cgi?id=137257
+
+2004-03-15  Morten Welinder  <terra@gnome.org>
+
+       * gtk/gtkfilechooserdefault.c (shortcuts_add_bookmark_from_path):
+       Sanitize and plug leak.
+       (check_icon_theme): Only do something if the widget has a screen.
+
 Wed Mar 17 01:20:28 2004  Matthias Clasen  <maclas@gmx.de>
 
        * gtk/gtkentrycompletion.c (_gtk_entry_completion_resize_popup): 
index b31a6ee6e68d2b0f65d0e4eb5e3d8e52ee00223f..7dcb74831c4cfb2d7b3692d85fa47c202ebb97e7 100644 (file)
@@ -1,3 +1,16 @@
+2004-03-17  Morten Welinder  <terra@gnome.org>
+
+       * gtk/gtkpathbar.c (gtk_path_bar_forall): Make this work when the
+       slider buttons have been destroyed.
+       (gtk_path_bar_remove): Make this work for slider buttons too.
+       Fixes http://bugzilla.gnome.org/show_bug.cgi?id=137257
+
+2004-03-15  Morten Welinder  <terra@gnome.org>
+
+       * gtk/gtkfilechooserdefault.c (shortcuts_add_bookmark_from_path):
+       Sanitize and plug leak.
+       (check_icon_theme): Only do something if the widget has a screen.
+
 Wed Mar 17 01:20:28 2004  Matthias Clasen  <maclas@gmx.de>
 
        * gtk/gtkentrycompletion.c (_gtk_entry_completion_resize_popup): 
index b31a6ee6e68d2b0f65d0e4eb5e3d8e52ee00223f..7dcb74831c4cfb2d7b3692d85fa47c202ebb97e7 100644 (file)
@@ -1,3 +1,16 @@
+2004-03-17  Morten Welinder  <terra@gnome.org>
+
+       * gtk/gtkpathbar.c (gtk_path_bar_forall): Make this work when the
+       slider buttons have been destroyed.
+       (gtk_path_bar_remove): Make this work for slider buttons too.
+       Fixes http://bugzilla.gnome.org/show_bug.cgi?id=137257
+
+2004-03-15  Morten Welinder  <terra@gnome.org>
+
+       * gtk/gtkfilechooserdefault.c (shortcuts_add_bookmark_from_path):
+       Sanitize and plug leak.
+       (check_icon_theme): Only do something if the widget has a screen.
+
 Wed Mar 17 01:20:28 2004  Matthias Clasen  <maclas@gmx.de>
 
        * gtk/gtkentrycompletion.c (_gtk_entry_completion_resize_popup): 
index b31a6ee6e68d2b0f65d0e4eb5e3d8e52ee00223f..7dcb74831c4cfb2d7b3692d85fa47c202ebb97e7 100644 (file)
@@ -1,3 +1,16 @@
+2004-03-17  Morten Welinder  <terra@gnome.org>
+
+       * gtk/gtkpathbar.c (gtk_path_bar_forall): Make this work when the
+       slider buttons have been destroyed.
+       (gtk_path_bar_remove): Make this work for slider buttons too.
+       Fixes http://bugzilla.gnome.org/show_bug.cgi?id=137257
+
+2004-03-15  Morten Welinder  <terra@gnome.org>
+
+       * gtk/gtkfilechooserdefault.c (shortcuts_add_bookmark_from_path):
+       Sanitize and plug leak.
+       (check_icon_theme): Only do something if the widget has a screen.
+
 Wed Mar 17 01:20:28 2004  Matthias Clasen  <maclas@gmx.de>
 
        * gtk/gtkentrycompletion.c (_gtk_entry_completion_resize_popup): 
index 0f1aab9eac1c117087d4470f3fd698a39872ec4c..3009ed7f43ee23166fd8cd9d602fb66566d9a1c6 100644 (file)
@@ -496,6 +496,16 @@ gtk_path_bar_add (GtkContainer *container,
   gtk_widget_set_parent (widget, GTK_WIDGET (container));
 }
 
+static void
+gtk_path_bar_remove_1 (GtkContainer *container,
+                      GtkWidget    *widget)
+{
+  gboolean was_visible = GTK_WIDGET_VISIBLE (widget);
+  gtk_widget_unparent (widget);
+  if (was_visible)
+    gtk_widget_queue_resize (GTK_WIDGET (container));
+}
+
 static void
 gtk_path_bar_remove (GtkContainer *container,
                     GtkWidget    *widget)
@@ -505,23 +515,29 @@ gtk_path_bar_remove (GtkContainer *container,
 
   path_bar = GTK_PATH_BAR (container);
 
-  children = path_bar->button_list;
+  if (widget == path_bar->up_slider_button)
+    {
+      gtk_path_bar_remove_1 (container, widget);
+      path_bar->up_slider_button = NULL;
+      return;
+    }
 
+  if (widget == path_bar->down_slider_button)
+    {
+      gtk_path_bar_remove_1 (container, widget);
+      path_bar->down_slider_button = NULL;
+      return;
+    }
+
+  children = path_bar->button_list;
   while (children)
     {
       if (widget == BUTTON_DATA (children->data)->button)
        {
-         gboolean was_visible;
-
-         was_visible = GTK_WIDGET_VISIBLE (widget);
-         gtk_widget_unparent (widget);
-
+         gtk_path_bar_remove_1 (container, widget);
          path_bar->button_list = g_list_remove_link (path_bar->button_list, children);
          g_list_free (children);
-
-         if (was_visible)
-           gtk_widget_queue_resize (GTK_WIDGET (container));
-         break;
+         return;
        }
       
       children = children->next;
@@ -550,8 +566,11 @@ gtk_path_bar_forall (GtkContainer *container,
       (* callback) (child, callback_data);
     }
 
-  (* callback) (path_bar->up_slider_button, callback_data);
-  (* callback) (path_bar->down_slider_button, callback_data);
+  if (path_bar->up_slider_button)
+    (* callback) (path_bar->up_slider_button, callback_data);
+
+  if (path_bar->down_slider_button)
+    (* callback) (path_bar->down_slider_button, callback_data);
 }
 
 static void