Enlightenment CVS committal Author : onefang Project : e17 Module : apps/e
Dir : e17/apps/e/src/bin Modified Files: e_apps.c Log Message: *Only put the E_App in the hash after it has passed all tests. Thanks to metrics for helping to debug this. *It's not a white space argument between raster and I, it's an arguement between our respective editors. His is the only editor that can handle odd number of spaces indentation, mine keeps trying to convert it to 4 or 8 character tabs. Sorry for the noisy white space stuff in this commit. =================================================================== RCS file: /cvs/e/e17/apps/e/src/bin/e_apps.c,v retrieving revision 1.208 retrieving revision 1.209 diff -u -3 -r1.208 -r1.209 --- e_apps.c 30 Sep 2006 10:16:23 -0000 1.208 +++ e_apps.c 30 Sep 2006 16:59:17 -0000 1.209 @@ -320,6 +320,7 @@ E_App *a; struct stat st; int stated = 0; + int new_app = 0; char buf[PATH_MAX]; if (!path) return NULL; @@ -350,52 +351,54 @@ if ((!a) && (ecore_file_exists(path))) { - /* Create it and add it to the cache. */ + /* Create it. */ a = e_app_empty_new(path); - if (a) - _e_apps_every_app = evas_hash_direct_add(_e_apps_every_app, a->path, a); + new_app = 1; } if ((a) && (a->path)) - { - if (ecore_file_is_dir(a->path)) - { - if (!a->filled) - { - snprintf(buf, sizeof(buf), "%s/.directory.eap", path); - if (ecore_file_exists(buf)) - e_app_fields_fill(a, buf); - else - { - a->name = evas_stringshare_add(ecore_file_get_file(a->path)); - a->filled = 1; - } - } - if (!a->filled) goto error; - if (scan_subdirs) - { - if (stated) - _e_app_subdir_rescan(a); - else - e_app_subdir_scan(a, scan_subdirs); - } - - /* Don't monitor the all directory, all changes to that must go through e_app. */ - if ((!stated) && (strcmp(_e_apps_path_all, a->path) != 0)) - a->monitor = ecore_file_monitor_add(a->path, _e_app_cb_monitor, a); - } - else if (_e_app_is_eapp(a->path)) - { - if (!a->filled) - e_app_fields_fill(a, a->path); - _e_apps_hash_cb_init(_e_apps_every_app, a->path, a, NULL); - + { + if (ecore_file_is_dir(a->path)) + { + if (!a->filled) + { + snprintf(buf, sizeof(buf), "%s/.directory.eap", path); + if (ecore_file_exists(buf)) + e_app_fields_fill(a, buf); + else + { + a->name = evas_stringshare_add(ecore_file_get_file(a->path)); + a->filled = 1; + } + } + if (!a->filled) goto error; + if (scan_subdirs) + { + if (stated) + _e_app_subdir_rescan(a); + else + e_app_subdir_scan(a, scan_subdirs); + } + + /* Don't monitor the all directory, all changes to that must go through e_app. */ + if ((!stated) && (strcmp(_e_apps_path_all, a->path) != 0)) + a->monitor = ecore_file_monitor_add(a->path, _e_app_cb_monitor, a); + } + else if (_e_app_is_eapp(a->path)) + { + if (!a->filled) + e_app_fields_fill(a, a->path); + _e_apps_hash_cb_init(_e_apps_every_app, a->path, a, NULL); + /* no exe field.. not valid. drop it */ // if (!_e_app_exe_valid_get(a->exe)) // goto error; } else goto error; + + if (new_app) + _e_apps_every_app = evas_hash_direct_add(_e_apps_every_app, a->path, a); /* Timestamp the cache, and no need to stat the file twice if the cache was stale. */ if ((stated) || (stat(a->path, &st) >= 0)) ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs