[gimp/wip/nielsdg/unitstore-conflict-name: 3/3] libgimpwidgets: UnitStore: Fix conflicting names



commit aed1a1e04f7d332ab87bf7c463d5504ed4e557c8
Author: Niels De Graef <nielsdegraef gmail com>
Date:   Tue Aug 20 18:21:45 2019 +0200

    libgimpwidgets: UnitStore: Fix conflicting names
    
    `gimp_unit_store_get_value()` clashes with the `get_value()` method of
    its parent class GtkTreeStore. This means trouble for bindings, as seen
    here in some pseudocode:
    
    ```vala
    var unit_store = new Gimp.UnitStore();
    // Which function are we referencing here, the one from GtkTreeStore or
    // the one from GimpUnitStore? Worse, they both have different arguments
    unit_store.get_value( ... )
    ```

 devel-docs/libgimpwidgets/libgimpwidgets3-sections.txt | 2 +-
 libgimpwidgets/gimpunitstore.c                         | 8 ++++----
 libgimpwidgets/gimpunitstore.h                         | 6 +++---
 libgimpwidgets/gimpwidgets.def                         | 2 +-
 4 files changed, 9 insertions(+), 9 deletions(-)
---
diff --git a/devel-docs/libgimpwidgets/libgimpwidgets3-sections.txt 
b/devel-docs/libgimpwidgets/libgimpwidgets3-sections.txt
index 6bd2235693..a4b81a9784 100644
--- a/devel-docs/libgimpwidgets/libgimpwidgets3-sections.txt
+++ b/devel-docs/libgimpwidgets/libgimpwidgets3-sections.txt
@@ -716,7 +716,7 @@ gimp_unit_store_set_pixel_value
 gimp_unit_store_set_pixel_values
 gimp_unit_store_set_resolution
 gimp_unit_store_set_resolutions
-gimp_unit_store_get_value
+gimp_unit_store_get_value_at_index
 gimp_unit_store_get_values
 <SUBSECTION Standard>
 GimpUnitStoreClass
diff --git a/libgimpwidgets/gimpunitstore.c b/libgimpwidgets/gimpunitstore.c
index 6d33080ab9..9867280511 100644
--- a/libgimpwidgets/gimpunitstore.c
+++ b/libgimpwidgets/gimpunitstore.c
@@ -851,9 +851,9 @@ gimp_unit_store_set_resolutions  (GimpUnitStore *store,
 }
 
 gdouble
-gimp_unit_store_get_value (GimpUnitStore *store,
-                           GimpUnit       unit,
-                           gint           index)
+gimp_unit_store_get_value_at_index (GimpUnitStore *store,
+                                    GimpUnit       unit,
+                                    gint           index)
 {
   GimpUnitStorePrivate *private;
   GtkTreeIter          iter;
@@ -894,7 +894,7 @@ gimp_unit_store_get_values (GimpUnitStore *store,
   for (i = 0; i < private->num_values; )
     {
       if (first_value)
-        *first_value = gimp_unit_store_get_value (store, unit, i);
+        *first_value = gimp_unit_store_get_value_at_index (store, unit, i);
 
       if (++i < private->num_values)
         first_value = va_arg (args, gdouble *);
diff --git a/libgimpwidgets/gimpunitstore.h b/libgimpwidgets/gimpunitstore.h
index 010ba7e16f..78203e42e5 100644
--- a/libgimpwidgets/gimpunitstore.h
+++ b/libgimpwidgets/gimpunitstore.h
@@ -104,9 +104,9 @@ void            gimp_unit_store_set_resolution   (GimpUnitStore *store,
 void            gimp_unit_store_set_resolutions  (GimpUnitStore *store,
                                                   gdouble        first_resolution,
                                                   ...);
-gdouble         gimp_unit_store_get_value        (GimpUnitStore *store,
-                                                  GimpUnit       unit,
-                                                  gint           index);
+gdouble         gimp_unit_store_get_value_at_index (GimpUnitStore *store,
+                                                    GimpUnit       unit,
+                                                    gint           index);
 void            gimp_unit_store_get_values       (GimpUnitStore *store,
                                                   GimpUnit       unit,
                                                   gdouble       *first_value,
diff --git a/libgimpwidgets/gimpwidgets.def b/libgimpwidgets/gimpwidgets.def
index 15abf75946..272e9db197 100644
--- a/libgimpwidgets/gimpwidgets.def
+++ b/libgimpwidgets/gimpwidgets.def
@@ -414,7 +414,7 @@ EXPORTS
        gimp_unit_store_get_has_percent
        gimp_unit_store_get_has_pixels
        gimp_unit_store_get_type
-       gimp_unit_store_get_value
+       gimp_unit_store_get_value_at_index
        gimp_unit_store_get_values
        gimp_unit_store_new
        gimp_unit_store_set_has_percent


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