[libchamplain] Replace some g_object_get/set with direct function calls



commit 4ffdcb4eb75b74cb8ce3d0dadddc6f0d5865ebcd
Author: JiÅ?í Techet <techet gmail com>
Date:   Tue Mar 22 01:30:11 2011 +0100

    Replace some g_object_get/set with direct function calls

 champlain/champlain-marker-layer.c |    4 ++--
 champlain/champlain-path-layer.c   |    4 ++--
 champlain/champlain-scale.c        |    3 ++-
 champlain/champlain-view.c         |    8 +++++---
 4 files changed, 11 insertions(+), 8 deletions(-)
---
diff --git a/champlain/champlain-marker-layer.c b/champlain/champlain-marker-layer.c
index 03b6729..e83fd52 100644
--- a/champlain/champlain-marker-layer.c
+++ b/champlain/champlain-marker-layer.c
@@ -933,8 +933,8 @@ get_bounding_box (ChamplainLayer *layer)
       ChamplainMarker *marker = CHAMPLAIN_MARKER (elem->data);
       gdouble lat, lon;
 
-      g_object_get (G_OBJECT (marker), "latitude", &lat, "longitude", &lon,
-          NULL);
+      lat = champlain_location_get_latitude (CHAMPLAIN_LOCATION (marker));
+      lon = champlain_location_get_longitude (CHAMPLAIN_LOCATION (marker));
 
       champlain_bounding_box_extend (bbox, lat, lon);
     }
diff --git a/champlain/champlain-path-layer.c b/champlain/champlain-path-layer.c
index 950a722..2c791b0 100644
--- a/champlain/champlain-path-layer.c
+++ b/champlain/champlain-path-layer.c
@@ -808,8 +808,8 @@ get_bounding_box (ChamplainLayer *layer)
       ChamplainLocation *location = CHAMPLAIN_LOCATION (elem->data);
       gdouble lat, lon;
 
-      g_object_get (G_OBJECT (location), "latitude", &lat, "longitude", &lon,
-          NULL);
+      lat = champlain_location_get_latitude (location);
+      lon = champlain_location_get_longitude (location);
 
       champlain_bounding_box_extend (bbox, lat, lon);
     }
diff --git a/champlain/champlain-scale.c b/champlain/champlain-scale.c
index d2573c6..87dd88c 100644
--- a/champlain/champlain-scale.c
+++ b/champlain/champlain-scale.c
@@ -335,7 +335,8 @@ redraw_scale (ChamplainScale *scale)
 
   zoom_level = champlain_view_get_zoom_level (priv->view);
   map_source = champlain_view_get_map_source (priv->view);
-  g_object_get (G_OBJECT (priv->view), "latitude", &lat, "longitude", &lon, NULL);
+  lat = champlain_view_get_center_latitude (priv->view);
+  lon = champlain_view_get_center_longitude (priv->view);
   m_per_pixel = champlain_map_source_get_meters_per_pixel (map_source,
         zoom_level, lat, lon);
 
diff --git a/champlain/champlain-view.c b/champlain/champlain-view.c
index 650d163..c8a5930 100644
--- a/champlain/champlain-view.c
+++ b/champlain/champlain-view.c
@@ -1936,9 +1936,11 @@ view_load_visible_tiles (ChamplainView *view)
 
               DEBUG ("Loading tile %d, %d, %d", priv->zoom_level, x, y);
               tile = champlain_tile_new ();
-              g_object_set (G_OBJECT (tile), "x", x, "y", y,
-                  "zoom-level", priv->zoom_level,
-                  "size", size, NULL);
+              champlain_tile_set_x (tile, x);
+              champlain_tile_set_y (tile, y);
+              champlain_tile_set_zoom_level (tile, priv->zoom_level);
+              champlain_tile_set_size (tile, size);
+                  
               g_signal_connect (tile, "notify::state", G_CALLBACK (tile_state_notify), view);
               clutter_container_add_actor (CLUTTER_CONTAINER (priv->map_layer), CLUTTER_ACTOR (tile));
               view_position_tile (view, tile);



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