Update copyright info to have correct years (2003-2004)

2004-06-28  Rodney Dawes  <dobey@novell.com>

	* *.[ch]: Update copyright info to have correct years (2003-2004)

	* gnome-wp-capplet.c (gnome_wp_capplet_scroll_to_item):
	Abstract this code out so that we don't have to duplicated it every
	time we want to scroll to a particular item in the list

	(gnome_wp_add_image): Update this to return the new item that we
	created, and don't scroll to or set as the wallpaper, every time we
	call this function
	Use the new gnome_wp_item_new () call to create items

	(gnome_wp_add_images): Change the API to not use the files argument
	any longer, as we don't need it without the GTK+ 2.2 compat code
	Add all the items to the list and select the last one when finished

	(gnome_wp_file_open_dialog): Update to not pass in the files argument
	to gnome_wp_add_images () and free the GSList of filenames

	(bg_add_multiple_files): merge this code into the normal callback for
	when images are dragged to the dialog

	(bg_properties_dragged_image): Don't check if the list is more than
	1 or not here, and always call gnome_wp_add_images () with the full
	list that we are given
	Convert the GList of GnomeVFSURIs that we get from gnome-vfs to a
	GSList of char * uris to pass into gnome_wp_add_images ()

	(gnome_wp_load_stuffs, gnome_wp_file_changed):
	Use the new gnome_wp_capplet_scroll_to_item () and gnome_wp_item_new ()
	API calls instead of duplicating code

	* gnome-wp-capplet.h: Remove the GConf key path defines from here

	* gnome-wp-item.[ch]: Add the gnome_wp_item_new () call to create the
	GnomeWPItem structure for storing wallpapers in

	* gnome-wp-utils.h: Put the GConf key path defines in here

	* gnome-wp-xml.c (gnome_wp_load_legacy): Use the gnome_wp_item_new ()
	call to create items from the old legacy (XD2 capplet) list file
This commit is contained in:
Rodney Dawes 2004-06-28 18:51:21 +00:00 committed by Rodney Dawes
parent fb35d020a6
commit 4d87d80f3e
11 changed files with 171 additions and 353 deletions

View file

@ -1,7 +1,7 @@
/*
* Authors: Rodney Dawes <dobey@ximian.com>
*
* Copyright 2003 Novell, Inc. (www.novell.com)
* Copyright 2003-2004 Novell, Inc. (www.novell.com)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of version 2 of the GNU General Public License
@ -56,7 +56,6 @@ static void gnome_wp_xml_set_bool (const xmlNode * parent,
static void gnome_wp_load_legacy (GnomeWPCapplet * capplet) {
FILE * fp;
gchar * foo, * filename;
GdkColor color1, color2;
filename = g_build_filename (g_get_home_dir (), ".gnome2",
"wallpapers.list", NULL);
@ -80,42 +79,8 @@ static void gnome_wp_load_legacy (GnomeWPCapplet * capplet) {
continue;
}
item = g_new0 (GnomeWPItem, 1);
item->filename = g_strdup (foo);
item->fileinfo = gnome_wp_info_new (item->filename, capplet->thumbs);
if (item->fileinfo == NULL) {
gnome_wp_item_free (item);
continue;
}
item->shade_type = gconf_client_get_string (capplet->client,
WP_SHADING_KEY, NULL);
item->pri_color = gconf_client_get_string (capplet->client,
WP_PCOLOR_KEY, NULL);
item->sec_color = gconf_client_get_string (capplet->client,
WP_SCOLOR_KEY, NULL);
gdk_color_parse (item->pri_color, &color1);
gdk_color_parse (item->sec_color, &color2);
item->pcolor = gdk_color_copy (&color1);
item->scolor = gdk_color_copy (&color2);
if (!strncmp (item->fileinfo->mime_type, "image/",
strlen ("image/"))) {
if (item->name == NULL) {
item->name = g_strdup (item->fileinfo->name);
}
item->options = gconf_client_get_string (capplet->client,
WP_OPTIONS_KEY,
NULL);
gnome_wp_item_update_description (item);
g_hash_table_insert (capplet->wphash, g_strdup (item->filename), item);
} else {
item = gnome_wp_item_new (foo, capplet->wphash, capplet->thumbs);
if (item != NULL && item->fileinfo == NULL) {
gnome_wp_item_free (item);
}
}