It should work now.

SVN revision: 14255
This commit is contained in:
sebastid 2005-04-20 07:28:37 +00:00 committed by sebastid
parent acd4137ae6
commit 225faedf25
1 changed files with 127 additions and 94 deletions

View File

@ -107,10 +107,7 @@ e_app_new(const char *path, int scan_subdirs)
if (a)
{
if (a->deleted)
{
printf("BUG E_App: Deleted flag shouldn't be needed: %s\n", a->path);
return NULL;
}
e_object_ref(E_OBJECT(a));
return a;
}
@ -162,9 +159,16 @@ int
e_app_is_parent(E_App *parent, E_App *app)
{
Evas_List *l;
E_App *current;
if (app->parent == parent)
current = app->parent;
while (current)
{
if (current == parent)
return 1;
current = current->parent;
}
#if 0
for (l = app->references; l; l = l->next)
@ -200,6 +204,8 @@ e_app_subdir_scan(E_App *a, int scan_subdirs)
}
a->scanned = 1;
files = _e_app_dir_file_list_get(a);
if (files)
{
while ((s = ecore_list_next(files)))
{
E_App *a2;
@ -230,18 +236,19 @@ e_app_subdir_scan(E_App *a, int scan_subdirs)
}
if (a2)
{
a2->references = evas_list_append(a2->references, a);
a3 = _e_app_copy(a2);
if (a3)
{
a3->parent = a;
a->subapps = evas_list_append(a->subapps, a3);
a2->references = evas_list_append(a2->references, a3);
}
}
}
free(s);
}
ecore_list_destroy(files);
}
}
int
@ -367,7 +374,7 @@ _e_app_free(E_App *a)
ecore_exe_free(exe);
a->instances = evas_list_remove_list(a->instances, a->instances);
}
/* If this is a copy, it shoudln't have any references! */
/* If this is a copy, it shouldn't have any references! */
if (a->references)
printf("BUG: A eapp copy shouldn't have any references!\n");
if (a->parent)
@ -401,7 +408,9 @@ _e_app_free(E_App *a)
/* If this is an original, it wont be deleted until all references
* are gone */
if (a->references)
printf("BUG: An original eapp shouldn't have any references when freed!\n");
{
printf("BUG: An original eapp shouldn't have any references when freed! %d\n", evas_list_count(a->references));
}
if (a->parent)
a->parent->subapps = evas_list_remove(a->parent->subapps, a);
@ -591,6 +600,8 @@ _e_app_dir_file_list_get(E_App *a)
len--;
}
if (len > 0)
{
if (files)
{
ecore_list_goto_first(files);
while ((file = ecore_list_current(files)))
@ -603,6 +614,7 @@ _e_app_dir_file_list_get(E_App *a)
}
ecore_list_next(files);
}
}
ecore_list_append(files2, strdup(buf));
}
}
@ -627,6 +639,7 @@ _e_app_dir_file_list_get(E_App *a)
ecore_list_destroy(files);
}
files = files2;
if (files)
ecore_list_goto_first(files);
return files;
}
@ -712,7 +725,13 @@ _e_app_cb_monitor(void *data, Ecore_File_Monitor *em,
char *file;
app = data;
printf("Event: %d %s %s\n", event, path, app->path);
if ((!app) || (app->deleted))
{
printf("Event on a deleted eapp\n");
return;
}
printf("Event: %d %s\n", event, path);
/* If this dir isn't scanned yet, no need to report changes! */
if (!app->scanned)
@ -786,7 +805,8 @@ _e_app_cb_monitor(void *data, Ecore_File_Monitor *em,
E_App *a2;
a2 = l->data;
_e_app_subdir_rescan(a2);
if (a2->parent)
_e_app_subdir_rescan(a2->parent);
}
_e_app_subdir_rescan(app);
}
@ -801,10 +821,18 @@ _e_app_cb_monitor(void *data, Ecore_File_Monitor *em,
E_App *a2;
a2 = l->data;
_e_app_subdir_rescan(a2);
if (a2->parent)
_e_app_subdir_rescan(a2->parent);
}
if (app->parent)
_e_app_subdir_rescan(app->parent);
else
{
/* A main e_app has been deleted!
* We don't unref this, the code which holds this
* eapp must do it. */
_e_app_change(app, E_APP_DEL);
}
}
}
}
@ -819,6 +847,8 @@ _e_app_subdir_rescan(E_App *app)
char *s;
files = _e_app_dir_file_list_get(app);
if (files)
{
while ((s = ecore_list_next(files)))
{
E_App *a2;
@ -859,7 +889,6 @@ _e_app_subdir_rescan(E_App *app)
}
if (a2)
{
a2->references = evas_list_append(a2->references, app);
a3 = _e_app_copy(a2);
if (a3)
{
@ -871,6 +900,7 @@ _e_app_subdir_rescan(E_App *app)
changes = evas_list_append(changes, ch);
subapps = evas_list_append(subapps, a3);
a2->references = evas_list_append(a2->references, a3);
}
}
}
@ -878,6 +908,7 @@ _e_app_subdir_rescan(E_App *app)
free(s);
}
ecore_list_destroy(files);
}
for (l = app->subapps; l; l = l->next)
{
E_App *a2;
@ -906,12 +937,14 @@ _e_app_subdir_rescan(E_App *app)
/* FIXME: We only need to tell about order changes if there are! */
evas_list_free(app->subapps);
app->subapps = subapps;
#if 0
for (l = subapps; l; l = l->next)
{
E_App *a;
a = l->data;
printf("subapps: %s\n", a->path);
}
#endif
ch = calloc(1, sizeof(E_App_Change_Info));
ch->app = app;
ch->change = E_APP_ORDER;