Merge lp:~mterry/indicator-datetime/crash-fix-and-more into lp:indicator-datetime/0.3

Proposed by Michael Terry
Status: Merged
Merged at revision: 87
Proposed branch: lp:~mterry/indicator-datetime/crash-fix-and-more
Merge into: lp:indicator-datetime/0.3
Prerequisite: lp:~mterry/indicator-datetime/live-location-updates
Diff against target: 69 lines (+19/-8)
3 files modified
src/datetime-prefs-locations.c (+12/-3)
src/datetime-service.c (+5/-5)
src/utils.c (+2/-0)
To merge this branch: bzr merge lp:~mterry/indicator-datetime/crash-fix-and-more
Reviewer Review Type Date Requested Status
Indicator Applet Developers Pending
Review via email: mp+54775@code.launchpad.net

Description of the change

See bugs for reasons, in particular, bug 735445 is a beaut.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/datetime-prefs-locations.c'
2--- src/datetime-prefs-locations.c 2011-03-24 20:26:49 +0000
3+++ src/datetime-prefs-locations.c 2011-03-24 20:26:49 +0000
4@@ -229,6 +229,7 @@
5 static void
6 save_to_settings (GObject * store, GSettings * conf)
7 {
8+ gboolean empty = TRUE;
9 GVariantBuilder builder;
10 g_variant_builder_init (&builder, G_VARIANT_TYPE_ARRAY);
11
12@@ -246,13 +247,21 @@
13 gchar * settings_string = g_strdup_printf("%s %s", strzone, strname);
14 g_variant_builder_add (&builder, "s", settings_string);
15 g_free (settings_string);
16+ empty = FALSE;
17 }
18 } while (gtk_tree_model_iter_next (GTK_TREE_MODEL (store), &iter));
19 }
20
21- GVariant * locations = g_variant_builder_end (&builder);
22- g_settings_set_strv (conf, SETTINGS_LOCATIONS_S, g_variant_get_strv (locations, NULL));
23- g_variant_unref (locations);
24+ if (empty) {
25+ /* Empty list */
26+ g_variant_builder_clear (&builder);
27+ g_settings_set_strv (conf, SETTINGS_LOCATIONS_S, NULL);
28+ }
29+ else {
30+ GVariant * locations = g_variant_builder_end (&builder);
31+ g_settings_set_strv (conf, SETTINGS_LOCATIONS_S, g_variant_get_strv (locations, NULL));
32+ g_variant_unref (locations);
33+ }
34 }
35
36 static gboolean
37
38=== modified file 'src/datetime-service.c'
39--- src/datetime-service.c 2011-03-23 12:03:21 +0000
40+++ src/datetime-service.c 2011-03-24 20:26:49 +0000
41@@ -437,11 +437,11 @@
42
43 gboolean show = g_settings_get_boolean (conf, SETTINGS_SHOW_LOCATIONS_S);
44
45- if (len > 0) {
46- dbusmenu_menuitem_property_set_bool (locations_separator, DBUSMENU_MENUITEM_PROP_VISIBLE, show);
47- dbusmenu_menuitem_property_set_bool (current_location, DBUSMENU_MENUITEM_PROP_VISIBLE, show);
48- dbusmenu_menuitem_property_set_bool (current_location, DBUSMENU_MENUITEM_PROP_ENABLED, TRUE);
49- } else {
50+ dbusmenu_menuitem_property_set_bool (locations_separator, DBUSMENU_MENUITEM_PROP_VISIBLE, show);
51+ dbusmenu_menuitem_property_set_bool (current_location, DBUSMENU_MENUITEM_PROP_VISIBLE, show);
52+ dbusmenu_menuitem_property_set_bool (current_location, DBUSMENU_MENUITEM_PROP_ENABLED, TRUE);
53+
54+ if (len == 0) {
55 g_debug("No locations configured (Empty List)");
56 return FALSE;
57 }
58
59=== modified file 'src/utils.c'
60--- src/utils.c 2011-03-23 15:00:52 +0000
61+++ src/utils.c 2011-03-24 20:26:49 +0000
62@@ -233,6 +233,8 @@
63 g_date_time_unref(future_bound);
64 }
65
66+ g_date_time_unref (now);
67+
68 return generate_format_string_full(show_day, show_date);
69 }
70

Subscribers

People subscribed via source and target branches