Ejemplo n.º 1
0
static void
add_file_to_dialog (gpointer data, gpointer user_data)
{
	CopyThemeDialogPrivate *priv;
	GFile *file;
	gchar *basename = NULL, *raw_basename;

	priv = COPY_THEME_DIALOG (user_data)->priv;
	file = G_FILE (data);

	raw_basename = g_file_get_basename (file);
	if (g_str_has_suffix (raw_basename, ".desktop"))
	{
		/* FIXME: validate key file? */
		basename = g_strndup (raw_basename,
		                      /* 8 = strlen (".desktop") */
		                      strlen (raw_basename) - 8);
	}
	g_free (raw_basename);

	if (basename)
	{
		g_object_ref (file);
		priv->all_files = g_slist_append (priv->all_files, file);
		priv->all_basenames = g_slist_append (priv->all_basenames, basename);
		priv->total_files++;
	}

	else
	{
		GtkWidget *dialog;
		gchar *uri;

		dialog = gtk_message_dialog_new (GTK_WINDOW (user_data),
		                                 GTK_DIALOG_MODAL,
		                                 GTK_MESSAGE_ERROR,
		                                 GTK_BUTTONS_OK,
		                                 _("Invalid screensaver theme"));
		uri = g_file_get_uri (file);
		gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
		        _("%s does not appear to be a valid screensaver theme."),
		        uri);
		g_free (uri);
		gtk_window_set_title (GTK_WINDOW (dialog), "");
		gtk_window_set_icon_name (GTK_WINDOW (dialog), "preferences-desktop-screensaver");

		gtk_dialog_run (GTK_DIALOG (dialog));
		gtk_widget_destroy (dialog);
	}
}
Ejemplo n.º 2
0
static void on_file_replace_ready (GObject *object, GAsyncResult *res, gpointer data)
{
	GError *error = NULL;
	GDownloadable *download = G_DOWNLOADABLE (data);
	GioDownload *gio_download = GIO_DOWNLOAD (data);
	g_assert (download != NULL);

	gio_download->priv->output = g_file_replace_finish (G_FILE(object), res, &error);
	//	GFileOutputStream *out_stream = g_file_replace_finish (G_FILE(object), res, &error);
	//	gio_download->priv->output	  = g_buffered_output_stream_new_sized (G_OUTPUT_STREAM(out_stream),
	//																	CHUNK_BUFF_SIZE);
	handle_critical_error (error);
	read_input_stream (download);
}
Ejemplo n.º 3
0
void
fr_file_selector_dialog_set_selected_files (FrFileSelectorDialog  *self,
					    GList                 *files)
{
	GFile *folder;

	if (files == NULL)
		return;

	folder = g_file_get_parent (G_FILE (files->data));
	_set_current_folder (self, folder, files);

	g_object_unref (folder);
}
Ejemplo n.º 4
0
static void
photos_thumbnailer_generate_thumbnail_replace (GObject *source_object, GAsyncResult *res, gpointer user_data)
{
  GCancellable *cancellable;
  GFile *thumbnail_file = G_FILE (source_object);
  g_autoptr (GFileOutputStream) stream = NULL;
  g_autoptr (GTask) task = G_TASK (user_data);
  PhotosThumbnailerGenerateData *data;
  const gchar *prgname;
  g_autofree gchar *original_height_str = NULL;
  g_autofree gchar *original_width_str = NULL;
  g_autofree gchar *uri = NULL;

  cancellable = g_task_get_cancellable (task);
  data = g_task_get_task_data (task);

  {
    g_autoptr (GError) error = NULL;

    stream = g_file_replace_finish (thumbnail_file, res, &error);
    if (error != NULL)
      {
        g_task_return_error (task, g_steal_pointer (&error));
        goto out;
      }
  }

  g_assert_null (data->stream);
  data->stream = g_object_ref (stream);

  original_height_str = g_strdup_printf ("%" G_GINT64_FORMAT, data->original_height);
  original_width_str = g_strdup_printf ("%" G_GINT64_FORMAT, data->original_width);
  prgname = g_get_prgname ();
  uri = g_file_get_uri (data->file);
  gdk_pixbuf_save_to_stream_async (data->pixbuf_thumbnail,
                                   G_OUTPUT_STREAM (stream),
                                   "png",
                                   cancellable,
                                   photos_thumbnailer_generate_thumbnail_save_to_stream,
                                   g_object_ref (task),
                                   "tEXt::Software", prgname,
                                   "tEXt::Thumb::URI", uri,
                                   "tEXt::Thumb::Image::Height", original_height_str,
                                   "tEXt::Thumb::Image::Width", original_width_str,
                                   NULL);

 out:
  return;
}
Ejemplo n.º 5
0
Archivo: gio-du.c Proyecto: ebassi/glib
static void
async_ready_func (GObject      *source,
                  GAsyncResult *result,
                  gpointer      user_data)
{
  const gchar *filename = user_data;
  GError *error = NULL;
  guint64 disk_usage;
  guint64 num_dirs;
  guint64 num_files;

  g_file_measure_disk_usage_finish (G_FILE (source), result, &disk_usage, &num_dirs, &num_files, &error);
  print_result (filename, disk_usage, num_dirs, num_files, error, '\n');
  outstanding_asyncs--;
}
Ejemplo n.º 6
0
static void g_file_copy_async_finish_handler(GObject *source_object,
            GAsyncResult *res, gpointer user_data)
{
    GtkProgressBar *progress_bar = GTK_PROGRESS_BAR(user_data);
    COPY_ASYNC_FINISH =  g_file_copy_finish(G_FILE(source_object), res, NULL);

    gtk_progress_bar_set_show_text(progress_bar,TRUE);
    gtk_progress_bar_set_text(progress_bar, "Finished");
    gtk_progress_bar_set_fraction(progress_bar, 1.0);
    g_debug("_copy_files_async_true Finished");

    GtkWidget *parent = gtk_widget_get_parent((GtkWidget *)progress_bar);
    gtk_widget_destroy((GtkWidget *)progress_bar);
    gtk_widget_destroy(parent);
}
Ejemplo n.º 7
0
static void
create_thumbnail (GTask *task,
                  gpointer source_object,
                  gpointer task_data,
                  GCancellable *cancellable)
{
  GFile *file = G_FILE (source_object);
  GnomeDesktopThumbnailFactory *factory = NULL;
  GError *error = NULL;
  GFileInfo *info = NULL;
  gchar *uri = NULL;
  GdkPixbuf *pixbuf = NULL;
  guint64 mtime;

  uri = g_file_get_uri (file);

  info = g_file_query_info (file, ATTRIBUTES_FOR_THUMBNAIL,
                            G_FILE_QUERY_INFO_NONE,
                            NULL, &error);

  if (info == NULL)
    {
      g_task_return_error (task, error);
      goto out;
    }

  mtime = g_file_info_get_attribute_uint64 (info, G_FILE_ATTRIBUTE_TIME_MODIFIED);

  factory = gnome_desktop_thumbnail_factory_new (GNOME_DESKTOP_THUMBNAIL_SIZE_LARGE);
  pixbuf = gnome_desktop_thumbnail_factory_generate_thumbnail
    (factory, 
     uri, g_file_info_get_content_type (info));

  if (pixbuf == NULL)
    {
      g_task_return_new_error (task, G_IO_ERROR, G_IO_ERROR_FAILED, "GnomeDesktopThumbnailFactory failed");
      goto out;
    }

  gnome_desktop_thumbnail_factory_save_thumbnail (factory, pixbuf, uri, (time_t) mtime);
  g_task_return_boolean (task, TRUE);

 out:
  g_clear_object (&info);
  g_clear_object (&factory);
  g_clear_object (&pixbuf);
  g_free (uri);
}
static void
copy_finished_cb (GObject      *source_object,
                  GAsyncResult *result,
                  gpointer      pointer)
{
  GError *err = NULL;
  CcBackgroundPanel *panel = (CcBackgroundPanel *) pointer;
  CcBackgroundPanelPrivate *priv = panel->priv;
  CcBackgroundItem *item;

  if (!g_file_copy_finish (G_FILE (source_object), result, &err))
    {
      if (err->code != G_IO_ERROR_CANCELLED)
        g_warning ("Failed to copy image to cache location: %s", err->message);

      g_error_free (err);
    }
  item = g_object_get_data (source_object, "item");

  g_settings_apply (priv->settings);

  /* the panel may have been destroyed before the callback is run, so be sure
   * to check the widgets are not NULL */

  if (priv->spinner)
    {
      gtk_widget_destroy (GTK_WIDGET (priv->spinner));
      priv->spinner = NULL;
    }

  if (priv->current_background)
    cc_background_item_load (priv->current_background, NULL);

  if (priv->builder)
    {
      char *filename;

      update_preview (priv, item);

      /* Save the source XML if there is one */
      filename = get_save_path ();
      if (create_save_dir ())
        cc_background_xml_save (priv->current_background, filename);
    }

  /* remove the reference taken when the copy was set up */
  g_object_unref (panel);
}
Ejemplo n.º 9
0
static void on_size_query_ready (GObject * object, GAsyncResult * result, gpointer data)
{
	GError *error = NULL;
	GFileInfo *info = g_file_query_info_finish (G_FILE(object), result, &error);
	GDownloadable *download = G_DOWNLOADABLE(data);
	g_assert (download != NULL);
	
	if (error) {
		handle_error (error);
		g_downloadable_set_status (download, G_DOWNLOADABLE_NETWORK_ERROR);
		
	} else {
		download->priv->size = g_file_info_get_attribute_uint64 (info, G_FILE_ATTRIBUTE_STANDARD_SIZE);
		g_object_unref (info);
	}
}
Ejemplo n.º 10
0
static void
on_replace_file_ready (GObject *source, GAsyncResult *res, gpointer user_data)
{
	GcrCertificateExporter *self = GCR_CERTIFICATE_EXPORTER (user_data);
	GFile *file = G_FILE (source);
	GFileOutputStream *os;

	os = g_file_replace_finish (file, res, &self->pv->error);

	if (self->pv->error) {
		complete_async_result (self);
		return;
	}

	write_to_outputstream (self, G_OUTPUT_STREAM (os));
}
Ejemplo n.º 11
0
void TrashLauncherIcon::UpdateTrashIconCb(GObject* source, GAsyncResult* res, gpointer data)
{
  auto self = static_cast<TrashLauncherIcon*>(data);

  // FIXME: should use the generic LoadIcon function (not taking from the unity theme)
  glib::Object<GFileInfo> info(g_file_query_info_finish(G_FILE(source), res, nullptr));

  if (info)
  {
    glib::Object<GIcon> icon(g_file_info_get_icon(info), glib::AddRef());
    glib::String icon_string(g_icon_to_string(icon));

    self->icon_name = icon_string.Str();
    self->empty_ = (self->icon_name == "user-trash");
  }
}
Ejemplo n.º 12
0
static void
copy_wallpaper_ready_cb (GObject      *source_object,
			 GAsyncResult *res,
			 gpointer      user_data)
{
	WallpaperData *wdata = user_data;
	GError        *error = NULL;

	if (! g_file_copy_finish (G_FILE (source_object), res, &error)) {
		_gtk_error_dialog_from_gerror_run (GTK_WINDOW (wdata->browser), _("Could not set the desktop background"), error);
		g_clear_error (&error);
		wallpaper_data_free (wdata);
		return;
	}

	wallpaper_data_set (wdata);
}
Ejemplo n.º 13
0
static void
find_file_insensitive_exists_callback (GObject *source_object,
                                       GAsyncResult *res,
                                       gpointer user_data)
{
  GFileInfo *info;
  InsensitiveFileSearchData *data = (InsensitiveFileSearchData *) (user_data);

  /* The file exists and can be found with the given path, no need to search. */
  if ((info = g_file_query_info_finish (G_FILE (source_object), res, NULL)))
    {
      GSimpleAsyncResult *simple;

      simple = g_simple_async_result_new (G_OBJECT (data->root),
                                          data->callback,
                                          data->user_data,
                                          _g_find_file_insensitive_async);

      g_simple_async_result_set_op_res_gpointer (simple, g_object_ref (source_object), g_object_unref);
      g_simple_async_result_complete_in_idle (simple);
      g_object_unref (simple);
      clear_find_file_insensitive_state (data);
      g_object_unref (info);
    }

  else
    {
      data->split_path = g_strsplit (data->original_path, G_DIR_SEPARATOR_S, -1);
      data->index = 0;
      data->enumerator = NULL;
      data->current_file = g_object_ref (data->root);

      /* Skip any empty components due to multiple slashes */
      while (data->split_path[data->index] != NULL &&
             *data->split_path[data->index] == 0)
        data->index++;

      g_file_enumerate_children_async (data->current_file,
                                       G_FILE_ATTRIBUTE_STANDARD_NAME,
                                       0, G_PRIORITY_DEFAULT,
                                       data->cancellable,
                                       enumerated_children_callback, data);
    }

  g_object_unref (source_object);
}
Ejemplo n.º 14
0
static void
remote_file_copy_cb (GObject *source,
                     GAsyncResult *res,
                     gpointer user_data)
{
  PdfLoadJob *job = user_data;
  GError *error = NULL;
  char *uri;

  g_file_copy_finish (G_FILE (source), res, &error);
  if (error != NULL) {
    pdf_load_job_complete_error (job, error);
    return;
  }

  pdf_load_job_cache_set_attributes (job);
}
static gboolean
message_handler (GstBus * bus, GstMessage * message, gpointer user_data)
{
  switch (GST_MESSAGE_TYPE (message)) {
    case GST_MESSAGE_ELEMENT:{
      const GstStructure *s = gst_message_get_structure (message);
      const gchar *name = gst_structure_get_name (s);

      if (strcmp (name, "not-mounted") == 0) {
        GMountOperation *mop = gtk_mount_operation_new (NULL);
        GFile *file =
            G_FILE (g_value_get_object (gst_structure_get_value (s, "file")));

        g_print ("not-mounted\n");
        gst_element_set_state (pipeline, GST_STATE_NULL);
        gst_bus_set_flushing (bus, TRUE);

        g_file_mount_enclosing_volume (file, G_MOUNT_MOUNT_NONE,
            mop, NULL, mount_cb, bus);

        g_object_unref (mop);
      }
      break;
    }

    case GST_MESSAGE_EOS:
      g_print ("EOS\n");
      gtk_main_quit ();
      break;
    case GST_MESSAGE_ERROR:{
      GError *err = NULL;

      gst_message_parse_error (message, &err, NULL);
      g_print ("error: %s\n", err->message);
      g_clear_error (&err);

      gtk_main_quit ();
      break;
    }
    default:
      break;
  }

  return TRUE;
}
Ejemplo n.º 16
0
static void
enum_child_cb (GObject *obj, GAsyncResult *result, gpointer data)
{
	RBAndroidSource *source = RB_ANDROID_SOURCE (data);
	RBAndroidSourcePrivate *priv = GET_PRIVATE(source);
	GFileEnumerator *e;
	GError *error = NULL;

	e = g_file_enumerate_children_finish (G_FILE (obj), result, &error);
	if (e == NULL) {
		rb_debug ("enum error: %s", error->message);
		g_clear_error (&error);
		music_dirs_done (source);
		return;
	}

	g_file_enumerator_next_files_async (e, 64, G_PRIORITY_DEFAULT, priv->cancel, enum_files_cb, source);
}
Ejemplo n.º 17
0
static GFile *
_g_find_file_insensitive_finish (GFile        *parent,
                                 GAsyncResult *result,
                                 GError      **error)
{
  GSimpleAsyncResult *simple;
  GFile *file;

  g_return_val_if_fail (G_IS_SIMPLE_ASYNC_RESULT (result), NULL);

  simple = G_SIMPLE_ASYNC_RESULT (result);

  if (g_simple_async_result_propagate_error (simple, error))
    return NULL;

  file = G_FILE (g_simple_async_result_get_op_res_gpointer (simple));
  return g_object_ref (file);
}
Ejemplo n.º 18
0
static void
gtr_po_set_property (GObject      *object,
                     guint         prop_id,
                     const GValue *value,
                     GParamSpec   *pspec)
{
  GtrPo *po = GTR_PO (object);

  switch (prop_id)
    {
    case PROP_LOCATION:
      gtr_po_set_location (po, G_FILE (g_value_get_object (value)));
      break;
    default:
      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
      break;
    }
}
Ejemplo n.º 19
0
static void
file_replaced_cb (GObject      *source,
		  GAsyncResult *res,
		  gpointer      user_data)
{
	SoupCacheInputStream *istream = SOUP_CACHE_INPUT_STREAM (user_data);
	SoupCacheInputStreamPrivate *priv = istream->priv;
	GError *error = NULL;

	priv->output_stream = (GOutputStream *) g_file_replace_finish (G_FILE (source), res, &error);

	if (error)
		notify_and_clear (istream, error);
	else
		try_write_next_buffer (istream);

	g_object_unref (istream);
}
Ejemplo n.º 20
0
static void
mount_done_cb (GObject *object,
               GAsyncResult *res,
               gpointer user_data)
{
  gboolean succeeded;
  GError *error = NULL;

  succeeded = g_file_mount_enclosing_volume_finish (G_FILE (object), res, &error);

  if (!succeeded)
    g_printerr (_("Error mounting location: %s\n"), error->message);

  outstanding_mounts--;

  if (outstanding_mounts == 0)
    g_main_loop_quit (main_loop);
}
Ejemplo n.º 21
0
/* Helper for e_reap_trash_directory() */
static void
reap_trash_directory_thread (GSimpleAsyncResult *simple,
                             GObject *object,
                             GCancellable *cancellable)
{
	gssize expiry_in_days;
	GError *error = NULL;

	expiry_in_days = g_simple_async_result_get_op_res_gssize (simple);

	e_reap_trash_directory_sync (
		G_FILE (object),
		(gint) expiry_in_days,
		cancellable, &error);

	if (error != NULL)
		g_simple_async_result_take_error (simple, error);
}
Ejemplo n.º 22
0
static GFile *
g_resource_file_get_parent (GFile *file)
{
  GResourceFile *resource = G_RESOURCE_FILE (file);
  GResourceFile *parent;
  gchar *end;

  end = strrchr (resource->path, '/');

  if (end == G_RESOURCE_FILE (file)->path)
    return NULL;

  parent = g_object_new (G_TYPE_RESOURCE_FILE, NULL);
  parent->path = g_strndup (resource->path,
			    end - resource->path);

  return G_FILE (parent);
}
Ejemplo n.º 23
0
/**
 * Called when finishing mount operation. Result of operation is set in 
 * nsGIOInputStream. This function is called in main thread as an async request 
 * typically from dbus.
 * @param source_object GFile object which requested the mount
 * @param res result object
 * @param user_data pointer to nsGIOInputStream
 */
static void
mount_enclosing_volume_finished (GObject *source_object,
                                 GAsyncResult *res,
                                 gpointer user_data)
{
  GError *error = nullptr;

  nsGIOInputStream* istream = static_cast<nsGIOInputStream*>(user_data);
  
  g_file_mount_enclosing_volume_finish(G_FILE (source_object), res, &error);
  
  if (error) {
    g_warning("Mount failed: %s %d", error->message, error->code);
    istream->SetMountResult(MOUNT_OPERATION_FAILED, error->code);
    g_error_free(error);
  } else {
    istream->SetMountResult(MOUNT_OPERATION_SUCCESS, 0);
  }
}
static void
mount_cb (GObject * obj, GAsyncResult * res, gpointer user_data)
{
  gboolean ret;
  GError *err = NULL;

  ret = g_file_mount_enclosing_volume_finish (G_FILE (obj), res, &err);

  if (ret) {
    g_print ("mounted successfully\n");
    gst_bus_set_flushing ((GstBus *) user_data, FALSE);

    gst_element_set_state (pipeline, GST_STATE_PLAYING);
  } else {
    g_print ("mounting failed: %s\n", err->message);
    g_clear_error (&err);
    gtk_main_quit ();
  }
}
Ejemplo n.º 25
0
static void
enumerate_children_async_cb (GObject *source,
                             GAsyncResult *res,
                             gpointer user_data)
{
  EnumerateJob *job = user_data;
  GFileEnumerator *enumerator;

  enumerator = g_file_enumerate_children_finish (G_FILE (source),
                                                 res, NULL);
  if (!enumerator) {
    enumerate_job_finish (job);
    return;
  }

  g_file_enumerator_next_files_async (enumerator, G_MAXINT,
                                      G_PRIORITY_DEFAULT,
                                      NULL, enumerate_next_files_async_cb, job);  
}
Ejemplo n.º 26
0
static void
photos_base_item_refresh_thumb_path_pixbuf (GObject *source_object, GAsyncResult *res, gpointer user_data)
{
  PhotosBaseItem *self = PHOTOS_BASE_ITEM (user_data);
  PhotosBaseItemPrivate *priv = self->priv;
  GApplication *app;
  GdkPixbuf *pixbuf = NULL;
  GdkPixbuf *scaled_pixbuf = NULL;
  GError *error = NULL;
  GInputStream *stream = G_INPUT_STREAM (source_object);
  gint icon_size;
  gint scale;

  pixbuf = gdk_pixbuf_new_from_stream_finish (res, &error);
  if (error != NULL)
    {
      GFile *file;
      gchar *uri;

      file = G_FILE (g_object_get_data (G_OBJECT (stream), "file"));
      uri = g_file_get_uri (file);
      g_warning ("Unable to create pixbuf from %s: %s", uri, error->message);
      priv->failed_thumbnailing = TRUE;
      priv->thumb_path = NULL;
      g_file_delete_async (file, G_PRIORITY_DEFAULT, NULL, NULL, NULL);
      photos_base_item_set_failed_icon (self);
      g_free (uri);
      g_error_free (error);
      goto out;
    }

  app = g_application_get_default ();
  scale = photos_application_get_scale_factor (PHOTOS_APPLICATION (app));
  icon_size = photos_utils_get_icon_size_unscaled ();
  scaled_pixbuf = photos_utils_downscale_pixbuf_for_scale (pixbuf, icon_size, scale);
  photos_base_item_set_original_icon (self, scaled_pixbuf);

 out:
  g_input_stream_close_async (stream, G_PRIORITY_DEFAULT, NULL, NULL, NULL);
  g_clear_object (&scaled_pixbuf);
  g_clear_object (&pixbuf);
  g_object_unref (self);
}
Ejemplo n.º 27
0
static void
font_install_finished_cb (GObject      *source_object,
                          GAsyncResult *res,
                          gpointer      data)
{
    GError *err = NULL;

    g_file_copy_finish (G_FILE (source_object), res, &err);

    if (!err) {
        gtk_button_set_label (GTK_BUTTON (data), _("Installed"));
    }
    else {
        gtk_button_set_label (GTK_BUTTON (data), _("Install Failed"));
        g_debug ("Install failed: %s", err->message);
        g_error_free (err);
    }
    gtk_widget_set_sensitive (GTK_WIDGET (data), FALSE);
}
Ejemplo n.º 28
0
static void
mount_mountable_done_cb (GObject *object,
                         GAsyncResult *res,
                         gpointer user_data)
{
  GFile *target;
  GError *error = NULL;

  target = g_file_mount_mountable_finish (G_FILE (object), res, &error);

  if (target == NULL)
    g_printerr (_("Error mounting location: %s\n"), error->message);
  else
    g_object_unref (target);

  outstanding_mounts--;

  if (outstanding_mounts == 0)
    g_main_loop_quit (main_loop);
}
Ejemplo n.º 29
0
void
dlg_open_with (FrWindow *window,
               GList    *file_list)
{
    OpenData  *o_data;
    GtkWidget *app_chooser;

    o_data = g_new0 (OpenData, 1);
    o_data->window = window;
    o_data->file_list = file_list;

    app_chooser = gtk_app_chooser_dialog_new (GTK_WINDOW (window),
                  GTK_DIALOG_MODAL,
                  G_FILE (file_list->data));
    g_signal_connect (app_chooser,
                      "response",
                      G_CALLBACK (app_chooser_response_cb),
                      o_data);
    gtk_widget_show (app_chooser);
}
Ejemplo n.º 30
0
static void
file_open_callback (GObject      *object,
                    GAsyncResult *res,
                    gpointer      data)
{
    CajaImagePropertiesPage *page;
    GFile *file;
    GFileInputStream *stream;
    GError *error;

    page = CAJA_IMAGE_PROPERTIES_PAGE (data);
    file = G_FILE (object);

    error = NULL;
    stream = g_file_read_finish (file, res, &error);
    if (stream)
    {
        page->details->loader = gdk_pixbuf_loader_new ();
        page->details->pixbuf_still_loading = TRUE;
        page->details->width = 0;
        page->details->height = 0;
#ifdef HAVE_EXIF
        page->details->exifldr = exif_loader_new ();
#endif /*HAVE_EXIF*/

        g_signal_connect (page->details->loader,
                          "size_prepared",
                          G_CALLBACK (size_prepared_callback),
                          page);

        g_input_stream_read_async (G_INPUT_STREAM (stream),
                                   page->details->buffer,
                                   sizeof (page->details->buffer),
                                   0,
                                   page->details->cancellable,
                                   file_read_callback,
                                   page);

        g_object_unref (stream);
    }
}