[tasks] Don't fall though when handling task editor dialog responses



commit 1884051dcb95933f5263e933135ebb795f216b48
Author: Ross Burton <ross linux intel com>
Date:   Fri Jul 10 16:36:15 2009 +0100

    Don't fall though when handling task editor dialog responses

 libkoto/koto-task-editor-dialog.c |   13 ++++++-------
 1 files changed, 6 insertions(+), 7 deletions(-)
---
diff --git a/libkoto/koto-task-editor-dialog.c b/libkoto/koto-task-editor-dialog.c
index e2e2415..a915c53 100644
--- a/libkoto/koto-task-editor-dialog.c
+++ b/libkoto/koto-task-editor-dialog.c
@@ -63,13 +63,12 @@ response_cb (GtkDialog *dialog, int response)
     return;
   }
 
-  switch (response) {
-  case KOTO_TASK_EDITOR_DIALOG_RESPONSE_DELETE:
+  if (response == KOTO_TASK_EDITOR_DIALOG_RESPONSE_DELETE) {
     confirm = gtk_message_dialog_new (GTK_WINDOW (dialog),
-                                     GTK_DIALOG_DESTROY_WITH_PARENT,
-                                     GTK_MESSAGE_QUESTION, GTK_BUTTONS_NONE,
-                                     _("Are you sure you want to delete \"%s\"?"),
-                                     icalcomponent_get_summary (priv->task->comp));
+                                      GTK_DIALOG_DESTROY_WITH_PARENT,
+                                      GTK_MESSAGE_QUESTION, GTK_BUTTONS_NONE,
+                                      _("Are you sure you want to delete \"%s\"?"),
+                                      icalcomponent_get_summary (priv->task->comp));
     gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (confirm),
                                               _("If you delete an item, it is permanently lost."));
     gtk_dialog_add_buttons (GTK_DIALOG (confirm),
@@ -95,7 +94,7 @@ response_cb (GtkDialog *dialog, int response)
     }
 
     gtk_widget_destroy (confirm);
-  default:
+  } else {
     if (koto_task_editor_dialog_is_dirty (KOTO_TASK_EDITOR_DIALOG (dialog))) {
       if (priv->undo_manager)
         undo = koto_undo_manager_context_begin_formatted (priv->undo_manager,



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]