Enlightenment CVS committal Author : jethomas Project : e17 Module : libs/ewl
Dir : e17/libs/ewl/src/lib Modified Files: ewl_filelist.c Log Message: Return the proper file when using tree view for the filelist. =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_filelist.c,v retrieving revision 1.53 retrieving revision 1.54 diff -u -3 -r1.53 -r1.54 --- ewl_filelist.c 13 Apr 2008 04:54:19 -0000 1.53 +++ ewl_filelist.c 13 Apr 2008 17:46:42 -0000 1.54 @@ -530,8 +530,8 @@ if (!ewl_mvc_selected_count_get(EWL_MVC(fl->controller))) DRETURN_PTR(NULL, DLEVEL_STABLE); - data = ewl_mvc_data_get(EWL_MVC(fl->controller)); idx = ewl_mvc_selected_get(EWL_MVC(fl->controller)); + data = EWL_SELECTION(idx)->data; if (idx->row < data->num_dirs) file = ecore_list_index_goto(data->dirs, idx->row); else @@ -543,9 +543,7 @@ if (!file) { - /* Get this error now using tree view of filelist, when - * selecting a file too far down in an expansion - */ + /* This should be fixed now */ DWARNING("MVC has selected file, but cannot find the data!"); DRETURN_PTR(NULL, DLEVEL_STABLE); } @@ -926,11 +924,11 @@ ret = ecore_list_new(); - data = ewl_mvc_data_get(EWL_MVC(fl->controller)); selected = ewl_mvc_selected_list_get(EWL_MVC(fl->controller)); ecore_list_first_goto(selected); while ((sel = ecore_list_next(selected))) { + data = sel->data; /* If using Index instead of range */ if (sel->type == EWL_SELECTION_TYPE_INDEX) { @@ -944,6 +942,14 @@ file = ecore_list_index_goto(data->files, (idx->row - data->num_dirs)); + if (!file) + { + /* This should be fixed now */ + DWARNING("MVC has selected file, but cannot " + "find the data!"); + continue; + } + if (!strcmp(file->name, "..")) snprintf(path, PATH_MAX, "%s", data->name); @@ -973,6 +979,14 @@ else file = ecore_list_index_goto(data->files, (i - data->num_dirs)); + + if (!file) + { + /* This should be fixed now */ + DWARNING("MVC has selected file, but " + "cannot find the data!"); + continue; + } if (!strcmp(file->name, "..")) snprintf(path, PATH_MAX, "%s", data->name); ------------------------------------------------------------------------- This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs