Enlightenment CVS committal

Author  : devilhorns
Project : e17
Module  : apps/e

Dir     : e17/apps/e/src/bin


Modified Files:
        e_toolbar.c 


Log Message:
No need to use a switch when detecting mouse button. A simple one-line if
will work instead.

===================================================================
RCS file: /cvs/e/e17/apps/e/src/bin/e_toolbar.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -3 -r1.10 -r1.11
--- e_toolbar.c 22 Nov 2007 19:33:34 -0000      1.10
+++ e_toolbar.c 9 Dec 2007 15:35:41 -0000       1.11
@@ -280,22 +280,16 @@
 
    ev = event_info;
    tbar = data;
-   switch (ev->button) 
-     {
-      case 3:
-       mn = e_menu_new();
-       e_menu_post_deactivate_callback_set(mn, _e_toolbar_menu_cb_post, tbar);
-       tbar->menu = mn;
-       _e_toolbar_menu_append(tbar, mn);
-       zone = e_util_zone_current_get(e_manager_current_get());
-       ecore_x_pointer_xy_get(zone->container->win, &x, &y);
-       e_menu_activate_mouse(mn, zone, x, y, 1, 1, 
-                             E_MENU_POP_DIRECTION_DOWN, ev->timestamp);
-       e_util_evas_fake_mouse_up_later(tbar->gadcon->evas, ev->button);
-       break;
-      default:
-       break;
-     }
+   if (ev->button != 3) return;
+   mn = e_menu_new();
+   e_menu_post_deactivate_callback_set(mn, _e_toolbar_menu_cb_post, tbar);
+   tbar->menu = mn;
+   _e_toolbar_menu_append(tbar, mn);
+   zone = e_util_zone_current_get(e_manager_current_get());
+   ecore_x_pointer_xy_get(zone->container->win, &x, &y);
+   e_menu_activate_mouse(mn, zone, x, y, 1, 1, 
+                        E_MENU_POP_DIRECTION_DOWN, ev->timestamp);
+   e_util_evas_fake_mouse_up_later(tbar->gadcon->evas, ev->button);
 }
 
 static void 
@@ -376,6 +370,7 @@
        E_Menu_Item *mi;
 
        mi = l->data;
+       if (!mi) continue;
        if (mi->submenu) e_object_del(E_OBJECT(mi->submenu));
      }
 }
@@ -407,8 +402,7 @@
    E_Toolbar *tbar;
 
    tbar = data;
-   if (!tbar->gadcon->config_dialog) 
-     e_int_gadcon_config_toolbar(tbar->gadcon);
+   if (!tbar->gadcon->config_dialog) e_int_gadcon_config_toolbar(tbar->gadcon);
 }
 
 static void 



-------------------------------------------------------------------------
SF.Net email is sponsored by: 
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to