summaryrefslogtreecommitdiffstats
path: root/meta/recipes-gnome/gnome/gnome-settings-daemon/mojito-cleanup.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-gnome/gnome/gnome-settings-daemon/mojito-cleanup.patch')
-rw-r--r--meta/recipes-gnome/gnome/gnome-settings-daemon/mojito-cleanup.patch74
1 files changed, 74 insertions, 0 deletions
diff --git a/meta/recipes-gnome/gnome/gnome-settings-daemon/mojito-cleanup.patch b/meta/recipes-gnome/gnome/gnome-settings-daemon/mojito-cleanup.patch
new file mode 100644
index 0000000000..1aff2d6d6f
--- /dev/null
+++ b/meta/recipes-gnome/gnome/gnome-settings-daemon/mojito-cleanup.patch
@@ -0,0 +1,74 @@
1diff --git a/plugins/housekeeping/gsd-housekeeping-manager.c b/plugins/housekeeping/gsd-housekeeping-manager.c
2index f84cfad..e8f474a 100644
3--- a/plugins/housekeeping/gsd-housekeeping-manager.c
4+++ b/plugins/housekeeping/gsd-housekeeping-manager.c
5@@ -85,9 +85,13 @@ thumb_data_free (gpointer data)
6 }
7 }
8
9+typedef enum {
10+ HASH,
11+ HASH_PNG
12+} FileType;
13
14 static GList *
15-read_dir_for_purge (const char *path, GList *files)
16+read_dir_for_purge (const char *path, GList *files, FileType type)
17 {
18 GFile *read_path;
19 GFileEnumerator *enum_dir;
20@@ -105,9 +109,20 @@ read_dir_for_purge (const char *path, GList *files)
21 GFileInfo *info;
22 while ((info = g_file_enumerator_next_file (enum_dir, NULL, NULL)) != NULL) {
23 const char *name;
24+ gboolean prune = FALSE;
25+
26 name = g_file_info_get_name (info);
27
28- if (strlen (name) == 36 && strcmp (name + 32, ".png") == 0) {
29+ switch (type) {
30+ case HASH:
31+ prune = (strlen (name) == 36);
32+ break;
33+ case HASH_PNG:
34+ prune = (strlen (name) == 36 && strcmp (name + 32, ".png") == 0);
35+ break;
36+ }
37+
38+ if (prune) {
39 ThumbData *td;
40 GFile *entry;
41 char *entry_path;
42@@ -197,14 +212,14 @@ purge_thumbnail_cache (void)
43 ".thumbnails",
44 "normal",
45 NULL);
46- files = read_dir_for_purge (path, NULL);
47+ files = read_dir_for_purge (path, NULL, HASH_PNG);
48 g_free (path);
49
50 path = g_build_filename (g_get_home_dir (),
51 ".thumbnails",
52 "large",
53 NULL);
54- files = read_dir_for_purge (path, files);
55+ files = read_dir_for_purge (path, files, HASH_PNG);
56 g_free (path);
57
58 path = g_build_filename (g_get_home_dir (),
59@@ -212,7 +227,14 @@ purge_thumbnail_cache (void)
60 "fail",
61 "gnome-thumbnail-factory",
62 NULL);
63- files = read_dir_for_purge (path, files);
64+ files = read_dir_for_purge (path, files, HASH_PNG);
65+ g_free (path);
66+
67+ path = g_build_filename (g_get_user_cache_dir (),
68+ "mojito",
69+ "thumbnails",
70+ NULL);
71+ files = read_dir_for_purge (path, files, HASH);
72 g_free (path);
73
74 g_get_current_time (&current_time);