[evolution] Bug 696257 - Handle default values for "primary" selection settings
- From: Matthew Barnes <mbarnes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution] Bug 696257 - Handle default values for "primary" selection settings
- Date: Sun, 24 Mar 2013 18:04:51 +0000 (UTC)
commit 78dfe47fdfe0c11540b508799517f3d9f21c3b0a
Author: Matthew Barnes <mbarnes redhat com>
Date: Sun Mar 24 13:37:16 2013 -0400
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.
modules/addressbook/e-book-shell-sidebar.c | 5 ++++-
modules/calendar/e-cal-shell-sidebar.c | 5 ++++-
modules/calendar/e-memo-shell-sidebar.c | 5 ++++-
modules/calendar/e-task-shell-sidebar.c | 5 ++++-
4 files changed, 16 insertions(+), 4 deletions(-)
---
diff --git a/modules/addressbook/e-book-shell-sidebar.c b/modules/addressbook/e-book-shell-sidebar.c
index d8b25ee..9c655e7 100644
--- a/modules/addressbook/e-book-shell-sidebar.c
+++ b/modules/addressbook/e-book-shell-sidebar.c
@@ -63,7 +63,10 @@ book_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_address_book (registry);
g_value_take_object (value, source);
return (source != NULL);
diff --git a/modules/calendar/e-cal-shell-sidebar.c b/modules/calendar/e-cal-shell-sidebar.c
index 5a5fa5c..cc4765c 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 597838c..b8ec4e4 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 d611b19..298bd8c 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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]