Enlightenment CVS committal

Author  : sndev
Project : e17
Module  : apps/e

Dir     : e17/apps/e/src/bin


Modified Files:
        e_int_config_keybindings.c 


Log Message:

* some code cleanup
* some bugfixes.

===================================================================
RCS file: /cvs/e/e17/apps/e/src/bin/e_int_config_keybindings.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -3 -r1.20 -r1.21
--- e_int_config_keybindings.c  6 May 2006 09:35:05 -0000       1.20
+++ e_int_config_keybindings.c  8 May 2006 20:24:18 -0000       1.21
@@ -84,7 +84,6 @@
 {
   E_Config_Dialog *cfd;
 
-  ACTION_GROUP *current_actg;
   ACTION2      *current_act;
   int         current_act_selector;
 
@@ -208,21 +207,24 @@
                  act = l2->data;
                  if (!strcmp(act->action_name, action_name))
                    {
-                      actg->actions = evas_list_remove(actg->actions, l2);
+                      actg->actions = evas_list_remove_list(actg->actions, l2);
 
                       if (act->action_name) 
evas_stringshare_del(act->action_name);
                       if (act->action_cmd) 
evas_stringshare_del(act->action_cmd);
                       if (act->action_params) 
evas_stringshare_del(act->action_params);
 
-                      for (l3 = act->key_bindings; l3; l3 = l3->next)
+                      while (act->key_bindings)
                         {
-                           E_Config_Binding_Key   *eb = l3->data;
+                           E_Config_Binding_Key *eb = act->key_bindings->data;
                            if (eb->key) evas_stringshare_del(eb->key);
                            if (eb->action) evas_stringshare_del(eb->action);
                            if (eb->params) evas_stringshare_del(eb->params);
                            E_FREE(eb);
-                        }
 
+                           act->key_bindings = 
evas_list_remove_list(act->key_bindings,
+                                                                     
act->key_bindings);
+
+                        }
                       E_FREE(act);
                       break;
                    }
@@ -230,7 +232,7 @@
 
             if (evas_list_count(actg->actions) == 0)
               {
-                 action_group_list = evas_list_remove(action_group_list, l);
+                 action_group_list = evas_list_remove_list(action_group_list, 
l);
                  if (actg->action_group) 
evas_stringshare_del(actg->action_group);
                  E_FREE(actg);
               }
@@ -259,14 +261,25 @@
             if (act->action_cmd) evas_stringshare_del(act->action_cmd);
             if (act->action_params) evas_stringshare_del(act->action_params);
 
-            for (l3 = act->key_bindings; l3; l3 = l3->next) 
+            while (act->key_bindings) 
+              { 
+                 E_Config_Binding_Key *eb = act->key_bindings->data;
+                 if (eb->key) evas_stringshare_del(eb->key);
+                 if (eb->action) evas_stringshare_del(eb->action);
+                 if (eb->params) evas_stringshare_del(eb->params);
+                 E_FREE(eb);
+
+                 act->key_bindings = evas_list_remove_list(act->key_bindings,
+                                                           act->key_bindings);
+              }
+            /*for (l3 = act->key_bindings; l3; l3 = l3->next) 
               { 
                  E_Config_Binding_Key   *eb = l3->data;
                  if (eb->key) evas_stringshare_del(eb->key);
                  if (eb->action) evas_stringshare_del(eb->action);
                  if (eb->params) evas_stringshare_del(eb->params);
                  E_FREE(eb); 
-              }
+              }*/
 
             E_FREE(act);
 
@@ -472,7 +485,7 @@
    Evas_List *l, *l2, *l3;
    if (!cfdata) return 0;
 
-   if (cfdata->current_actg && cfdata->current_act)
+   if (cfdata->current_act)
      if (_e_keybinding_keybind_cb_auto_apply(cfdata) != 1)
        { 
          //TODO: message box which should ask if we really should proceed.
@@ -757,7 +770,7 @@
 
    if (!(cfdata = data)) return;
 
-   if (cfdata->current_actg && cfdata->current_act)
+   if (cfdata->current_act)
      if (_e_keybinding_keybind_cb_auto_apply(cfdata) != 1)
        {
          //TODO: message box which should ask if we really should proceed.
@@ -765,7 +778,7 @@
          //_keybind_delete_keybinding(cfdata);
        }
 
-   if (!cfdata->current_actg && !cfdata->current_act)
+   if (!cfdata->current_act)
      return;
 
    indx = e_widget_ilist_selected_get(cfdata->gui.binding_ilist);
@@ -794,7 +807,7 @@
 
    if (!cfdata) return;
 
-   if (cfdata->current_actg)
+   if (cfdata->current_act)
      if (_e_keybinding_keybind_cb_auto_apply(cfdata) != 1)
        {
          //TODO: message box which should ask if we really should proceed.
@@ -816,7 +829,6 @@
 
             if (!strcmp(act->action_name, label))
               {
-                 cfdata->current_actg = actg;
                  cfdata->current_act  = act;
                  done = 1;
               }
@@ -824,9 +836,7 @@
      }
 
    _e_keybinding_update_binding_list(cfdata);
-   //FIXME:is this is really needed ?
    _e_keybinding_update_add_delete_buttons(cfdata);
-
    _e_keybinding_update_action_ilist_cur_selection_icon(cfdata);
 
 #if 0
@@ -842,10 +852,10 @@
 {
   if (!cfdata) return;
 
-  cfdata->current_actg          = NULL;
   cfdata->current_act           = NULL;
   cfdata->current_act_selector  = -1;
 
+  cfdata->binding_context = -1;
   E_FREE(cfdata->key_action);
   cfdata->key_action = strdup("");
   E_FREE(cfdata->key_params);
@@ -865,7 +875,7 @@
   e_widget_disabled_set(cfdata->gui.btn_add, 1);
   e_widget_disabled_set(cfdata->gui.btn_del, 1);
 
-  if (!cfdata->current_actg && !cfdata->current_act) return;
+  if (!cfdata->current_act) return;
 
   e_widget_disabled_set(cfdata->gui.btn_add, 0);
 
@@ -880,7 +890,7 @@
 
    if (!cfdata) return;
 
-   if ((!cfdata->current_actg && !cfdata->current_act) || 
cfdata->current_act_selector < 0)
+   if (!cfdata->current_act || cfdata->current_act_selector < 0)
      {
        e_widget_disabled_set(cfdata->gui.btn_keybind, 1);
        e_widget_button_label_set(cfdata->gui.btn_keybind, 
BTN_ASSIGN_KEYBINDING_TEXT);
@@ -1019,7 +1029,7 @@
   e_widget_disabled_set(cfdata->gui.key_action, 1);
   e_widget_disabled_set(cfdata->gui.key_params, 1);
 
-  if ((!cfdata->current_actg && !cfdata->current_act)) return;
+  if (!cfdata->current_act) return;
   if (!(eb = evas_list_nth(cfdata->current_act->key_bindings, 
cfdata->current_act_selector)))
     return;
 
@@ -1046,7 +1056,7 @@
    E_Config_Dialog_Data *cfdata = data;
 
    if (!cfdata) return;
-   if (!cfdata->current_actg && !cfdata->current_act && 
cfdata->current_act_selector < 0)
+   if (!cfdata->current_act && cfdata->current_act_selector < 0)
      return;
 
    _e_keybinding_keybind_delete_keybinding(cfdata);
@@ -1055,7 +1065,6 @@
    e_widget_ilist_selected_set(cfdata->gui.binding_ilist, 
cfdata->current_act_selector);
    e_widget_ilist_go(cfdata->gui.binding_ilist);
 
-   //FIXME: is these really needed ? check what is going on when an Item from 
list is selected.
    _e_keybinding_update_keybinding_button(cfdata);
    _e_keybinding_update_add_delete_buttons(cfdata);
    _e_keybinding_update_context_radios(cfdata);
@@ -1073,7 +1082,7 @@
    E_Config_Binding_Key        *eb;
 
    if (!cfdata) return;
-   if (!cfdata->current_actg && !cfdata->current_act && 
cfdata->current_act_selector < 0)
+   if (!cfdata->current_act && cfdata->current_act_selector < 0)
      return;
 
    eb = evas_list_nth(cfdata->current_act->key_bindings, 
cfdata->current_act_selector);
@@ -1187,7 +1196,7 @@
    char buf[4096];
    Evas_List   *l;
 
-   if (!cfdata || (!cfdata->current_actg && !cfdata->current_act)) return;
+   if (!cfdata || !cfdata->current_act) return;
 
    e_widget_ilist_clear(cfdata->gui.binding_ilist);
 
@@ -1203,7 +1212,6 @@
        free(b);
        e_widget_ilist_append(cfdata->gui.binding_ilist, NULL, buf, NULL, NULL, 
NULL);
      }
-   //FIXME: is these really needed ? Should the last two rows be there ?
    _e_keybinding_update_keybinding_button(cfdata);
    _e_keybinding_update_add_delete_buttons(cfdata);
    _e_keybinding_update_context_radios(cfdata);
@@ -1223,7 +1231,7 @@
    E_Config_Dialog_Data *cfdata = data;
 
    if (!cfdata) return;
-   if (!cfdata->current_actg && !cfdata->current_act) return;
+   if (!cfdata->current_act) return;
 
    if (_e_keybinding_keybind_cb_auto_apply(cfdata) != 1)
      {
@@ -1250,7 +1258,6 @@
    e_widget_ilist_selected_set(cfdata->gui.binding_ilist, 
cfdata->current_act_selector);
    e_widget_ilist_go(cfdata->gui.binding_ilist);
 
-   //FIXME: is these really needed ?
    _e_keybinding_update_keybinding_button(cfdata);
    _e_keybinding_update_add_delete_buttons(cfdata);
    _e_keybinding_update_context_radios(cfdata);
@@ -1267,8 +1274,7 @@
    E_Config_Binding_Key        *eb;
 
    if (!cfdata) return 0;
-   if ((!cfdata->current_actg && !cfdata->current_act) ||
-       cfdata->current_act_selector < 0) return 1;
+   if (!cfdata->current_act || cfdata->current_act_selector < 0) return 1;
 
    eb = evas_list_nth(cfdata->current_act->key_bindings, 
cfdata->current_act_selector);
    if (!eb) return 0;
@@ -1368,8 +1374,7 @@
          ;
        else
          {
-            if (cfdata && (cfdata->current_actg && cfdata->current_act) &&
-                cfdata->current_act_selector >= 0)
+            if (cfdata && cfdata->current_act && cfdata->current_act_selector 
>= 0)
               {
                  Evas_List   *l, *l2, *l3;
                  int found;




-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to