[geocode-glib/wip/reverse-ret-place: 1/6] lib: Separate function to determine place type



commit d72aee7c4fe469f09e845dd1aa68a9d4a7378559
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Mon Jul 29 23:20:17 2013 +0300

    lib: Separate function to determine place type
    
    Separate out code to determine place type from attributes in to a
    separate function: get_place_type_from_attributes().
    
    https://bugzilla.gnome.org/show_bug.cgi?id=705112

 geocode-glib/geocode-forward.c |   18 ++++++++++++++----
 1 files changed, 14 insertions(+), 4 deletions(-)
---
diff --git a/geocode-glib/geocode-forward.c b/geocode-glib/geocode-forward.c
index cb48a59..e3d812d 100644
--- a/geocode-glib/geocode-forward.c
+++ b/geocode-glib/geocode-forward.c
@@ -535,12 +535,10 @@ static const char const *attributes[8] = {
        "village",
 };
 
-static GeocodePlace *
-create_place_from_attributes (GHashTable *ht)
+static GeocodePlaceType
+get_place_type_from_attributes (GHashTable *ht)
 {
-        GeocodePlace *place;
         char *class, *type;
-        const char *name, *street, *building;
         GeocodePlaceType place_type = GEOCODE_PLACE_TYPE_UNKNOWN;
 
         class = g_hash_table_lookup (ht, "class");
@@ -621,6 +619,18 @@ create_place_from_attributes (GHashTable *ht)
                 }
         }
 
+        return place_type;
+}
+
+static GeocodePlace *
+create_place_from_attributes (GHashTable *ht)
+{
+        GeocodePlace *place;
+        const char *name, *street, *building;
+        GeocodePlaceType place_type;
+
+        place_type = get_place_type_from_attributes (ht);
+
         name = g_hash_table_lookup (ht, "name");
         if (name == NULL)
                 name = g_hash_table_lookup (ht, "display_name");


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