static void
setup_side_pane_width (NautilusNavigationWindow *window)
{
	static gboolean setup_auto_value= TRUE;

	g_return_if_fail (window->sidebar != NULL);
	
	if (setup_auto_value) {
		setup_auto_value = FALSE;
		eel_preferences_add_auto_integer 
			(NAUTILUS_PREFERENCES_SIDEBAR_WIDTH,
			 &side_pane_width_auto_value);
	}

	window->details->side_pane_width = side_pane_width_auto_value;

	gtk_paned_set_position (GTK_PANED (window->details->content_paned), 
				side_pane_width_auto_value);
}
static GdkPixbuf *
get_pixbuf_from_data (const unsigned char *buffer,
		      gsize buflen,
		      const char *path,
		      guint base_size,
		      guint nominal_size,
		      gboolean force_nominal,
		      double *scale_x_out,
		      double *scale_y_out)
{
	GdkPixbufLoader *loader;
	GdkPixbuf *pixbuf;
	ThumbnailLoadArgs args;
	GError *error;

	if (thumbnail_icon_size == 0) {
		eel_preferences_add_auto_integer (NAUTILUS_PREFERENCES_ICON_VIEW_THUMBNAIL_SIZE,
						  &thumbnail_icon_size);
	}

	loader = gdk_pixbuf_loader_new ();
	g_signal_connect (loader, "size-prepared",
			  G_CALLBACK (thumbnail_loader_size_prepared),
			  &args);
	g_signal_connect (loader, "area-prepared",
			  G_CALLBACK (thumbnail_loader_area_prepared),
			  &args);

	args.is_thumbnail = strstr (path, "/.thumbnails/") != NULL;
	args.base_size = base_size;
	args.nominal_size = nominal_size;
	args.force_nominal = force_nominal;
	args.scale_x_out = scale_x_out;
	args.scale_y_out = scale_y_out;

	error = NULL;

	if (!gdk_pixbuf_loader_write (loader, buffer, buflen, &error)) {
		g_message ("Failed to write %s to thumbnail pixbuf loader: %s", path, error->message);

		gdk_pixbuf_loader_close (loader, NULL);
		g_object_unref (G_OBJECT (loader));
		g_error_free (error);

		return NULL;
	}

	error = NULL;

	if (!gdk_pixbuf_loader_close (loader, &error) ||
	    /* Seems we have to check this even if it returned TRUE (#403255) */
	    error != NULL) {
		g_message ("Failed to close thumbnail pixbuf loader for %s: %s", path, error->message);

		g_object_unref (G_OBJECT (loader));
		g_error_free (error);

		return NULL;
	}

	pixbuf = g_object_ref (gdk_pixbuf_loader_get_pixbuf (loader));

	g_object_unref (G_OBJECT (loader));

	return pixbuf;
}