[Glade-devel] [patch, glade3] clipboard does not need glade_project_window.h



--=-t2Ewq2qglz+M4Y0ejtMb
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

Hi!

Looking again to my last patch to glade-clipboard, I see that we can
easily get the project from the placeholder parent instead of using
glade_project_window_get_project. This way we can get rid of 
#include "glade_project_window.h"

ciao
        paolo

--=-t2Ewq2qglz+M4Y0ejtMb
Content-Disposition: attachment; filename=clipb-no-gpw.patch
Content-Type: text/x-patch; name=clipb-no-gpw.patch; charset=UTF-8
Content-Transfer-Encoding: 7bit

diff -upr gnome2/glade3/ChangeLog glade3/ChangeLog
--- gnome2/glade3/ChangeLog     2003-05-18 19:34:09.000000000 +0200
+++ glade3/ChangeLog    2003-05-21 18:51:38.000000000 +0200
@@ -1,3 +1,8 @@
+2003-05-21  Paolo Borelli  <pborelli katamail com>
+
+       * src/glade-clipboard: get the project from the placeholder parent,
+       this way we don't need to include glade-project-window.h.
+
 2003-05-18  Joaquin Cuenca Abela  <e98cuenc yahoo com>
 
        * src/glade-placeholder.c: Made glade_holder_replace independent of
diff -upr gnome2/glade3/src/glade-clipboard.c glade3/src/glade-clipboard.c
--- gnome2/glade3/src/glade-clipboard.c 2003-05-17 21:01:21.000000000 +0200
+++ glade3/src/glade-clipboard.c        2003-05-21 19:00:22.000000000 +0200
@@ -25,7 +25,6 @@
 #include "glade.h"
 #include "glade-clipboard-view.h"
 #include "glade-clipboard.h"
-#include "glade-project-window.h"
 #include "glade-widget.h"
 #include "glade-widget-class.h"
 #include "glade-placeholder.h"
@@ -191,7 +190,7 @@ glade_clipboard_copy (GladeClipboard *cl
 /**
  * glade_clipboard_paste:
  * @clipboard: 
- * @parent: 
+ * @placeholder: 
  * 
  * Paste a GladeWidget from the Clipboard.
  **/
@@ -207,19 +206,13 @@ glade_clipboard_paste (GladeClipboard *c
 
        widget = clipboard->curr;
 
-       /*
-        * FIXME: I think that GladePlaceholder should have a pointer
-        * to the project it belongs to, as GladeWidget does. This way
-        * the clipboard can be independent from glade-project-window.
-        *      Paolo.
-        */
-       project = glade_project_window_get_project ();
+       if (!widget)
+               return;
 
        parent = glade_placeholder_get_parent (placeholder);
 
-       if (!widget)
-               return;
-       
+       project = parent->project;
+
        widget->name = glade_widget_new_name (project, widget->class);
        widget->parent = parent;
        glade_packing_add_properties (widget);
@@ -253,9 +246,6 @@ glade_clipboard_paste (GladeClipboard *c
        if (GTK_IS_WIDGET (widget->widget))
                gtk_widget_show_all (GTK_WIDGET (widget->widget));
 
-       /*
-        * Finally remove widget from clipboard.
-        */
        glade_clipboard_remove (clipboard, widget);
 }
 

--=-t2Ewq2qglz+M4Y0ejtMb--





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