3438
|
1 |
--- redshift-1.6.orig/src/location-gnome-clock.c 2011-04-30 01:48:08.173781561 -0400
|
|
2 |
+++ redshift-1.6/src/location-gnome-clock.c 2011-04-30 01:55:19.919457825 -0400
|
|
3 |
@@ -37,16 +37,14 @@
|
|
4 |
static char *
|
|
5 |
find_current_city(GConfClient *client, const char *id)
|
|
6 |
{
|
|
7 |
- GError *error = NULL;
|
|
8 |
-
|
|
9 |
char *current_city = NULL;
|
|
10 |
char *cities_key = g_strdup_printf("/apps/panel/applets/%s"
|
|
11 |
"/prefs/cities", id);
|
|
12 |
GSList *cities = gconf_client_get_list(client,
|
|
13 |
cities_key,
|
|
14 |
- GCONF_VALUE_STRING, &error);
|
|
15 |
+ GCONF_VALUE_STRING, NULL);
|
|
16 |
|
|
17 |
- if (error) {
|
|
18 |
+ if (cities == NULL) {
|
|
19 |
fprintf(stderr, _("Error reading city list: `%s'.\n"),
|
|
20 |
cities_key);
|
|
21 |
g_free(cities_key);
|
|
22 |
@@ -72,17 +70,23 @@
|
|
23 |
{
|
|
24 |
g_type_init();
|
|
25 |
|
|
26 |
- GError *error = NULL;
|
|
27 |
GConfClient *client = gconf_client_get_default();
|
|
28 |
|
|
29 |
/* Get a list of active applets in the panel. */
|
|
30 |
GSList *applets = gconf_client_get_list(client,
|
|
31 |
"/apps/panel/general/applet_id_list",
|
|
32 |
- GCONF_VALUE_STRING, &error);
|
|
33 |
- if (error) {
|
|
34 |
+ GCONF_VALUE_STRING, NULL);
|
|
35 |
+ if (applets == NULL) {
|
|
36 |
+ /* JDS has an alternate list of applets. */
|
|
37 |
+ applets = gconf_client_get_list(client,
|
|
38 |
+ "/apps/panel/general/applet_id_list_jds",
|
|
39 |
+ GCONF_VALUE_STRING, NULL);
|
|
40 |
+ }
|
|
41 |
+
|
|
42 |
+ if (applets == NULL) {
|
|
43 |
fputs(_("Cannot list GNOME panel applets.\n"), stderr);
|
|
44 |
- g_object_unref(client);
|
|
45 |
g_slist_free(applets);
|
|
46 |
+ g_object_unref(client);
|
|
47 |
return -1;
|
|
48 |
}
|
|
49 |
|
|
50 |
@@ -102,11 +106,11 @@
|
|
51 |
char *key = g_strdup_printf("/apps/panel/applets/%s"
|
|
52 |
"/bonobo_iid", id);
|
|
53 |
char *bonobo_iid = gconf_client_get_string(client, key,
|
|
54 |
- &error);
|
|
55 |
+ NULL);
|
|
56 |
|
|
57 |
- /* Try both gnome-panel 2.30.x and earlier bonobo_iid key and
|
|
58 |
- newer applet_iid. */
|
|
59 |
- if (!error && bonobo_iid != NULL &&
|
|
60 |
+ /* Try both gnome-panel 2.30.x and earlier bonobo_iid
|
|
61 |
+ key and newer applet_iid. */
|
|
62 |
+ if (bonobo_iid != NULL &&
|
|
63 |
!strcmp(bonobo_iid, "OAFIID:GNOME_ClockApplet")) {
|
|
64 |
clock_applet_count += 1;
|
|
65 |
current_city = find_current_city(client, id);
|
|
66 |
@@ -115,13 +119,15 @@
|
|
67 |
g_free(key);
|
|
68 |
key = g_strdup_printf("/apps/panel/applets/%s"
|
|
69 |
"/applet_iid", id);
|
|
70 |
- char *applet_iid = gconf_client_get_string(client, key,
|
|
71 |
- &error);
|
|
72 |
+ char *applet_iid = gconf_client_get_string(
|
|
73 |
+ client, key, NULL);
|
|
74 |
|
|
75 |
- if (!error && applet_iid != NULL &&
|
|
76 |
- !strcmp(applet_iid, "ClockAppletFactory::ClockApplet")) {
|
|
77 |
+ if (applet_iid != NULL &&
|
|
78 |
+ !strcmp(applet_iid, "ClockAppletFactory::"
|
|
79 |
+ "ClockApplet")) {
|
|
80 |
clock_applet_count += 1;
|
|
81 |
- current_city = find_current_city(client, id);
|
|
82 |
+ current_city = find_current_city(client,
|
|
83 |
+ id);
|
|
84 |
}
|
|
85 |
|
|
86 |
g_free(applet_iid);
|