[Glade-devel] [patch, glade3] small cleanup

paolo borelli pborelli@katamail.com
18 Apr 2003 12:31:34 +0200


--=-JYhWaXhpOmSa3LBOUvIh
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

Hi!

This patch is a small cleanup: it gets rid of two unused functions:

- glade_util_hide_window_on_delete: it's not used anywhere, we always
use glade_util_hide_window into a callback because we also do other
things like updating menu entries.

- glade_editor_create: it's not used anywhere, the only point in which
it could be used is in glade-project-window, but we open code it. I
think it's a remnant of when the editor was a window instead of a
widget.

ciao
	paolo

--=-JYhWaXhpOmSa3LBOUvIh
Content-Disposition: attachment; filename=rm_unused.patch
Content-Type: text/x-patch; name=rm_unused.patch; charset=UTF-8
Content-Transfer-Encoding: 7bit

diff -upr gnome2/glade3/ChangeLog glade3/ChangeLog
--- gnome2/glade3/ChangeLog	2003-04-17 09:51:54.000000000 +0200
+++ glade3/ChangeLog	2003-04-18 11:59:49.000000000 +0200
@@ -1,3 +1,8 @@
+2003-04-18  Paolo Borelli <pborelli@katamail.com>
+
+	* src/glade-utils.[ch]: remove glade_util_hide_window_on_delete.
+	* src/glade-editor.[ch]: remove glade_editor_create. Both were unused.
+
 2003-04-16  Paolo Borelli <pborelli@katamail.com>
 
 	* src/glade-placeholder.c: fix an assertion.
diff -upr gnome2/glade3/src/glade-editor.c glade3/src/glade-editor.c
--- gnome2/glade3/src/glade-editor.c	2003-04-17 09:51:55.000000000 +0200
+++ glade3/src/glade-editor.c	2003-04-18 11:36:25.000000000 +0200
@@ -1548,15 +1553,6 @@ glade_editor_select_widget (GladeEditor 
 	gtk_signal_emit (GTK_OBJECT (editor),
 			 glade_editor_signals [SELECT_ITEM], widget);
 }
-	
-void
-glade_editor_create (GladeProjectWindow *gpw)
-{
-	if (gpw->editor == NULL) {
-		gpw->editor = GLADE_EDITOR (glade_editor_new ());
-		gpw->editor->project_window = gpw;
-	}
-}
 
 void glade_editor_add_signal (GladeEditor *editor, guint signal_id,
 			      const char *callback_name)
diff -upr gnome2/glade3/src/glade-editor.h glade3/src/glade-editor.h
--- gnome2/glade3/src/glade-editor.h	2003-03-08 17:23:41.000000000 +0100
+++ glade3/src/glade-editor.h	2003-04-18 11:36:36.000000000 +0200
@@ -183,7 +184,6 @@ typedef enum {
 
 GladeEditor *glade_editor_new (void);
 
-void glade_editor_create (GladeProjectWindow *gpw);
 void glade_editor_select_widget (GladeEditor *editor, GladeWidget *widget);
 void glade_editor_add_signal (GladeEditor *editor, guint id_signal, const char *callback_name);
 
diff -upr gnome2/glade3/src/glade-utils.c glade3/src/glade-utils.c
--- gnome2/glade3/src/glade-utils.c	2003-04-03 18:44:55.000000000 +0200
+++ glade3/src/glade-utils.c	2003-04-18 11:52:45.000000000 +0200
@@ -264,19 +264,14 @@ glade_util_gtk_combo_find (GtkCombo * co
 	return NULL;
 }
 
-/* This should be hooked up to the delete_event of windows which you want
-   to hide, so that if they are shown again they appear in the same place.
-   This stops the window manager asking the user to position the window each
-   time it is shown, which is quite annoying. */
-gint
-glade_util_hide_window_on_delete (GtkWidget * widget,
-				   GdkEvent * event,
-				   gpointer data)
-{
-	glade_util_hide_window (widget);
-	return TRUE;
-}
-
+/**
+ * glade_util_hide_window:
+ * @widget:
+ *
+ * If you use this function to handle the delete_event of a window, when it
+ * will be shown again it will appear in the position where it was before
+ * beeing hidden.
+ **/
 gint
 glade_util_hide_window (GtkWidget *widget)
 {
diff -upr gnome2/glade3/src/glade-utils.h glade3/src/glade-utils.h
--- gnome2/glade3/src/glade-utils.h	2003-04-03 18:44:55.000000000 +0200
+++ glade3/src/glade-utils.h	2003-04-18 11:53:58.000000000 +0200
@@ -27,8 +27,7 @@ void     glade_util_flash_message	(guint
 gint     glade_util_compare_stock_labels (gconstpointer a, gconstpointer b);
 
 gpointer glade_util_gtk_combo_find	(GtkCombo *combo);
-gint	 glade_util_hide_window_on_delete (GtkWidget *widget, GdkEvent *event, gpointer data);
-gint	 glade_util_hide_window	(GtkWidget *widget);
+gint	 glade_util_hide_window		(GtkWidget *widget);
 gint	 glade_util_check_key_is_esc	(GtkWidget *widget, GdkEventKey *event, gpointer data);
 gchar	*glade_util_gtk_combo_func	(gpointer data);
 gpointer glade_util_gtk_combo_find	(GtkCombo *combo);

--=-JYhWaXhpOmSa3LBOUvIh--