summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFederico Mena Quintero <federico@novell.com>2008-07-18 19:28:13 +0000
committerFederico Mena Quintero <federico@src.gnome.org>2008-07-18 19:28:13 +0000
commit5bd03f2b44b19a58ee6d33dcdb7ba1423ee313df (patch)
tree25188e20475c1408b70bdfbf2346cf06c341bd41
parent46047f173ee246d308a9e1897b6f8a1e062867c3 (diff)
downloadgdk-pixbuf-5bd03f2b44b19a58ee6d33dcdb7ba1423ee313df.tar.gz
Remove the old icon cache if regenerating it would cause it to be empty
Signed-off-by: Federico Mena Quintero <federico@novell.com> svn path=/trunk/; revision=20865
-rw-r--r--ChangeLog5
-rw-r--r--gtk/updateiconcache.c4
2 files changed, 7 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 77880c82d..641533ab5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -15,6 +15,11 @@
2008-07-18 Federico Mena Quintero <federico@novell.com>
+ * gtk/updateiconcache.c (build_cache): If the resulting cache file
+ would be empty, erase the old cache file as well as the temporary file.
+
+2008-07-18 Federico Mena Quintero <federico@novell.com>
+
* demos/gtk-demo/changedisplay.c (find_toplevel_at_pointer): Don't
do funny casts to avoid compiler warnings.
diff --git a/gtk/updateiconcache.c b/gtk/updateiconcache.c
index b239cc302..0f5577a25 100644
--- a/gtk/updateiconcache.c
+++ b/gtk/updateiconcache.c
@@ -1448,6 +1448,7 @@ build_cache (const gchar *path)
#endif
tmp_cache_path = g_build_filename (path, "."CACHE_NAME, NULL);
+ cache_path = g_build_filename (path, CACHE_NAME, NULL);
if ((fd = g_open (tmp_cache_path, O_WRONLY | O_CREAT | O_EXCL | O_TRUNC | _O_BINARY, mode)) == -1)
{
@@ -1476,6 +1477,7 @@ build_cache (const gchar *path)
fclose (cache);
g_unlink (tmp_cache_path);
+ g_unlink (cache_path);
exit (0);
}
@@ -1499,8 +1501,6 @@ build_cache (const gchar *path)
exit (1);
}
- cache_path = g_build_filename (path, CACHE_NAME, NULL);
-
#ifdef G_OS_WIN32
if (g_file_test (cache_path, G_FILE_TEST_EXISTS))
{