Prefer 'if/else' over 'switch' when dealing with only 2 possibilities.
---
 gtk/spicy.c |    8 ++------
 1 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/gtk/spicy.c b/gtk/spicy.c
index 82d8de2..0120692 100644
--- a/gtk/spicy.c
+++ b/gtk/spicy.c
@@ -239,18 +239,14 @@ static int connect_dialog(GtkWidget *parent, SpiceSession 
*session)
 #endif
     /* show and wait for response */
     gtk_widget_show_all(dialog);
-    switch (gtk_dialog_run(GTK_DIALOG(dialog))) {
-    case GTK_RESPONSE_ACCEPT:
+    if (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_ACCEPT) {
         for (i = 0; i < SPICE_N_ELEMENTS(connect_entries); i++) {
             txt = gtk_entry_get_text(GTK_ENTRY(connect_entries[i].entry));
             g_object_set(session, connect_entries[i].prop, txt, NULL);
         }
        retval = 0;
-       break;
-    default:
+    } else
        retval = -1;
-       break;
-    }
     gtk_widget_destroy(dialog);
     return retval;
 }
-- 
1.7.5.1

_______________________________________________
Spice-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/spice-devel

Reply via email to