[glade] Removed project parameter check in glade_design_view_set_project()



commit 15a731edf1d96f843c1bf3de8fd9f8acfadf4930
Author: Juan Pablo Ugarte <juanpablougarte gmail com>
Date:   Tue Jan 22 15:20:56 2013 -0300

    Removed project parameter check in glade_design_view_set_project()

 gladeui/glade-design-view.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/gladeui/glade-design-view.c b/gladeui/glade-design-view.c
index a192e1c..e7b3e90 100644
--- a/gladeui/glade-design-view.c
+++ b/gladeui/glade-design-view.c
@@ -214,8 +214,6 @@ glade_design_view_set_project (GladeDesignView *view, GladeProject *project)
 {
   GladeDesignViewPrivate *priv;
 
-  g_return_if_fail (GLADE_IS_PROJECT (project));
-
   priv = view->priv;
 
   if (priv->project)
@@ -240,10 +238,13 @@ glade_design_view_set_project (GladeDesignView *view, GladeProject *project)
                                             view);
 
       g_object_set_data (G_OBJECT (priv->project), GLADE_DESIGN_VIEW_KEY, NULL);
-      g_object_unref (priv->project);
+      g_clear_object (&priv->project);
     }
 
-  view->priv->project = g_object_ref (project);
+  if (!project)
+    return;
+
+  priv->project = g_object_ref (project);
 
   g_signal_connect (project, "add-widget",
                     G_CALLBACK (on_project_add_widget), view);



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