static void query_ready_cb (void *buffer, gsize count, GError *error, gpointer user_data) { FetchData *data = user_data; GList *list; if (error != NULL) { fetch_data_free (data); return; } list = make_file_list_from_search_result (buffer, count, 1); if (list != NULL) { GFile *file; file = g_file_new_for_uri ((char *) list->data); g_load_file_async (file, G_PRIORITY_DEFAULT, NULL, image_data_ready_for_query_cb, data); g_object_unref (file); } else fetch_data_free (data); _g_string_list_free (list); }
void fetch_cover_image_from_name (GooWindow *window, const char *album, const char *artist, GCancellable *cancellable) { FetchData *data; char *url; GFile *file; data = g_new0 (FetchData, 1); data->window = window; data->cancellable = _g_object_ref (cancellable); url = get_query (album, artist); file = g_file_new_for_uri (url); g_load_file_async (file, G_PRIORITY_DEFAULT, data->cancellable, query_ready_cb, data); g_object_unref (file); g_free (url); }
static void load_current_file (DialogData *data) { char *url; GFile *source; update_progress_label (data); if (data->current_file == NULL) { search_completed (data); return; } url = data->current_file->data; debug (DEBUG_INFO, "LOADING %s\n", url); source = g_file_new_for_uri (url); g_load_file_async (source, G_PRIORITY_DEFAULT, data->cancellable, search_image_data_ready_cb, data); g_object_unref (source); }
static void facebook_service_upload_current_file (FacebookService *self) { GthFileData *file_data; if (self->priv->post_photos->current == NULL) { upload_photos_done (self, NULL); return; } file_data = self->priv->post_photos->current->data; g_load_file_async (file_data->file, G_PRIORITY_DEFAULT, self->priv->post_photos->cancellable, upload_photo_file_buffer_ready_cb, self); }
static void start_searching (DialogData *data) { char *query; GFile *file; data->searching = TRUE; g_cancellable_reset (data->cancellable); gtk_widget_set_sensitive (GET_WIDGET ("cancel_search_button"), TRUE); query = get_query (data->album, data->artist); file = g_file_new_for_uri (query); g_load_file_async (file, G_PRIORITY_DEFAULT, data->cancellable, search_query_ready_cb, data); g_object_unref (file); g_free (query); }
void fetch_cover_image_from_asin (GooWindow *window, const char *asin, GCancellable *cancellable) { FetchData *data; char *url; GFile *file; data = g_new0 (FetchData, 1); data->window = window; data->cancellable = _g_object_ref (cancellable); url = g_strdup_printf ("http://images.amazon.com/images/P/%s.01._SCLZZZZZZZ_.jpg", asin); file = g_file_new_for_uri (url); g_load_file_async (file, G_PRIORITY_DEFAULT, data->cancellable, image_data_ready_for_asin_cb, data); g_object_unref (file); g_free (url); }
static void picasa_account_properties_dialog_construct (PicasaAccountPropertiesDialog *self, const char *email, const char *password, const char *challange_url) { if (email != NULL) gtk_entry_set_text (GTK_ENTRY (GET_WIDGET ("email_entry")), email); if (password != NULL) gtk_entry_set_text (GTK_ENTRY (GET_WIDGET ("password_entry")), password); if (challange_url != NULL) { char *url; GFile *file; url = g_strconcat ("http://www.google.com/accounts/", challange_url, NULL); file = g_file_new_for_uri (url); g_load_file_async (file, G_PRIORITY_DEFAULT, self->priv->cancellable, image_buffer_ready_cb, self); g_object_unref (file); g_free (url); } if (email == NULL) gtk_widget_grab_focus (GET_WIDGET ("email_entry")); else if (password == NULL) gtk_widget_grab_focus (GET_WIDGET ("password_entry")); else gtk_widget_grab_focus (GET_WIDGET ("challenge_entry")); }
static void file_info_ready_cb (GList *files, GError *error, gpointer user_data) { GthPixbufListTask *self = user_data; GthFileData *updated_file_data; GthFileData *file_data; if (error != NULL) { gth_task_completed (GTH_TASK (self), error); return; } file_data = self->priv->current->data; updated_file_data = (GthFileData*) files->data; g_file_info_copy_into (updated_file_data->info, file_data->info); g_load_file_async (file_data->file, G_PRIORITY_DEFAULT, gth_task_get_cancellable (GTH_TASK (self)), file_buffer_ready_cb, self); }