aboutsummaryrefslogtreecommitdiffstats
path: root/modules/calendar
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2011-01-29 23:50:53 +0800
committerMatthew Barnes <mbarnes@redhat.com>2011-01-30 09:22:57 +0800
commit21ab8044dab93b6367463593628ec42befda4f67 (patch)
tree50948c4b0675041b615b5113d7b9176f2d71db99 /modules/calendar
parent8fade835168c511a89813019aef6d0ee02d63b5d (diff)
downloadgsoc2013-evolution-21ab8044dab93b6367463593628ec42befda4f67.tar
gsoc2013-evolution-21ab8044dab93b6367463593628ec42befda4f67.tar.gz
gsoc2013-evolution-21ab8044dab93b6367463593628ec42befda4f67.tar.bz2
gsoc2013-evolution-21ab8044dab93b6367463593628ec42befda4f67.tar.lz
gsoc2013-evolution-21ab8044dab93b6367463593628ec42befda4f67.tar.xz
gsoc2013-evolution-21ab8044dab93b6367463593628ec42befda4f67.tar.zst
gsoc2013-evolution-21ab8044dab93b6367463593628ec42befda4f67.zip
Coding style and whitespace cleanup.
Diffstat (limited to 'modules/calendar')
-rw-r--r--modules/calendar/e-cal-shell-migrate.c4
-rw-r--r--modules/calendar/e-cal-shell-sidebar.c27
-rw-r--r--modules/calendar/e-cal-shell-view-actions.c4
-rw-r--r--modules/calendar/e-memo-shell-sidebar.c40
-rw-r--r--modules/calendar/e-task-shell-migrate.c4
-rw-r--r--modules/calendar/e-task-shell-sidebar.c40
6 files changed, 72 insertions, 47 deletions
diff --git a/modules/calendar/e-cal-shell-migrate.c b/modules/calendar/e-cal-shell-migrate.c
index 3ef6e554ad..710aa8f2a2 100644
--- a/modules/calendar/e-cal-shell-migrate.c
+++ b/modules/calendar/e-cal-shell-migrate.c
@@ -94,9 +94,11 @@ create_calendar_sources (EShellBackend *shell_backend,
if (groups) {
/* groups are already there, we need to search for things... */
GSList *g;
+ const gchar *data_dir;
gchar *base_dir, *base_uri;
- base_dir = g_build_filename (e_shell_backend_get_data_dir (shell_backend), "local", NULL);
+ data_dir = e_shell_backend_get_data_dir (shell_backend);
+ base_dir = g_build_filename (data_dir, "local", NULL);
base_uri = g_filename_to_uri (base_dir, NULL, NULL);
for (g = groups; g; g = g->next) {
diff --git a/modules/calendar/e-cal-shell-sidebar.c b/modules/calendar/e-cal-shell-sidebar.c
index 1af16b3b8e..f61e0a60a7 100644
--- a/modules/calendar/e-cal-shell-sidebar.c
+++ b/modules/calendar/e-cal-shell-sidebar.c
@@ -111,6 +111,7 @@ cal_shell_sidebar_backend_died_cb (ECalShellSidebar *cal_shell_sidebar,
ECal *client)
{
EShellView *shell_view;
+ EShellContent *shell_content;
EShellSidebar *shell_sidebar;
GHashTable *client_table;
ESource *source;
@@ -120,6 +121,7 @@ cal_shell_sidebar_backend_died_cb (ECalShellSidebar *cal_shell_sidebar,
shell_sidebar = E_SHELL_SIDEBAR (cal_shell_sidebar);
shell_view = e_shell_sidebar_get_shell_view (shell_sidebar);
+ shell_content = e_shell_view_get_shell_content (shell_view);
source = e_cal_get_source (client);
uid = e_source_peek_uid (source);
@@ -129,7 +131,8 @@ cal_shell_sidebar_backend_died_cb (ECalShellSidebar *cal_shell_sidebar,
g_hash_table_remove (client_table, uid);
cal_shell_sidebar_emit_status_message (cal_shell_sidebar, NULL);
- e_alert_submit (E_ALERT_SINK (e_shell_view_get_shell_content (shell_view)),
+ e_alert_submit (
+ E_ALERT_SINK (shell_content),
"calendar:calendar-crashed", NULL);
g_object_unref (source);
@@ -141,18 +144,23 @@ cal_shell_sidebar_backend_error_cb (ECalShellSidebar *cal_shell_sidebar,
ECal *client)
{
EShellView *shell_view;
+ EShellContent *shell_content;
EShellSidebar *shell_sidebar;
ESourceGroup *source_group;
ESource *source;
shell_sidebar = E_SHELL_SIDEBAR (cal_shell_sidebar);
shell_view = e_shell_sidebar_get_shell_view (shell_sidebar);
+ shell_content = e_shell_view_get_shell_content (shell_view);
source = e_cal_get_source (client);
source_group = e_source_peek_group (source);
- e_alert_submit (E_ALERT_SINK (e_shell_view_get_shell_content (shell_view)),
- "calendar:backend-error", e_source_group_peek_name (source_group), e_source_peek_name (source), message, NULL);
+ e_alert_submit (
+ E_ALERT_SINK (shell_content),
+ "calendar:backend-error",
+ e_source_group_peek_name (source_group),
+ e_source_peek_name (source), message, NULL);
}
static void
@@ -161,11 +169,13 @@ cal_shell_sidebar_client_opened_cb (ECalShellSidebar *cal_shell_sidebar,
ECal *client)
{
EShellView *shell_view;
+ EShellContent *shell_content;
EShellSidebar *shell_sidebar;
const gchar *message;
shell_sidebar = E_SHELL_SIDEBAR (cal_shell_sidebar);
shell_view = e_shell_sidebar_get_shell_view (shell_sidebar);
+ shell_content = e_shell_view_get_shell_content (shell_view);
if (g_error_matches (error, E_CALENDAR_ERROR,
E_CALENDAR_STATUS_AUTHENTICATION_FAILED) ||
@@ -186,14 +196,16 @@ cal_shell_sidebar_client_opened_cb (ECalShellSidebar *cal_shell_sidebar,
return;
case E_CALENDAR_STATUS_REPOSITORY_OFFLINE:
- e_alert_submit (E_ALERT_SINK (e_shell_view_get_shell_content (shell_view)),
+ e_alert_submit (
+ E_ALERT_SINK (shell_content),
"calendar:prompt-no-contents-offline-calendar",
NULL);
/* fall through */
default:
if (error->code != E_CALENDAR_STATUS_REPOSITORY_OFFLINE) {
- e_alert_submit (E_ALERT_SINK (e_shell_view_get_shell_content (shell_view)),
+ e_alert_submit (
+ E_ALERT_SINK (shell_content),
"calendar:failed-open-calendar",
error->message, NULL);
}
@@ -222,6 +234,7 @@ cal_shell_sidebar_default_loaded_cb (ESource *source,
EShellSidebar *shell_sidebar)
{
ECalShellSidebarPrivate *priv;
+ EShellContent *shell_content;
EShellView *shell_view;
ECal *client;
GError *error = NULL;
@@ -229,6 +242,7 @@ cal_shell_sidebar_default_loaded_cb (ESource *source,
priv = E_CAL_SHELL_SIDEBAR_GET_PRIVATE (shell_sidebar);
shell_view = e_shell_sidebar_get_shell_view (shell_sidebar);
+ shell_content = e_shell_view_get_shell_content (shell_view);
client = e_load_cal_source_finish (source, result, &error);
@@ -237,7 +251,8 @@ cal_shell_sidebar_default_loaded_cb (ESource *source,
goto exit;
} else if (error != NULL) {
- e_alert_submit (E_ALERT_SINK (e_shell_view_get_shell_content (shell_view)),
+ e_alert_submit (
+ E_ALERT_SINK (shell_content),
"calendar:failed-open-calendar",
error->message, NULL);
g_error_free (error);
diff --git a/modules/calendar/e-cal-shell-view-actions.c b/modules/calendar/e-cal-shell-view-actions.c
index 3417875803..90abf79c3c 100644
--- a/modules/calendar/e-cal-shell-view-actions.c
+++ b/modules/calendar/e-cal-shell-view-actions.c
@@ -1216,7 +1216,9 @@ edit_event_as (ECalShellView *cal_shell_view, gboolean as_meeting)
}
}
- e_calendar_view_edit_appointment (calendar_view, client, icalcomp, as_meeting ? EDIT_EVENT_FORCE_MEETING : EDIT_EVENT_FORCE_APPOINTMENT);
+ e_calendar_view_edit_appointment (
+ calendar_view, client, icalcomp, as_meeting ?
+ EDIT_EVENT_FORCE_MEETING : EDIT_EVENT_FORCE_APPOINTMENT);
if (!as_meeting && icalcomp) {
icalcomponent_free (icalcomp);
diff --git a/modules/calendar/e-memo-shell-sidebar.c b/modules/calendar/e-memo-shell-sidebar.c
index 31304948f9..b7e52a9095 100644
--- a/modules/calendar/e-memo-shell-sidebar.c
+++ b/modules/calendar/e-memo-shell-sidebar.c
@@ -101,24 +101,12 @@ memo_shell_sidebar_emit_status_message (EMemoShellSidebar *memo_shell_sidebar,
g_signal_emit (memo_shell_sidebar, signal_id, 0, status_message, -1.0);
}
-static EAlertSink *
-get_alert_sink (EShellView *shell_view)
-{
- EShellWindow *shell_window;
-
- shell_window = e_shell_view_get_shell_window (shell_view);
-
- if (g_strcmp0 (e_shell_window_get_active_view (shell_window), "calendar") == 0)
- shell_view = e_shell_window_peek_shell_view (shell_window, "calendar");
-
- return E_ALERT_SINK (e_shell_view_get_shell_content (shell_view));
-}
-
static void
memo_shell_sidebar_backend_died_cb (EMemoShellSidebar *memo_shell_sidebar,
ECal *client)
{
EShellView *shell_view;
+ EShellContent *shell_content;
EShellSidebar *shell_sidebar;
GHashTable *client_table;
ESource *source;
@@ -128,6 +116,7 @@ memo_shell_sidebar_backend_died_cb (EMemoShellSidebar *memo_shell_sidebar,
shell_sidebar = E_SHELL_SIDEBAR (memo_shell_sidebar);
shell_view = e_shell_sidebar_get_shell_view (shell_sidebar);
+ shell_content = e_shell_view_get_shell_content (shell_view);
source = e_cal_get_source (client);
uid = e_source_peek_uid (source);
@@ -137,7 +126,8 @@ memo_shell_sidebar_backend_died_cb (EMemoShellSidebar *memo_shell_sidebar,
g_hash_table_remove (client_table, uid);
memo_shell_sidebar_emit_status_message (memo_shell_sidebar, NULL);
- e_alert_submit (get_alert_sink (shell_view),
+ e_alert_submit (
+ E_ALERT_SINK (shell_content),
"calendar:memos-crashed", NULL);
g_object_unref (source);
@@ -149,18 +139,23 @@ memo_shell_sidebar_backend_error_cb (EMemoShellSidebar *memo_shell_sidebar,
ECal *client)
{
EShellView *shell_view;
+ EShellContent *shell_content;
EShellSidebar *shell_sidebar;
ESourceGroup *source_group;
ESource *source;
shell_sidebar = E_SHELL_SIDEBAR (memo_shell_sidebar);
shell_view = e_shell_sidebar_get_shell_view (shell_sidebar);
+ shell_content = e_shell_view_get_shell_content (shell_view);
source = e_cal_get_source (client);
source_group = e_source_peek_group (source);
- e_alert_submit (get_alert_sink (shell_view),
- "calendar:backend-error", e_source_group_peek_name (source_group), e_source_peek_name (source), message, NULL);
+ e_alert_submit (
+ E_ALERT_SINK (shell_content),
+ "calendar:backend-error",
+ e_source_group_peek_name (source_group),
+ e_source_peek_name (source), message, NULL);
}
static void
@@ -169,11 +164,13 @@ memo_shell_sidebar_client_opened_cb (EMemoShellSidebar *memo_shell_sidebar,
ECal *client)
{
EShellView *shell_view;
+ EShellContent *shell_content;
EShellSidebar *shell_sidebar;
const gchar *message;
shell_sidebar = E_SHELL_SIDEBAR (memo_shell_sidebar);
shell_view = e_shell_sidebar_get_shell_view (shell_sidebar);
+ shell_content = e_shell_view_get_shell_content (shell_view);
if (g_error_matches (error, E_CALENDAR_ERROR,
E_CALENDAR_STATUS_AUTHENTICATION_FAILED) ||
@@ -194,14 +191,16 @@ memo_shell_sidebar_client_opened_cb (EMemoShellSidebar *memo_shell_sidebar,
return;
case E_CALENDAR_STATUS_REPOSITORY_OFFLINE:
- e_alert_submit (get_alert_sink (shell_view),
+ e_alert_submit (
+ E_ALERT_SINK (shell_content),
"calendar:prompt-no-contents-offline-memos",
NULL);
/* fall through */
default:
if (error->code != E_CALENDAR_STATUS_REPOSITORY_OFFLINE) {
- e_alert_submit (get_alert_sink (shell_view),
+ e_alert_submit (
+ E_ALERT_SINK (shell_content),
"calendar:failed-open-memos",
error->message, NULL);
}
@@ -230,6 +229,7 @@ memo_shell_sidebar_default_loaded_cb (ESource *source,
EShellSidebar *shell_sidebar)
{
EMemoShellSidebarPrivate *priv;
+ EShellContent *shell_content;
EShellView *shell_view;
ECal *client;
GError *error = NULL;
@@ -237,6 +237,7 @@ memo_shell_sidebar_default_loaded_cb (ESource *source,
priv = E_MEMO_SHELL_SIDEBAR_GET_PRIVATE (shell_sidebar);
shell_view = e_shell_sidebar_get_shell_view (shell_sidebar);
+ shell_content = e_shell_view_get_shell_content (shell_view);
client = e_load_cal_source_finish (source, result, &error);
@@ -245,7 +246,8 @@ memo_shell_sidebar_default_loaded_cb (ESource *source,
goto exit;
} else if (error != NULL) {
- e_alert_submit (get_alert_sink (shell_view),
+ e_alert_submit (
+ E_ALERT_SINK (shell_content),
"calendar:failed-open-memos",
error->message, NULL);
g_error_free (error);
diff --git a/modules/calendar/e-task-shell-migrate.c b/modules/calendar/e-task-shell-migrate.c
index f57ac7e75a..d7daafc91d 100644
--- a/modules/calendar/e-task-shell-migrate.c
+++ b/modules/calendar/e-task-shell-migrate.c
@@ -70,9 +70,11 @@ create_task_sources (EShellBackend *shell_backend,
if (groups) {
/* groups are already there, we need to search for things... */
GSList *g;
+ const gchar *data_dir;
gchar *base_dir, *base_uri;
- base_dir = g_build_filename (e_shell_backend_get_data_dir (shell_backend), "local", NULL);
+ data_dir = e_shell_backend_get_data_dir (shell_backend);
+ base_dir = g_build_filename (data_dir, "local", NULL);
base_uri = g_filename_to_uri (base_dir, NULL, NULL);
for (g = groups; g; g = g->next) {
diff --git a/modules/calendar/e-task-shell-sidebar.c b/modules/calendar/e-task-shell-sidebar.c
index e00159026c..62973d2efc 100644
--- a/modules/calendar/e-task-shell-sidebar.c
+++ b/modules/calendar/e-task-shell-sidebar.c
@@ -101,24 +101,12 @@ task_shell_sidebar_emit_status_message (ETaskShellSidebar *task_shell_sidebar,
g_signal_emit (task_shell_sidebar, signal_id, 0, status_message, -1.0);
}
-static EAlertSink *
-get_alert_sink (EShellView *shell_view)
-{
- EShellWindow *shell_window;
-
- shell_window = e_shell_view_get_shell_window (shell_view);
-
- if (g_strcmp0 (e_shell_window_get_active_view (shell_window), "calendar") == 0)
- shell_view = e_shell_window_peek_shell_view (shell_window, "calendar");
-
- return E_ALERT_SINK (e_shell_view_get_shell_content (shell_view));
-}
-
static void
task_shell_sidebar_backend_died_cb (ETaskShellSidebar *task_shell_sidebar,
ECal *client)
{
EShellView *shell_view;
+ EShellContent *shell_content;
EShellSidebar *shell_sidebar;
GHashTable *client_table;
ESource *source;
@@ -128,6 +116,7 @@ task_shell_sidebar_backend_died_cb (ETaskShellSidebar *task_shell_sidebar,
shell_sidebar = E_SHELL_SIDEBAR (task_shell_sidebar);
shell_view = e_shell_sidebar_get_shell_view (shell_sidebar);
+ shell_content = e_shell_view_get_shell_content (shell_view);
source = e_cal_get_source (client);
uid = e_source_peek_uid (source);
@@ -137,7 +126,8 @@ task_shell_sidebar_backend_died_cb (ETaskShellSidebar *task_shell_sidebar,
g_hash_table_remove (client_table, uid);
task_shell_sidebar_emit_status_message (task_shell_sidebar, NULL);
- e_alert_submit (get_alert_sink (shell_view),
+ e_alert_submit (
+ E_ALERT_SINK (shell_content),
"calendar:tasks-crashed", NULL);
g_object_unref (source);
@@ -149,18 +139,23 @@ task_shell_sidebar_backend_error_cb (ETaskShellSidebar *task_shell_sidebar,
ECal *client)
{
EShellView *shell_view;
+ EShellContent *shell_content;
EShellSidebar *shell_sidebar;
ESourceGroup *source_group;
ESource *source;
shell_sidebar = E_SHELL_SIDEBAR (task_shell_sidebar);
shell_view = e_shell_sidebar_get_shell_view (shell_sidebar);
+ shell_content = e_shell_view_get_shell_content (shell_view);
source = e_cal_get_source (client);
source_group = e_source_peek_group (source);
- e_alert_submit (get_alert_sink (shell_view),
- "calendar:backend-error", e_source_group_peek_name (source_group), e_source_peek_name (source), message, NULL);
+ e_alert_submit (
+ E_ALERT_SINK (shell_content),
+ "calendar:backend-error",
+ e_source_group_peek_name (source_group),
+ e_source_peek_name (source), message, NULL);
}
static void
@@ -169,11 +164,13 @@ task_shell_sidebar_client_opened_cb (ETaskShellSidebar *task_shell_sidebar,
ECal *client)
{
EShellView *shell_view;
+ EShellContent *shell_content;
EShellSidebar *shell_sidebar;
const gchar *message;
shell_sidebar = E_SHELL_SIDEBAR (task_shell_sidebar);
shell_view = e_shell_sidebar_get_shell_view (shell_sidebar);
+ shell_content = e_shell_view_get_shell_content (shell_view);
if (g_error_matches (error, E_CALENDAR_ERROR,
E_CALENDAR_STATUS_AUTHENTICATION_FAILED) ||
@@ -194,14 +191,16 @@ task_shell_sidebar_client_opened_cb (ETaskShellSidebar *task_shell_sidebar,
return;
case E_CALENDAR_STATUS_REPOSITORY_OFFLINE:
- e_alert_submit (get_alert_sink (shell_view),
+ e_alert_submit (
+ E_ALERT_SINK (shell_content),
"calendar:prompt-no-contents-offline-tasks",
NULL);
/* fall through */
default:
if (error->code != E_CALENDAR_STATUS_REPOSITORY_OFFLINE) {
- e_alert_submit (get_alert_sink (shell_view),
+ e_alert_submit (
+ E_ALERT_SINK (shell_content),
"calendar:failed-open-tasks",
error->message, NULL);
}
@@ -230,6 +229,7 @@ task_shell_sidebar_default_loaded_cb (ESource *source,
EShellSidebar *shell_sidebar)
{
ETaskShellSidebarPrivate *priv;
+ EShellContent *shell_content;
EShellView *shell_view;
ECal *client;
GError *error = NULL;
@@ -237,6 +237,7 @@ task_shell_sidebar_default_loaded_cb (ESource *source,
priv = E_TASK_SHELL_SIDEBAR_GET_PRIVATE (shell_sidebar);
shell_view = e_shell_sidebar_get_shell_view (shell_sidebar);
+ shell_content = e_shell_view_get_shell_content (shell_view);
client = e_load_cal_source_finish (source, result, &error);
@@ -245,7 +246,8 @@ task_shell_sidebar_default_loaded_cb (ESource *source,
goto exit;
} else if (error != NULL) {
- e_alert_submit (get_alert_sink (shell_view),
+ e_alert_submit (
+ E_ALERT_SINK (shell_content),
"calendar:failed-open-tasks",
error->message, NULL);
g_error_free (error);