*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.


SVN revision: 26241
This commit is contained in:
David Walter Seikel 2006-09-30 16:59:17 +00:00
parent 9ff6bf18d4
commit 50bb66fe29
1 changed files with 39 additions and 36 deletions

View File

@ -320,6 +320,7 @@ e_app_new(const char *path, int scan_subdirs)
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 @@ e_app_new(const char *path, int scan_subdirs)
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))