[geocode-glib] lib: Make GeocodePlace:name writable



commit 705056d177db14be4fae150e2cdc3588713f2a6d
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Wed Jul 24 22:13:50 2013 +0300

    lib: Make GeocodePlace:name writable
    
    There is no good reason to keep this property construct-only and we'll
    need to overwrite it inside geocode-glib as well in a following patch.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=697218

 geocode-glib/geocode-glib.symbols |    1 +
 geocode-glib/geocode-place.c      |   18 +++++++++++++++++-
 geocode-glib/geocode-place.h      |    2 ++
 3 files changed, 20 insertions(+), 1 deletions(-)
---
diff --git a/geocode-glib/geocode-glib.symbols b/geocode-glib/geocode-glib.symbols
index 64c635a..0bf7a93 100644
--- a/geocode-glib/geocode-glib.symbols
+++ b/geocode-glib/geocode-glib.symbols
@@ -36,6 +36,7 @@ geocode_place_type_get_type
 geocode_place_new
 geocode_place_new_with_location
 geocode_place_get_name
+geocode_place_set_name
 geocode_place_get_place_type
 geocode_place_set_location
 geocode_place_get_location
diff --git a/geocode-glib/geocode-place.c b/geocode-glib/geocode-place.c
index fa25114..e74a010 100644
--- a/geocode-glib/geocode-place.c
+++ b/geocode-glib/geocode-place.c
@@ -292,7 +292,6 @@ geocode_place_class_init (GeocodePlaceClass *klass)
                                      "Name",
                                      NULL,
                                      G_PARAM_READWRITE |
-                                     G_PARAM_CONSTRUCT_ONLY |
                                      G_PARAM_STATIC_STRINGS);
         g_object_class_install_property (gplace_class, PROP_NAME, pspec);
 
@@ -531,6 +530,23 @@ geocode_place_new_with_location (const char      *name,
 }
 
 /**
+ * geocode_place_set_name:
+ * @place: A place
+ *
+ * Sets the name of the @place to @name.
+ **/
+void
+geocode_place_set_name (GeocodePlace *place,
+                        const char   *name)
+{
+        g_return_if_fail (GEOCODE_IS_PLACE (place));
+        g_return_if_fail (name != NULL);
+
+        g_free (place->priv->name);
+        place->priv->name = g_strdup (name);
+}
+
+/**
  * geocode_place_get_name:
  * @place: A place
  *
diff --git a/geocode-glib/geocode-place.h b/geocode-glib/geocode-place.h
index ec9d943..9af2531 100644
--- a/geocode-glib/geocode-place.h
+++ b/geocode-glib/geocode-place.h
@@ -134,6 +134,8 @@ GeocodePlace *geocode_place_new_with_location     (const char      *name,
                                                    GeocodePlaceType place_type,
                                                    GeocodeLocation *location);
 
+void geocode_place_set_name                       (GeocodePlace *place,
+                                                   const char   *name);
 const char *geocode_place_get_name                (GeocodePlace *place);
 
 GeocodePlaceType geocode_place_get_place_type     (GeocodePlace *place);


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