[gimp] app: gimp_tool_preset_new(): ignore the passed name



commit ab9cb53be8bff22ee3d058d27376b9b91135be0d
Author: Michael Natterer <mitch gimp org>
Date:   Tue Mar 22 15:08:11 2011 +0100

    app: gimp_tool_preset_new(): ignore the passed name
    
    and use GimpToolInfo's blurb, so new presets are by default called
    "Blend", "Paintbrush" etc. and not simply "Untitled".

 app/core/gimptoolpreset.c |    6 ++----
 app/core/gimptoolpreset.h |    2 +-
 2 files changed, 3 insertions(+), 5 deletions(-)
---
diff --git a/app/core/gimptoolpreset.c b/app/core/gimptoolpreset.c
index edc88b6..ce5a699 100644
--- a/app/core/gimptoolpreset.c
+++ b/app/core/gimptoolpreset.c
@@ -402,14 +402,12 @@ gimp_tool_preset_deserialize_property (GimpConfig *config,
 
 GimpData *
 gimp_tool_preset_new (GimpContext *context,
-                      const gchar *name)
+                      const gchar *unused)
 {
   GimpToolInfo *tool_info;
   const gchar  *stock_id;
 
   g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL);
-  g_return_val_if_fail (name != NULL, NULL);
-  g_return_val_if_fail (name[0] != '\0', NULL);
 
   tool_info = gimp_context_get_tool (context);
 
@@ -418,7 +416,7 @@ gimp_tool_preset_new (GimpContext *context,
   stock_id = gimp_viewable_get_stock_id (GIMP_VIEWABLE (tool_info));
 
   return g_object_new (GIMP_TYPE_TOOL_PRESET,
-                       "name",         name,
+                       "name",         tool_info->blurb,
                        "stock-id",     stock_id,
                        "gimp",         context->gimp,
                        "tool-options", tool_info->tool_options,
diff --git a/app/core/gimptoolpreset.h b/app/core/gimptoolpreset.h
index 3955bce..189cfb6 100644
--- a/app/core/gimptoolpreset.h
+++ b/app/core/gimptoolpreset.h
@@ -57,7 +57,7 @@ struct _GimpToolPresetClass
 GType                 gimp_tool_preset_get_type      (void) G_GNUC_CONST;
 
 GimpData            * gimp_tool_preset_new           (GimpContext    *context,
-                                                      const gchar    *name);
+                                                      const gchar    *unused);
 
 GimpContextPropMask   gimp_tool_preset_get_prop_mask (GimpToolPreset *preset);
 



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