return to using paths instead of URIs since most of the code using them

2008-05-24  Jens Granseuer  <jensgr@gmx.net>

	* gnome-theme-info.c: (gnome_theme_read_meta_theme),
	(read_icon_theme), (read_cursor_theme), (read_cursor_fonts),
	(update_theme_index): return to using paths instead of URIs since
	most of the code using them expects paths

2008-05-24  Jens Granseuer  <jensgr@gmx.net>

	* theme-util.c: (theme_is_writable), (theme_delete): expect
	a path instead of an URI in theme_info->path

svn path=/trunk/; revision=8724
This commit is contained in:
Jens Granseuer 2008-05-24 17:19:26 +00:00 committed by Jens Granseuer
parent 2a6e126db2
commit 90d606a496
4 changed files with 26 additions and 17 deletions

View file

@ -1,3 +1,8 @@
2008-05-24 Jens Granseuer <jensgr@gmx.net>
* theme-util.c: (theme_is_writable), (theme_delete): expect
a path instead of an URI in theme_info->path
2008-05-24 Jens Granseuer <jensgr@gmx.net>
* theme-util.c: (directory_delete_recursive): also delete the

View file

@ -100,7 +100,7 @@ theme_is_writable (const gpointer theme)
if (info == NULL || info->path == NULL)
return FALSE;
file = g_file_new_for_uri (info->path);
file = g_file_new_for_path (info->path);
file_info = g_file_query_info (file,
G_FILE_ATTRIBUTE_ACCESS_CAN_WRITE,
G_FILE_QUERY_INFO_NONE,
@ -168,7 +168,7 @@ theme_delete (const gchar *name, ThemeType type)
return FALSE;
}
dir = g_file_new_for_uri (theme_dir);
dir = g_file_new_for_path (theme_dir);
g_free (theme_dir);
if (!file_delete_recursive (dir, NULL)) {

View file

@ -1,3 +1,10 @@
2008-05-24 Jens Granseuer <jensgr@gmx.net>
* gnome-theme-info.c: (gnome_theme_read_meta_theme),
(read_icon_theme), (read_cursor_theme), (read_cursor_fonts),
(update_theme_index): return to using paths instead of URIs since
most of the code using them expects paths
2008-05-18 Thomas Wood <thos@gnome.org>
* gconf-property-editor.c: (gconf_property_editor_class_init),

View file

@ -269,14 +269,14 @@ gnome_theme_read_meta_theme (GFile *meta_theme_uri)
meta_theme_file = g_file_get_uri (meta_theme_uri);
meta_theme_ditem = gnome_desktop_item_new_from_uri (meta_theme_file, 0, NULL);
if (meta_theme_ditem == NULL) {
g_free (meta_theme_file);
g_free (meta_theme_file);
if (meta_theme_ditem == NULL)
return NULL;
}
common_theme_dir_uri = g_file_get_parent (meta_theme_uri);
meta_theme_info = gnome_theme_meta_info_new ();
meta_theme_info->path = meta_theme_file;
meta_theme_info->path = g_file_get_path (meta_theme_uri);
meta_theme_info->name = g_file_get_basename (common_theme_dir_uri);
g_object_unref (common_theme_dir_uri);
@ -390,15 +390,14 @@ read_icon_theme (GFile *icon_theme_uri)
icon_theme_file = g_file_get_uri (icon_theme_uri);
icon_theme_ditem = gnome_desktop_item_new_from_uri (icon_theme_file, 0, NULL);
if (icon_theme_ditem == NULL) {
g_free (icon_theme_file);
g_free (icon_theme_file);
if (icon_theme_ditem == NULL)
return NULL;
}
name = gnome_desktop_item_get_string (icon_theme_ditem, "Icon Theme/Name");
if (name == NULL) {
gnome_desktop_item_unref (icon_theme_ditem);
g_free (icon_theme_file);
return NULL;
}
@ -406,7 +405,6 @@ read_icon_theme (GFile *icon_theme_uri)
directories = gnome_desktop_item_get_string (icon_theme_ditem, "Icon Theme/Directories");
if (directories == NULL) {
gnome_desktop_item_unref (icon_theme_ditem);
g_free (icon_theme_file);
return NULL;
}
@ -416,13 +414,12 @@ read_icon_theme (GFile *icon_theme_uri)
gchar *dir_name;
icon_theme_info = gnome_theme_icon_info_new ();
icon_theme_info->readable_name = g_strdup (name);
icon_theme_info->path = icon_theme_file;
dir_name = g_path_get_dirname (icon_theme_file);
icon_theme_info->path = g_file_get_path (icon_theme_uri);
dir_name = g_path_get_dirname (icon_theme_info->path);
icon_theme_info->name = g_path_get_basename (dir_name);
g_free (dir_name);
} else {
icon_theme_info = NULL;
g_free (icon_theme_file);
}
gnome_desktop_item_unref (icon_theme_ditem);
@ -538,7 +535,7 @@ read_cursor_theme (GFile *cursor_theme_uri)
}
cursor_theme_info = gnome_theme_cursor_info_new ();
cursor_theme_info->path = g_file_get_uri (parent_uri);
cursor_theme_info->path = g_file_get_path (parent_uri);
cursor_theme_info->name = name;
cursor_theme_info->sizes = sizes;
cursor_theme_info->thumbnail = thumbnail;
@ -664,7 +661,7 @@ read_cursor_fonts (void)
theme_info->thumbnail = gdk_pixbuf_new_from_file (filename, NULL);
g_free (filename);
theme_info->path = g_build_filename ("file://" GNOMECC_DATA_DIR, builtins[i][0], NULL);
theme_info->path = g_build_filename (GNOMECC_DATA_DIR, builtins[i][0], NULL);
theme_info->name = g_strdup (theme_info->path);
if (!strcmp (theme_info->path, cursor_font))
@ -759,7 +756,7 @@ update_theme_index (GFile *index_uri,
/* Next, we see what currently exists */
parent = g_file_get_parent (index_uri);
common_theme_dir_uri = g_file_get_parent (parent);
common_theme_dir = g_file_get_uri (common_theme_dir_uri);
common_theme_dir = g_file_get_path (common_theme_dir_uri);
theme_info = g_hash_table_lookup (theme_hash_by_uri, common_theme_dir);
if (theme_info == NULL) {