aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/dialogs
diff options
context:
space:
mode:
Diffstat (limited to 'calendar/gui/dialogs')
-rw-r--r--calendar/gui/dialogs/alarm-list-dialog.c48
-rw-r--r--calendar/gui/dialogs/cancel-comp.c7
-rw-r--r--calendar/gui/dialogs/comp-editor.c3
-rw-r--r--calendar/gui/dialogs/task-details-page.c11
4 files changed, 44 insertions, 25 deletions
diff --git a/calendar/gui/dialogs/alarm-list-dialog.c b/calendar/gui/dialogs/alarm-list-dialog.c
index 4476bc4c62..1990e076df 100644
--- a/calendar/gui/dialogs/alarm-list-dialog.c
+++ b/calendar/gui/dialogs/alarm-list-dialog.c
@@ -177,6 +177,7 @@ delete_clicked_cb (GtkButton *button, gpointer data)
{
Dialog *dialog = data;
GtkTreeSelection *selection;
+ GtkTreeModel *model;
GtkTreeIter iter;
GtkTreePath *path;
gboolean valid_iter;
@@ -187,14 +188,15 @@ delete_clicked_cb (GtkButton *button, gpointer data)
return;
}
- path = gtk_tree_model_get_path (GTK_TREE_MODEL (dialog->list_store), &iter);
+ model = GTK_TREE_MODEL (dialog->list_store);
+ path = gtk_tree_model_get_path (model, &iter);
e_alarm_list_remove (dialog->list_store, &iter);
/* Select closest item after removal */
- valid_iter = gtk_tree_model_get_iter (GTK_TREE_MODEL (dialog->list_store), &iter, path);
+ valid_iter = gtk_tree_model_get_iter (model, &iter, path);
if (!valid_iter) {
gtk_tree_path_prev (path);
- valid_iter = gtk_tree_model_get_iter (GTK_TREE_MODEL (dialog->list_store), &iter, path);
+ valid_iter = gtk_tree_model_get_iter (model, &iter, path);
}
if (valid_iter)
@@ -235,26 +237,33 @@ init_widgets (Dialog *dialog)
GtkCellRenderer *cell_renderer;
/* View */
- gtk_tree_view_set_model (GTK_TREE_VIEW (dialog->list),
- GTK_TREE_MODEL (dialog->list_store));
+ gtk_tree_view_set_model (
+ GTK_TREE_VIEW (dialog->list),
+ GTK_TREE_MODEL (dialog->list_store));
column = gtk_tree_view_column_new ();
gtk_tree_view_column_set_title (column, _("Action/Trigger"));
cell_renderer = GTK_CELL_RENDERER (gtk_cell_renderer_text_new ());
gtk_tree_view_column_pack_start (column, cell_renderer, TRUE);
- gtk_tree_view_column_add_attribute (column, cell_renderer, "text", E_ALARM_LIST_COLUMN_DESCRIPTION);
+ gtk_tree_view_column_add_attribute (
+ column, cell_renderer,
+ "text", E_ALARM_LIST_COLUMN_DESCRIPTION);
gtk_tree_view_append_column (GTK_TREE_VIEW (dialog->list), column);
/* Reminder buttons */
- g_signal_connect (dialog->add, "clicked",
- G_CALLBACK (add_clicked_cb), dialog);
- g_signal_connect (dialog->delete, "clicked",
- G_CALLBACK (delete_clicked_cb), dialog);
- g_signal_connect (dialog->edit, "clicked",
- G_CALLBACK (edit_clicked_cb), dialog);
-
- g_signal_connect (gtk_tree_view_get_selection (GTK_TREE_VIEW (dialog->list)), "changed",
- G_CALLBACK (selection_changed_cb), dialog);
+ g_signal_connect (
+ dialog->add, "clicked",
+ G_CALLBACK (add_clicked_cb), dialog);
+ g_signal_connect (
+ dialog->delete, "clicked",
+ G_CALLBACK (delete_clicked_cb), dialog);
+ g_signal_connect (
+ dialog->edit, "clicked",
+ G_CALLBACK (edit_clicked_cb), dialog);
+
+ g_signal_connect (
+ gtk_tree_view_get_selection (GTK_TREE_VIEW (dialog->list)),
+ "changed", G_CALLBACK (selection_changed_cb), dialog);
}
gboolean
@@ -327,8 +336,13 @@ alarm_list_dialog_peek (ECal *ecal, EAlarmList *list_store)
g_object_unref (dialog->builder);
/* Free the other stuff when the parent really gets destroyed. */
- g_object_set_data_full (G_OBJECT (dialog->box), "toplevel", dialog->toplevel, (GDestroyNotify) gtk_widget_destroy);
- g_object_set_data_full (G_OBJECT (dialog->box), "dialog", dialog, g_free);
+ g_object_set_data_full (
+ G_OBJECT (dialog->box),
+ "toplevel", dialog->toplevel,
+ (GDestroyNotify) gtk_widget_destroy);
+ g_object_set_data_full (
+ G_OBJECT (dialog->box), "dialog",
+ dialog, (GDestroyNotify) g_free);
return dialog->box;
}
diff --git a/calendar/gui/dialogs/cancel-comp.c b/calendar/gui/dialogs/cancel-comp.c
index fe85119dae..4482d4d7ab 100644
--- a/calendar/gui/dialogs/cancel-comp.c
+++ b/calendar/gui/dialogs/cancel-comp.c
@@ -47,9 +47,10 @@ is_past_event (ECalComponent *comp)
if (!comp) return TRUE;
e_cal_component_get_dtend (comp, &end_date);
- res = icaltime_compare_date_only (*end_date.value,
- icaltime_current_time_with_zone (icaltime_get_timezone (*end_date.value))
- ) == -1;
+ res = icaltime_compare_date_only (
+ *end_date.value,
+ icaltime_current_time_with_zone (
+ icaltime_get_timezone (*end_date.value))) == -1;
e_cal_component_free_datetime (&end_date);
return res;
diff --git a/calendar/gui/dialogs/comp-editor.c b/calendar/gui/dialogs/comp-editor.c
index 983b42cdee..c8640b608a 100644
--- a/calendar/gui/dialogs/comp-editor.c
+++ b/calendar/gui/dialogs/comp-editor.c
@@ -3461,6 +3461,7 @@ obj_removed_cb (ECal *client,
{
CompEditorPrivate *priv = editor->priv;
- if (changed_component_dialog ((GtkWindow *) editor, priv->comp, TRUE, priv->changed))
+ if (changed_component_dialog (
+ GTK_WINDOW (editor), priv->comp, TRUE, priv->changed))
close_dialog (editor);
}
diff --git a/calendar/gui/dialogs/task-details-page.c b/calendar/gui/dialogs/task-details-page.c
index 55d44a7694..7f72dd3e38 100644
--- a/calendar/gui/dialogs/task-details-page.c
+++ b/calendar/gui/dialogs/task-details-page.c
@@ -404,11 +404,14 @@ task_details_page_fill_timezones (CompEditorPage *page,
{
icaltimezone *zone;
- /* add UTC timezone, which is the one used for the DATE-COMPLETED property */
+ /* Add UTC timezone, which is the one
+ * used for the DATE-COMPLETED property. */
zone = icaltimezone_get_utc_timezone ();
- if (zone) {
- if (!g_hash_table_lookup (timezones, icaltimezone_get_tzid (zone)))
- g_hash_table_insert (timezones, (gpointer) icaltimezone_get_tzid (zone), zone);
+ if (zone != NULL) {
+ gconstpointer tzid = icaltimezone_get_tzid (zone);
+
+ if (!g_hash_table_lookup (timezones, tzid))
+ g_hash_table_insert (timezones, (gpointer) tzid, zone);
}
return TRUE;