/[gentoo-x86]/gnome-base/gnome-control-center/files/gnome-control-center-2.32.1-duplicated-background.patch
Gentoo

Contents of /gnome-base/gnome-control-center/files/gnome-control-center-2.32.1-duplicated-background.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Thu Nov 13 11:19:58 2014 UTC (5 weeks, 3 days ago) by pacho
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +0 -0 lines
FILE REMOVED
Drop package due bug #508854

1 Index: gnome-control-center-2.32.1/capplets/appearance/appearance-desktop.c
2 ===================================================================
3 --- gnome-control-center-2.32.1.orig/capplets/appearance/appearance-desktop.c
4 +++ gnome-control-center-2.32.1/capplets/appearance/appearance-desktop.c
5 @@ -48,6 +48,50 @@ static const GtkTargetEntry drag_types[]
6
7 static void wp_update_preview (GtkFileChooser *chooser, AppearanceData *data);
8
9 +static GnomeWPItem *
10 +lookup_with_symlink (AppearanceData *data,
11 + const char *path,
12 + char **real_path)
13 +{
14 + GnomeWPItem *item;
15 + gchar *readlink;
16 +
17 + if (real_path)
18 + *real_path = NULL;
19 +
20 + if (!path)
21 + return NULL;
22 +
23 + item = g_hash_table_lookup (data->wp_hash, path);
24 + if (item)
25 + return item;
26 +
27 + /* if the current background is not in the hash of known backgrounds,
28 + * see if it's a symlink and if the file it points to is in the hash */
29 +
30 + readlink = g_strdup (path);
31 +
32 + while (readlink &&
33 + g_file_test (readlink, G_FILE_TEST_IS_SYMLINK) &&
34 + item == NULL) {
35 + gchar *new;
36 +
37 + new = g_file_read_link (readlink, NULL);
38 + g_free (readlink);
39 + readlink = new;
40 +
41 + if (readlink)
42 + item = g_hash_table_lookup (data->wp_hash, readlink);
43 + }
44 +
45 + if (item != NULL && real_path)
46 + *real_path = readlink;
47 + else
48 + g_free (readlink);
49 +
50 + return item;
51 +}
52 +
53 static void
54 select_item (AppearanceData *data,
55 GnomeWPItem * item,
56 @@ -418,11 +462,16 @@ wp_uri_changed (const gchar *uri,
57 AppearanceData *data)
58 {
59 GnomeWPItem *item, *selected;
60 + gchar *realuri;
61 +
62 + realuri = NULL;
63 + item = lookup_with_symlink (data, uri, &realuri);
64 + if (!realuri)
65 + realuri = g_strdup (uri);
66
67 - item = g_hash_table_lookup (data->wp_hash, uri);
68 selected = get_selected_item (data, NULL);
69
70 - if (selected != NULL && strcmp (selected->filename, uri) != 0)
71 + if (selected != NULL && strcmp (selected->filename, realuri) != 0)
72 {
73 if (item == NULL)
74 item = wp_add_image (data, uri);
75 @@ -430,6 +479,8 @@ wp_uri_changed (const gchar *uri,
76 if (item)
77 select_item (data, item, TRUE);
78 }
79 +
80 + g_free (realuri);
81 }
82
83 static void
84 @@ -936,6 +987,7 @@ wp_load_stuffs (void *user_data)
85 AppearanceData *data;
86 gchar *imagepath, *uri, *style;
87 GnomeWPItem *item;
88 + gchar *realpath;
89
90 data = (AppearanceData *) user_data;
91
92 @@ -971,7 +1023,12 @@ wp_load_stuffs (void *user_data)
93
94 g_free (uri);
95
96 - item = g_hash_table_lookup (data->wp_hash, imagepath);
97 + realpath = NULL;
98 + item = lookup_with_symlink (data, imagepath, &realpath);
99 + if (realpath) {
100 + g_free (imagepath);
101 + imagepath = realpath;
102 + }
103
104 if (item != NULL)
105 {
106 @@ -986,7 +1043,9 @@ wp_load_stuffs (void *user_data)
107 wp_props_load_wallpaper (item->filename, item, data);
108 }
109
110 + data->wp_update_gconf = FALSE;
111 select_item (data, item, FALSE);
112 + data->wp_update_gconf = TRUE;
113 }
114 }
115 else if (strcmp (style, "none") != 0)

  ViewVC Help
Powered by ViewVC 1.1.20