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
=== modified file 'src/datetime-prefs-locations.c'
--- src/datetime-prefs-locations.c 2011-03-24 20:26:49 +0000
+++ src/datetime-prefs-locations.c 2011-03-24 20:26:49 +0000
@@ -229,6 +229,7 @@
229static void229static void
230save_to_settings (GObject * store, GSettings * conf)230save_to_settings (GObject * store, GSettings * conf)
231{231{
232 gboolean empty = TRUE;
232 GVariantBuilder builder;233 GVariantBuilder builder;
233 g_variant_builder_init (&builder, G_VARIANT_TYPE_ARRAY);234 g_variant_builder_init (&builder, G_VARIANT_TYPE_ARRAY);
234235
@@ -246,13 +247,21 @@
246 gchar * settings_string = g_strdup_printf("%s %s", strzone, strname);247 gchar * settings_string = g_strdup_printf("%s %s", strzone, strname);
247 g_variant_builder_add (&builder, "s", settings_string);248 g_variant_builder_add (&builder, "s", settings_string);
248 g_free (settings_string);249 g_free (settings_string);
250 empty = FALSE;
249 }251 }
250 } while (gtk_tree_model_iter_next (GTK_TREE_MODEL (store), &iter));252 } while (gtk_tree_model_iter_next (GTK_TREE_MODEL (store), &iter));
251 }253 }
252254
253 GVariant * locations = g_variant_builder_end (&builder);255 if (empty) {
254 g_settings_set_strv (conf, SETTINGS_LOCATIONS_S, g_variant_get_strv (locations, NULL));256 /* Empty list */
255 g_variant_unref (locations);257 g_variant_builder_clear (&builder);
258 g_settings_set_strv (conf, SETTINGS_LOCATIONS_S, NULL);
259 }
260 else {
261 GVariant * locations = g_variant_builder_end (&builder);
262 g_settings_set_strv (conf, SETTINGS_LOCATIONS_S, g_variant_get_strv (locations, NULL));
263 g_variant_unref (locations);
264 }
256}265}
257266
258static gboolean267static gboolean
259268
=== modified file 'src/datetime-service.c'
--- src/datetime-service.c 2011-03-23 12:03:21 +0000
+++ src/datetime-service.c 2011-03-24 20:26:49 +0000
@@ -437,11 +437,11 @@
437 437
438 gboolean show = g_settings_get_boolean (conf, SETTINGS_SHOW_LOCATIONS_S);438 gboolean show = g_settings_get_boolean (conf, SETTINGS_SHOW_LOCATIONS_S);
439439
440 if (len > 0) {440 dbusmenu_menuitem_property_set_bool (locations_separator, DBUSMENU_MENUITEM_PROP_VISIBLE, show);
441 dbusmenu_menuitem_property_set_bool (locations_separator, DBUSMENU_MENUITEM_PROP_VISIBLE, show);441 dbusmenu_menuitem_property_set_bool (current_location, DBUSMENU_MENUITEM_PROP_VISIBLE, show);
442 dbusmenu_menuitem_property_set_bool (current_location, DBUSMENU_MENUITEM_PROP_VISIBLE, show);442 dbusmenu_menuitem_property_set_bool (current_location, DBUSMENU_MENUITEM_PROP_ENABLED, TRUE);
443 dbusmenu_menuitem_property_set_bool (current_location, DBUSMENU_MENUITEM_PROP_ENABLED, TRUE);443
444 } else {444 if (len == 0) {
445 g_debug("No locations configured (Empty List)");445 g_debug("No locations configured (Empty List)");
446 return FALSE;446 return FALSE;
447 }447 }
448448
=== modified file 'src/utils.c'
--- src/utils.c 2011-03-23 15:00:52 +0000
+++ src/utils.c 2011-03-24 20:26:49 +0000
@@ -233,6 +233,8 @@
233 g_date_time_unref(future_bound);233 g_date_time_unref(future_bound);
234 }234 }
235235
236 g_date_time_unref (now);
237
236 return generate_format_string_full(show_day, show_date);238 return generate_format_string_full(show_day, show_date);
237}239}
238240

Subscribers

People subscribed via source and target branches