aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2011-11-25 19:43:53 +0800
committerMilan Crha <mcrha@redhat.com>2011-11-25 19:43:53 +0800
commiteabcec7ecf6ab774f382c3b1336883bebb5077c2 (patch)
tree291977ce9a26f614677fd5a995ecf5cb77a5d2be
parent8664187d640655a6c1fc44e99937ea8037cf4932 (diff)
downloadgsoc2013-evolution-eabcec7ecf6ab774f382c3b1336883bebb5077c2.tar
gsoc2013-evolution-eabcec7ecf6ab774f382c3b1336883bebb5077c2.tar.gz
gsoc2013-evolution-eabcec7ecf6ab774f382c3b1336883bebb5077c2.tar.bz2
gsoc2013-evolution-eabcec7ecf6ab774f382c3b1336883bebb5077c2.tar.lz
gsoc2013-evolution-eabcec7ecf6ab774f382c3b1336883bebb5077c2.tar.xz
gsoc2013-evolution-eabcec7ecf6ab774f382c3b1336883bebb5077c2.tar.zst
gsoc2013-evolution-eabcec7ecf6ab774f382c3b1336883bebb5077c2.zip
Bug #376075 - Accepting a meeting invitation defaults to wrong calendar
-rw-r--r--plugins/itip-formatter/itip-formatter.c61
1 files changed, 33 insertions, 28 deletions
diff --git a/plugins/itip-formatter/itip-formatter.c b/plugins/itip-formatter/itip-formatter.c
index 06068ba5ac..0d80086342 100644
--- a/plugins/itip-formatter/itip-formatter.c
+++ b/plugins/itip-formatter/itip-formatter.c
@@ -739,39 +739,44 @@ decrease_find_data (FormatItipFindData *fd)
if ((pitip->method == ICAL_METHOD_PUBLISH || pitip->method == ICAL_METHOD_REQUEST)
&& !pitip->current_client) {
/* Reuse already declared one or rename? */
- EShell *shell;
- EShellSettings *shell_settings;
ESource *source = NULL;
- gchar *uid;
- /* FIXME Find a better way to obtain the shell. */
- shell = e_shell_get_default ();
- shell_settings = e_shell_get_shell_settings (shell);
-
- switch (pitip->type) {
- case E_CAL_CLIENT_SOURCE_TYPE_EVENTS:
- uid = e_shell_settings_get_string (
- shell_settings, "cal-primary-calendar");
- break;
- case E_CAL_CLIENT_SOURCE_TYPE_TASKS:
- uid = e_shell_settings_get_string (
- shell_settings, "cal-primary-task-list");
- break;
- case E_CAL_CLIENT_SOURCE_TYPE_MEMOS:
- uid = e_shell_settings_get_string (
- shell_settings, "cal-primary-memo-list");
- break;
- default:
- uid = NULL;
- g_assert_not_reached ();
- }
+ /* Try to create a default if there isn't one */
+ source = e_source_list_peek_default_source (pitip->source_lists[pitip->type]);
+
+ if (!source) {
+ EShell *shell;
+ EShellSettings *shell_settings;
+ gchar *uid;
+
+ /* FIXME Find a better way to obtain the shell. */
+ shell = e_shell_get_default ();
+ shell_settings = e_shell_get_shell_settings (shell);
+
+ switch (pitip->type) {
+ case E_CAL_CLIENT_SOURCE_TYPE_EVENTS:
+ uid = e_shell_settings_get_string (
+ shell_settings, "cal-primary-calendar");
+ break;
+ case E_CAL_CLIENT_SOURCE_TYPE_TASKS:
+ uid = e_shell_settings_get_string (
+ shell_settings, "cal-primary-task-list");
+ break;
+ case E_CAL_CLIENT_SOURCE_TYPE_MEMOS:
+ uid = e_shell_settings_get_string (
+ shell_settings, "cal-primary-memo-list");
+ break;
+ default:
+ uid = NULL;
+ g_assert_not_reached ();
+ }
- if (uid) {
- source = e_source_list_peek_source_by_uid (pitip->source_lists[pitip->type], uid);
- g_free (uid);
+ if (uid) {
+ source = e_source_list_peek_source_by_uid (pitip->source_lists[pitip->type], uid);
+ g_free (uid);
+ }
}
- /* Try to create a default if there isn't one */
if (!source)
source = e_source_list_peek_source_any (pitip->source_lists[pitip->type]);