[Glade-devel] [patch, glade3] rm glade_project_get_active



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

Hi!

The patch attached removes glade_project_get_active: the function
doesn't belong to the project object in the first place, since
retrieving the current project is something which has to to with
glade-project-window. Beside it was only used twice and one of the two
is in the hack to get the "Edit menu" button.

ciao
        paolo

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

diff -upr gnome2/glade3/ChangeLog glade3/ChangeLog
--- gnome2/glade3/ChangeLog     2003-05-02 09:08:41.000000000 +0200
+++ glade3/ChangeLog    2003-05-03 13:29:25.000000000 +0200
@@ -1,3 +1,9 @@
+2003-05-03  Paolo Borelli  <pborelli katamail com>
+
+       * src/glade-project.[ch]: remove glade_project_get_active
+       * src/glade-palette.c: update for the above
+       * src/glade-editor.c: ditto
+
 2003-05-01  Paolo Borelli  <pborelli katamail com>
 
        * src/glade-keys-dialog.[ch]: init of the keys dialog.
diff -upr gnome2/glade3/src/glade-editor.c glade3/src/glade-editor.c
--- gnome2/glade3/src/glade-editor.c    2003-05-02 09:08:43.000000000 +0200
+++ glade3/src/glade-editor.c   2003-05-03 13:28:58.000000000 +0200
@@ -886,12 +886,15 @@ glade_editor_on_edit_menu_click (GtkButt
        GtkMenuBar *menubar = NULL;
        GladeWidget *widget;
        GtkWidget *menu_editor;
+       GladeProjectWindow *gpw;
        GladeProject *project;
        GList *list;
-       
-       project = glade_project_get_active ();
-       g_assert (project != NULL);
-       
+
+       gpw = glade_project_window_get ();
+
+       project = gpw->project;
+       g_return_if_fail (project != NULL);
+
        list = glade_project_selection_get (project);
        for (; list != NULL; list = list->next) {
                widget = GLADE_WIDGET (list->data);
diff -upr gnome2/glade3/src/glade-palette.c glade3/src/glade-palette.c
--- gnome2/glade3/src/glade-palette.c   2003-05-02 09:08:58.000000000 +0200
+++ glade3/src/glade-palette.c  2003-05-03 13:28:58.000000000 +0200
@@ -152,9 +152,9 @@ glade_palette_button_clicked (GtkWidget 
        g_return_if_fail (class != NULL);
 
        gpw = glade_project_window_get ();
-       
+
        if (GLADE_WIDGET_CLASS_TOPLEVEL (class)) {
-               project = glade_project_get_active ();
+               project = gpw->project;
                g_return_if_fail (project != NULL);
                glade_widget_new_toplevel (project, class);
                dont_recurse = TRUE;
diff -upr gnome2/glade3/src/glade-project.c glade3/src/glade-project.c
--- gnome2/glade3/src/glade-project.c   2003-04-16 22:50:28.000000000 +0200
+++ glade3/src/glade-project.c  2003-05-03 13:30:42.000000000 +0200
@@ -313,22 +313,6 @@ glade_project_widget_name_changed (Glade
        glade_project_set_changed (project, TRUE);
 }
 
-
-GladeProject *
-glade_project_get_active (void)
-{
-       GladeProjectWindow *gpw;
-       
-       gpw = glade_project_window_get ();
-
-       if (gpw == NULL) {
-               g_warning ("Could not get the active project\n");
-               return NULL;
-       }
-               
-       return gpw->project;
-}
-
 /**
  * glade_project_get_widget_by_name:
  * @project: The project in which to look for
diff -upr gnome2/glade3/src/glade-project.h glade3/src/glade-project.h
--- gnome2/glade3/src/glade-project.h   2003-04-16 22:50:28.000000000 +0200
+++ glade3/src/glade-project.h  2003-05-03 13:28:58.000000000 +0200
@@ -59,7 +59,6 @@ struct _GladeProjectClass
 
 guint glade_project_get_type (void);
 
-GladeProject *glade_project_get_active (void);
 GladeProject *glade_project_new (gboolean untitled);
 
 

--=-OtUxDm1n47qxeJFbdQOE--





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