[gnome-bluetooth] wizard: use a switch in page_func()



commit ff812f46673b2753de55942f05348cbdc9110d57
Author: Gustavo Padovan <gustavo padovan collabora co uk>
Date:   Wed May 15 13:40:52 2013 -0300

    wizard: use a switch in page_func()
    
    makes the code easier to read.

 wizard/main.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/wizard/main.c b/wizard/main.c
index e5e252a..9974824 100644
--- a/wizard/main.c
+++ b/wizard/main.c
@@ -817,15 +817,17 @@ static int
 page_func (gint current_page,
           gpointer data)
 {
-       if (current_page == PAGE_SEARCH) {
+       switch (current_page) {
+       case PAGE_SEARCH:
                if (target_ssp != FALSE || automatic_pincode != FALSE)
                        return PAGE_CONNECTING;
                else
                        return PAGE_SETUP;
-       }
-       if (current_page == PAGE_SETUP)
+       case PAGE_SETUP:
                return PAGE_SUMMARY;
-       return current_page + 1;
+       default:
+               return current_page + 1;
+       }
 }
 
 static gboolean


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