Verified Commit 0840e230 authored by James Westman's avatar James Westman
Browse files

network-tile-source: Minor fixes

parent 130033e6
Pipeline #273116 passed with stage
in 2 minutes and 48 seconds
......@@ -879,7 +879,7 @@ on_message_sent (GObject *source_object, GAsyncResult *res, gpointer user_data)
/* Verify if the server sent an etag and save it */
g_clear_pointer (&data->etag, g_free);
data->etag = g_strdup (soup_message_headers_get_one (data->msg->response_headers, "ETag"));
DEBUG ("Received ETag %s", etag);
DEBUG ("Received ETag %s", data->etag);
gdk_pixbuf_new_from_stream_async (input_stream, cancellable, on_pixbuf_created, g_object_ref (task));
}
......@@ -894,7 +894,7 @@ on_pixbuf_created (GObject *source_object, GAsyncResult *res, gpointer user_data
FillTileData *data = g_task_get_task_data (task);
ShumateNetworkTileSourcePrivate *priv = shumate_network_tile_source_get_instance_private (data->self);
GCancellable *cancellable = g_task_get_cancellable (task);
GError *error = NULL;
g_autoptr(GError) error = NULL;
g_autoptr(GdkPixbuf) pixbuf = NULL;
g_autoptr(GdkTexture) texture = NULL;
g_autofree char *buffer = NULL;
......@@ -903,15 +903,12 @@ on_pixbuf_created (GObject *source_object, GAsyncResult *res, gpointer user_data
pixbuf = gdk_pixbuf_new_from_stream_finish (res, &error);
if (error != NULL)
{
g_task_return_error (task, error);
g_task_return_error (task, g_steal_pointer (&error));
return;
}
if (!gdk_pixbuf_save_to_buffer (pixbuf, &buffer, &buffer_size, "png", &error, NULL))
{
g_warning ("Unable to export tile: %s", error->message);
g_clear_pointer (&error, g_error_free);
}
g_warning ("Unable to export tile: %s", error->message);
else
{
g_autoptr(GBytes) bytes = g_bytes_new_take (g_steal_pointer (&buffer), buffer_size);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment