aboutsummaryrefslogtreecommitdiffstats
path: root/modules/calendar
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2013-03-25 01:37:16 +0800
committerMatthew Barnes <mbarnes@redhat.com>2013-03-25 01:37:16 +0800
commit78dfe47fdfe0c11540b508799517f3d9f21c3b0a (patch)
tree7b4b975283444669d56e02b4feaa6337ea94856e /modules/calendar
parent393586c8f744b8b2d68684331ba1029a7950f211 (diff)
downloadgsoc2013-evolution-78dfe47fdfe0c11540b508799517f3d9f21c3b0a.tar.gz
gsoc2013-evolution-78dfe47fdfe0c11540b508799517f3d9f21c3b0a.tar.zst
gsoc2013-evolution-78dfe47fdfe0c11540b508799517f3d9f21c3b0a.zip
Bug 696257 - Handle default values for "primary" selection settings
The default value for these GSettings keys is an empty string. The mapping function should handle empty strings by falling back to the appropriate default ESource.
Diffstat (limited to 'modules/calendar')
-rw-r--r--modules/calendar/e-cal-shell-sidebar.c5
-rw-r--r--modules/calendar/e-memo-shell-sidebar.c5
-rw-r--r--modules/calendar/e-task-shell-sidebar.c5
3 files changed, 12 insertions, 3 deletions
diff --git a/modules/calendar/e-cal-shell-sidebar.c b/modules/calendar/e-cal-shell-sidebar.c
index 5a5fa5c5ac..cc4765ce15 100644
--- a/modules/calendar/e-cal-shell-sidebar.c
+++ b/modules/calendar/e-cal-shell-sidebar.c
@@ -132,7 +132,10 @@ cal_shell_sidebar_map_uid_to_source (GValue *value,
registry = E_SOURCE_REGISTRY (user_data);
uid = g_variant_get_string (variant, NULL);
- source = e_source_registry_ref_source (registry, uid);
+ if (uid != NULL && *uid != '\0')
+ source = e_source_registry_ref_source (registry, uid);
+ else
+ source = e_source_registry_ref_default_calendar (registry);
g_value_take_object (value, source);
return (source != NULL);
diff --git a/modules/calendar/e-memo-shell-sidebar.c b/modules/calendar/e-memo-shell-sidebar.c
index 597838cbee..b8ec4e46d8 100644
--- a/modules/calendar/e-memo-shell-sidebar.c
+++ b/modules/calendar/e-memo-shell-sidebar.c
@@ -129,7 +129,10 @@ memo_shell_sidebar_map_uid_to_source (GValue *value,
registry = E_SOURCE_REGISTRY (user_data);
uid = g_variant_get_string (variant, NULL);
- source = e_source_registry_ref_source (registry, uid);
+ if (uid != NULL && *uid != '\0')
+ source = e_source_registry_ref_source (registry, uid);
+ else
+ source = e_source_registry_ref_default_memo_list (registry);
g_value_take_object (value, source);
return (source != NULL);
diff --git a/modules/calendar/e-task-shell-sidebar.c b/modules/calendar/e-task-shell-sidebar.c
index d611b1969a..298bd8ce6c 100644
--- a/modules/calendar/e-task-shell-sidebar.c
+++ b/modules/calendar/e-task-shell-sidebar.c
@@ -129,7 +129,10 @@ task_shell_sidebar_map_uid_to_source (GValue *value,
registry = E_SOURCE_REGISTRY (user_data);
uid = g_variant_get_string (variant, NULL);
- source = e_source_registry_ref_source (registry, uid);
+ if (uid != NULL && *uid != '\0')
+ source = e_source_registry_ref_source (registry, uid);
+ else
+ source = e_source_registry_ref_default_task_list (registry);
g_value_take_object (value, source);
return (source != NULL);