[gimp] app: remove "item_type" parameter from gimp_param_spec_item_id()



commit 31d7061e204412a774e5cc2c7006301e953bf46a
Author: Michael Natterer <mitch gimp org>
Date:   Thu Jul 8 22:40:48 2010 +0200

    app: remove "item_type" parameter from gimp_param_spec_item_id()
    
    and from gimp_value_get_item(). The functions are used nowhere, and
    the parameter is now in the way of adding item support to the PDB.

 app/core/gimpparamspecs.c |   13 ++++---------
 app/core/gimpparamspecs.h |    4 +---
 2 files changed, 5 insertions(+), 12 deletions(-)
---
diff --git a/app/core/gimpparamspecs.c b/app/core/gimpparamspecs.c
index 1e83433..ee9f48a 100644
--- a/app/core/gimpparamspecs.c
+++ b/app/core/gimpparamspecs.c
@@ -873,39 +873,34 @@ gimp_param_spec_item_id (const gchar *name,
                          const gchar *nick,
                          const gchar *blurb,
                          Gimp        *gimp,
-                         GType        item_type,
                          gboolean     none_ok,
                          GParamFlags  flags)
 {
   GimpParamSpecItemID *ispec;
 
   g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
-  g_return_val_if_fail (g_type_is_a (item_type, GIMP_TYPE_ITEM), NULL);
 
   ispec = g_param_spec_internal (GIMP_TYPE_PARAM_ITEM_ID,
                                  name, nick, blurb, flags);
 
-  ispec->gimp      = gimp;
-  ispec->item_type = item_type;
-  ispec->none_ok   = none_ok;
+  ispec->gimp    = gimp;
+  ispec->none_ok = none_ok;
 
   return G_PARAM_SPEC (ispec);
 }
 
 GimpItem *
 gimp_value_get_item (const GValue *value,
-                     Gimp         *gimp,
-                     GType         item_type)
+                     Gimp         *gimp)
 {
   GimpItem *item;
 
   g_return_val_if_fail (GIMP_VALUE_HOLDS_ITEM_ID (value), NULL);
   g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
-  g_return_val_if_fail (g_type_is_a (item_type, GIMP_TYPE_ITEM), NULL);
 
   item = gimp_item_get_by_ID (gimp, value->data[0].v_int);
 
-  if (item && ! g_type_is_a (G_TYPE_FROM_INSTANCE (item), item_type))
+  if (item && ! GIMP_IS_ITEM (item))
     return NULL;
 
   return item;
diff --git a/app/core/gimpparamspecs.h b/app/core/gimpparamspecs.h
index fe0c6e1..5fc931e 100644
--- a/app/core/gimpparamspecs.h
+++ b/app/core/gimpparamspecs.h
@@ -278,13 +278,11 @@ GParamSpec * gimp_param_spec_item_id     (const gchar  *name,
                                           const gchar  *nick,
                                           const gchar  *blurb,
                                           Gimp         *gimp,
-                                          GType         item_type,
                                           gboolean      none_ok,
                                           GParamFlags   flags);
 
 GimpItem   * gimp_value_get_item         (const GValue *value,
-                                          Gimp         *gimp,
-                                          GType         item_type);
+                                          Gimp         *gimp);
 void         gimp_value_set_item         (GValue       *value,
                                           GimpItem     *item);
 



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