[gtk+] Use g_value_dup_string instead.



commit d3fab727aef2b9fd59822a6018a383ceaf594411
Author: Hiroyuki Ikezoe <poincare ikezoe net>
Date:   Thu Dec 17 19:35:34 2009 +0900

    Use g_value_dup_string instead.
    
    g_value_get_string and g_strdup should be replaced by
    g_value_dup_string.

 gtk/gtkcellrenderertext.c |    2 +-
 gtk/gtkentry.c            |    2 +-
 gtk/gtktexttag.c          |    2 +-
 gtk/gtktextview.c         |    2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/gtk/gtkcellrenderertext.c b/gtk/gtkcellrenderertext.c
index bbdd21b..2ab0f14 100644
--- a/gtk/gtkcellrenderertext.c
+++ b/gtk/gtkcellrenderertext.c
@@ -1023,7 +1023,7 @@ gtk_cell_renderer_text_set_property (GObject      *object,
           priv->markup_set = FALSE;
         }
 
-      celltext->text = g_strdup (g_value_get_string (value));
+      celltext->text = g_value_dup_string (value);
       g_object_notify (object, "text");
       break;
 
diff --git a/gtk/gtkentry.c b/gtk/gtkentry.c
index 962fd41..f66c1da 100644
--- a/gtk/gtkentry.c
+++ b/gtk/gtkentry.c
@@ -1985,7 +1985,7 @@ gtk_entry_set_property (GObject         *object,
 
     case PROP_IM_MODULE:
       g_free (priv->im_module);
-      priv->im_module = g_strdup (g_value_get_string (value));
+      priv->im_module = g_value_dup_string (value);
       if (GTK_IS_IM_MULTICONTEXT (entry->im_context))
         gtk_im_multicontext_set_context_id (GTK_IM_MULTICONTEXT (entry->im_context), priv->im_module);
       break;
diff --git a/gtk/gtktexttag.c b/gtk/gtktexttag.c
index 5082553..98eea1d 100644
--- a/gtk/gtktexttag.c
+++ b/gtk/gtktexttag.c
@@ -995,7 +995,7 @@ gtk_text_tag_set_property (GObject      *object,
     {
     case PROP_NAME:
       g_return_if_fail (text_tag->name == NULL);
-      text_tag->name = g_strdup (g_value_get_string (value));
+      text_tag->name = g_value_dup_string (value);
       break;
 
     case PROP_BACKGROUND:
diff --git a/gtk/gtktextview.c b/gtk/gtktextview.c
index cf698ff..f7f3218 100644
--- a/gtk/gtktextview.c
+++ b/gtk/gtktextview.c
@@ -3000,7 +3000,7 @@ gtk_text_view_set_property (GObject         *object,
       
     case PROP_IM_MODULE:
       g_free (priv->im_module);
-      priv->im_module = g_strdup (g_value_get_string (value));
+      priv->im_module = g_value_dup_string (value);
       if (GTK_IS_IM_MULTICONTEXT (text_view->im_context))
         gtk_im_multicontext_set_context_id (GTK_IM_MULTICONTEXT (text_view->im_context), priv->im_module);
       break;



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