[gom] sorting: Fix the enum nicks



commit 80cdd480306f79e8a2b7c631bd7f0a063cf04c18
Author: Mathieu Bridon <bochecha daitauha fr>
Date:   Wed Jul 8 21:02:25 2015 +0200

    sorting: Fix the enum nicks
    
    When I wrote the sorting patches, I was at first using the nick strings
    as the string to insert in the SQL. As a result, I used "DESC" for the
    descending mode, and "" for the ascending mode, as for an ascending
    ORDER BY, you just don't add anything to the SQL.
    
    But then I realize it wasn't such a great idea to use the nick strings
    in this way, so the versions of the sorting patches that got merged
    don't do that any more.
    
    However I kept those nick strings in the enum.
    
    Turns out that GI-based bindings use the nick as the identifier for the
    enum member.
    
    For example, in Python, the descending mode would be:
    
        Gom.SortingMode.DESC
    
    Obviously, the empty string is not a great identifier.
    
    This commit fixes that, giving them proper nicks, which make things
    nicer to use in GI-based bindings.

 gom/gom-sorting.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/gom/gom-sorting.c b/gom/gom-sorting.c
index 915a0d5..bd91e8e 100644
--- a/gom/gom-sorting.c
+++ b/gom/gom-sorting.c
@@ -72,8 +72,8 @@ gom_sorting_mode_get_type (void)
    static GType g_type = 0;
    static gsize initialized = FALSE;
    static const GEnumValue values[] = {
-      { GOM_SORTING_ASCENDING,  "GOM_SORTING_ASCENDING",  "" },
-      { GOM_SORTING_DESCENDING, "GOM_SORTING_DESCENDING", "DESC" },
+      { GOM_SORTING_ASCENDING,  "GOM_SORTING_ASCENDING",  "ASCENDING" },
+      { GOM_SORTING_DESCENDING, "GOM_SORTING_DESCENDING", "DESCENDING" },
       { 0 }
    };
 


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