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



commit 613a3312a4098105f64e3327df1fdeb49b5da05c
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                         | 2 +-
 libgimpwidgets/gimpwidgets.def                         | 2 +-
 4 files changed, 7 insertions(+), 7 deletions(-)
---
diff --git a/devel-docs/libgimpwidgets/libgimpwidgets3-sections.txt 
b/devel-docs/libgimpwidgets/libgimpwidgets3-sections.txt
index 6bd2235693..635895c0fb 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_nth_value
 gimp_unit_store_get_values
 <SUBSECTION Standard>
 GimpUnitStoreClass
diff --git a/libgimpwidgets/gimpunitstore.c b/libgimpwidgets/gimpunitstore.c
index 6d33080ab9..14924f2f0f 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_nth_value (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_nth_value (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..e6da7d1691 100644
--- a/libgimpwidgets/gimpunitstore.h
+++ b/libgimpwidgets/gimpunitstore.h
@@ -104,7 +104,7 @@ 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,
+gdouble         gimp_unit_store_get_nth_value    (GimpUnitStore *store,
                                                   GimpUnit       unit,
                                                   gint           index);
 void            gimp_unit_store_get_values       (GimpUnitStore *store,
diff --git a/libgimpwidgets/gimpwidgets.def b/libgimpwidgets/gimpwidgets.def
index 15abf75946..67319e4dc7 100644
--- a/libgimpwidgets/gimpwidgets.def
+++ b/libgimpwidgets/gimpwidgets.def
@@ -413,8 +413,8 @@ EXPORTS
        gimp_unit_combo_box_set_active
        gimp_unit_store_get_has_percent
        gimp_unit_store_get_has_pixels
+       gimp_unit_store_get_nth_value
        gimp_unit_store_get_type
-       gimp_unit_store_get_value
        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]