[libchamplain/libchamplain-0-4] Don't recreate a ClutterText object, just update the text



commit fef0db47be45ee56817b07ddf969305199a4b91f
Author: Pierre-Luc Beaudoin <pierre-luc pierlux com>
Date:   Mon Jan 4 18:32:08 2010 -0500

    Don't recreate a ClutterText object, just update the text

 champlain/champlain-view.c |   14 +++++---------
 1 files changed, 5 insertions(+), 9 deletions(-)
---
diff --git a/champlain/champlain-view.c b/champlain/champlain-view.c
index 2d370a9..33e613a 100644
--- a/champlain/champlain-view.c
+++ b/champlain/champlain-view.c
@@ -1413,18 +1413,14 @@ update_license (ChamplainView *view)
 {
   ChamplainViewPrivate *priv = view->priv;
 
-  if (priv->license_actor)
-  {
-    g_object_unref (priv->license_actor);
-    clutter_container_remove_actor (CLUTTER_CONTAINER (priv->stage),
-        priv->license_actor);
-    priv->license_actor = NULL;
-  }
-
-  if (priv->show_license)
+  if (!priv->license_actor)
     {
       priv->license_actor = g_object_ref (clutter_text_new_with_text ("sans 8",
           champlain_map_source_get_license (priv->map_source)));
+    }
+
+  if (priv->show_license)
+    {
       clutter_actor_set_opacity (priv->license_actor, 128);
       clutter_actor_show (priv->license_actor);
 



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