void
champlain_map_source_set_name (ChamplainMapSource *map_source,
- const char *name)
+ const gchar *name)
{
ChamplainMapSourcePrivate *priv = GET_PRIVATE (map_source);
void
champlain_map_source_set_license (ChamplainMapSource *map_source,
- const char *license)
+ const gchar *license)
{
ChamplainMapSourcePrivate *priv = GET_PRIVATE (map_source);
ChamplainView *view, ChamplainZoomLevel *level, ChamplainTile *tile);
void champlain_map_source_set_name (ChamplainMapSource *map_source,
- const char *name);
+ const gchar *name);
const gchar * champlain_map_source_get_name (ChamplainMapSource *map_source);
void champlain_map_source_set_license (ChamplainMapSource *map_source,
- const char *license);
+ const gchar *license);
const gchar * champlain_map_source_get_license (ChamplainMapSource *map_source);
}
ChamplainNetworkMapSource*
-champlain_network_map_source_new_full (gchar *name,
- gchar *license,
- gchar *license_uri,
+champlain_network_map_source_new_full (const gchar *name,
+ const gchar *license,
+ const gchar *license_uri,
guint min_zoom,
guint max_zoom,
guint tile_size,
ChamplainMapProjection projection,
- gchar *uri_format)
+ const gchar *uri_format)
{
ChamplainNetworkMapSource * network_map_source;
network_map_source = g_object_new (CHAMPLAIN_TYPE_NETWORK_MAP_SOURCE, "name", name,
return network_map_source;
}
-gchar *
+const gchar *
champlain_network_map_source_get_tile_uri (ChamplainNetworkMapSource *network_map_source,
gint x,
gint y,
FileLoadedCallbackContext *ctx = (FileLoadedCallbackContext*) user_data;
GdkPixbufLoader* loader;
GError *error = NULL;
- gchar* path = NULL, *filename = NULL;
+ gchar* path = NULL;
+ const gchar *filename = NULL;
if (!SOUP_STATUS_IS_SUCCESSFUL (msg->status_code))
{
/*if (tile->to_destroy)
{
g_object_unref (loader);
- g_free (filename);
g_free (map_filename);
g_free (tile);
return;
else if (!priv->offline)
{
SoupMessage *msg;
- gchar *uri;
+ const gchar *uri;
FileLoadedCallbackContext *ctx = g_new0 (FileLoadedCallbackContext, 1);
ctx->view = view;
ctx->zoom_level = zoom_level;
GType champlain_network_map_source_get_type (void);
-ChamplainNetworkMapSource* champlain_network_map_source_new_full (gchar *name,
- gchar *license, gchar *license_uri, guint min_zoom, guint map_zoom,
- guint tile_size, ChamplainMapProjection projection, gchar *uri_format);
+ChamplainNetworkMapSource* champlain_network_map_source_new_full (
+ const gchar *name, const gchar *license, const gchar *license_uri,
+ guint min_zoom, guint map_zoom, guint tile_size,
+ ChamplainMapProjection projection, const gchar *uri_format);
ChamplainMapSource * champlain_map_source_new_osm_mapnik (void);
ChamplainMapSource * champlain_map_source_new_osm_cyclemap (void);
ChamplainMapSource * champlain_map_source_new_oam (void);
ChamplainMapSource * champlain_map_source_new_mff_relief (void);
-gchar * champlain_network_map_source_get_tile_uri (ChamplainNetworkMapSource *source,
+const gchar * champlain_network_map_source_get_tile_uri (ChamplainNetworkMapSource *source,
gint x, gint y, gint z);
void champlain_network_map_source_set_tile_uri (ChamplainNetworkMapSource *network_map_source,
champlain_tile_set_state (self, g_value_get_enum (value));
break;
case PROP_URI:
- champlain_tile_set_uri (self, g_value_dup_string (value));
+ champlain_tile_set_uri (self, g_value_get_string (value));
break;
case PROP_FILENAME:
- champlain_tile_set_filename (self, g_value_dup_string (value));
+ champlain_tile_set_filename (self, g_value_get_string (value));
break;
case PROP_ACTOR:
champlain_tile_set_actor (self, g_value_get_object (value));
static void
champlain_tile_finalize (GObject *object)
{
+ ChamplainTilePrivate *priv = GET_PRIVATE (object);
+
+ g_free (priv->uri);
+ g_free (priv->filename);
+
G_OBJECT_CLASS (champlain_tile_parent_class)->finalize (object);
}
return priv->state;
}
-gchar *
+const gchar *
champlain_tile_get_uri (ChamplainTile *self)
{
g_return_val_if_fail(CHAMPLAIN_TILE(self), NULL);
return priv->uri;
}
-gchar *
+const gchar *
champlain_tile_get_filename (ChamplainTile *self)
{
g_return_val_if_fail(CHAMPLAIN_TILE(self), NULL);
}
void
-champlain_tile_set_uri (ChamplainTile *self, gchar *uri)
+champlain_tile_set_uri (ChamplainTile *self,
+ const gchar *uri)
{
g_return_if_fail(CHAMPLAIN_TILE(self));
g_return_if_fail(uri != NULL);
ChamplainTilePrivate *priv = GET_PRIVATE (self);
- priv->uri = uri;
+ priv->uri = g_strdup (uri);
g_object_notify (G_OBJECT (self), "uri");
}
void
-champlain_tile_set_filename (ChamplainTile *self, gchar *filename)
+champlain_tile_set_filename (ChamplainTile *self,
+ const gchar *filename)
{
g_return_if_fail(CHAMPLAIN_TILE(self));
g_return_if_fail(filename != NULL);
ChamplainTilePrivate *priv = GET_PRIVATE (self);
- priv->filename = filename;
+ priv->filename = g_strdup (filename);
g_object_notify (G_OBJECT (self), "filename");
}
gint champlain_tile_get_zoom_level (ChamplainTile *self);
guint champlain_tile_get_size (ChamplainTile *self);
ChamplainState champlain_tile_get_state (ChamplainTile *self);
-gchar * champlain_tile_get_uri (ChamplainTile *self);
-gchar * champlain_tile_get_filename (ChamplainTile *self);
+const gchar * champlain_tile_get_uri (ChamplainTile *self);
+const gchar * champlain_tile_get_filename (ChamplainTile *self);
ClutterActor * champlain_tile_get_actor (ChamplainTile *self);
void champlain_tile_set_x (ChamplainTile *self, gint x);
void champlain_tile_set_zoom_level (ChamplainTile *self, gint zoom_level);
void champlain_tile_set_size (ChamplainTile *self, guint size);
void champlain_tile_set_state (ChamplainTile *self, ChamplainState state);
-void champlain_tile_set_uri (ChamplainTile *self, gchar* uri);
-void champlain_tile_set_filename (ChamplainTile *self, gchar* filename);
+void champlain_tile_set_uri (ChamplainTile *self, const gchar *uri);
+void champlain_tile_set_filename (ChamplainTile *self, const gchar *filename);
void champlain_tile_set_actor (ChamplainTile *self, ClutterActor* actor);
G_END_DECLS