forked from enlightenment/enlightenment
parent
acd4137ae6
commit
225faedf25
|
@ -107,10 +107,7 @@ e_app_new(const char *path, int scan_subdirs)
|
||||||
if (a)
|
if (a)
|
||||||
{
|
{
|
||||||
if (a->deleted)
|
if (a->deleted)
|
||||||
{
|
|
||||||
printf("BUG E_App: Deleted flag shouldn't be needed: %s\n", a->path);
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
|
||||||
e_object_ref(E_OBJECT(a));
|
e_object_ref(E_OBJECT(a));
|
||||||
return a;
|
return a;
|
||||||
}
|
}
|
||||||
|
@ -162,9 +159,16 @@ int
|
||||||
e_app_is_parent(E_App *parent, E_App *app)
|
e_app_is_parent(E_App *parent, E_App *app)
|
||||||
{
|
{
|
||||||
Evas_List *l;
|
Evas_List *l;
|
||||||
|
E_App *current;
|
||||||
|
|
||||||
if (app->parent == parent)
|
current = app->parent;
|
||||||
|
|
||||||
|
while (current)
|
||||||
|
{
|
||||||
|
if (current == parent)
|
||||||
return 1;
|
return 1;
|
||||||
|
current = current->parent;
|
||||||
|
}
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
for (l = app->references; l; l = l->next)
|
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;
|
a->scanned = 1;
|
||||||
files = _e_app_dir_file_list_get(a);
|
files = _e_app_dir_file_list_get(a);
|
||||||
|
if (files)
|
||||||
|
{
|
||||||
while ((s = ecore_list_next(files)))
|
while ((s = ecore_list_next(files)))
|
||||||
{
|
{
|
||||||
E_App *a2;
|
E_App *a2;
|
||||||
|
@ -230,12 +236,12 @@ e_app_subdir_scan(E_App *a, int scan_subdirs)
|
||||||
}
|
}
|
||||||
if (a2)
|
if (a2)
|
||||||
{
|
{
|
||||||
a2->references = evas_list_append(a2->references, a);
|
|
||||||
a3 = _e_app_copy(a2);
|
a3 = _e_app_copy(a2);
|
||||||
if (a3)
|
if (a3)
|
||||||
{
|
{
|
||||||
a3->parent = a;
|
a3->parent = a;
|
||||||
a->subapps = evas_list_append(a->subapps, a3);
|
a->subapps = evas_list_append(a->subapps, a3);
|
||||||
|
a2->references = evas_list_append(a2->references, a3);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -243,6 +249,7 @@ e_app_subdir_scan(E_App *a, int scan_subdirs)
|
||||||
}
|
}
|
||||||
ecore_list_destroy(files);
|
ecore_list_destroy(files);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
e_app_exec(E_App *a)
|
e_app_exec(E_App *a)
|
||||||
|
@ -367,7 +374,7 @@ _e_app_free(E_App *a)
|
||||||
ecore_exe_free(exe);
|
ecore_exe_free(exe);
|
||||||
a->instances = evas_list_remove_list(a->instances, a->instances);
|
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)
|
if (a->references)
|
||||||
printf("BUG: A eapp copy shouldn't have any references!\n");
|
printf("BUG: A eapp copy shouldn't have any references!\n");
|
||||||
if (a->parent)
|
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
|
/* If this is an original, it wont be deleted until all references
|
||||||
* are gone */
|
* are gone */
|
||||||
if (a->references)
|
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)
|
if (a->parent)
|
||||||
a->parent->subapps = evas_list_remove(a->parent->subapps, a);
|
a->parent->subapps = evas_list_remove(a->parent->subapps, a);
|
||||||
|
@ -591,6 +600,8 @@ _e_app_dir_file_list_get(E_App *a)
|
||||||
len--;
|
len--;
|
||||||
}
|
}
|
||||||
if (len > 0)
|
if (len > 0)
|
||||||
|
{
|
||||||
|
if (files)
|
||||||
{
|
{
|
||||||
ecore_list_goto_first(files);
|
ecore_list_goto_first(files);
|
||||||
while ((file = ecore_list_current(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_next(files);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
ecore_list_append(files2, strdup(buf));
|
ecore_list_append(files2, strdup(buf));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -627,6 +639,7 @@ _e_app_dir_file_list_get(E_App *a)
|
||||||
ecore_list_destroy(files);
|
ecore_list_destroy(files);
|
||||||
}
|
}
|
||||||
files = files2;
|
files = files2;
|
||||||
|
if (files)
|
||||||
ecore_list_goto_first(files);
|
ecore_list_goto_first(files);
|
||||||
return files;
|
return files;
|
||||||
}
|
}
|
||||||
|
@ -712,7 +725,13 @@ _e_app_cb_monitor(void *data, Ecore_File_Monitor *em,
|
||||||
char *file;
|
char *file;
|
||||||
|
|
||||||
app = data;
|
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 this dir isn't scanned yet, no need to report changes! */
|
||||||
if (!app->scanned)
|
if (!app->scanned)
|
||||||
|
@ -786,7 +805,8 @@ _e_app_cb_monitor(void *data, Ecore_File_Monitor *em,
|
||||||
E_App *a2;
|
E_App *a2;
|
||||||
|
|
||||||
a2 = l->data;
|
a2 = l->data;
|
||||||
_e_app_subdir_rescan(a2);
|
if (a2->parent)
|
||||||
|
_e_app_subdir_rescan(a2->parent);
|
||||||
}
|
}
|
||||||
_e_app_subdir_rescan(app);
|
_e_app_subdir_rescan(app);
|
||||||
}
|
}
|
||||||
|
@ -801,10 +821,18 @@ _e_app_cb_monitor(void *data, Ecore_File_Monitor *em,
|
||||||
E_App *a2;
|
E_App *a2;
|
||||||
|
|
||||||
a2 = l->data;
|
a2 = l->data;
|
||||||
_e_app_subdir_rescan(a2);
|
if (a2->parent)
|
||||||
|
_e_app_subdir_rescan(a2->parent);
|
||||||
}
|
}
|
||||||
if (app->parent)
|
if (app->parent)
|
||||||
_e_app_subdir_rescan(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;
|
char *s;
|
||||||
|
|
||||||
files = _e_app_dir_file_list_get(app);
|
files = _e_app_dir_file_list_get(app);
|
||||||
|
if (files)
|
||||||
|
{
|
||||||
while ((s = ecore_list_next(files)))
|
while ((s = ecore_list_next(files)))
|
||||||
{
|
{
|
||||||
E_App *a2;
|
E_App *a2;
|
||||||
|
@ -859,7 +889,6 @@ _e_app_subdir_rescan(E_App *app)
|
||||||
}
|
}
|
||||||
if (a2)
|
if (a2)
|
||||||
{
|
{
|
||||||
a2->references = evas_list_append(a2->references, app);
|
|
||||||
a3 = _e_app_copy(a2);
|
a3 = _e_app_copy(a2);
|
||||||
if (a3)
|
if (a3)
|
||||||
{
|
{
|
||||||
|
@ -871,6 +900,7 @@ _e_app_subdir_rescan(E_App *app)
|
||||||
changes = evas_list_append(changes, ch);
|
changes = evas_list_append(changes, ch);
|
||||||
|
|
||||||
subapps = evas_list_append(subapps, a3);
|
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);
|
free(s);
|
||||||
}
|
}
|
||||||
ecore_list_destroy(files);
|
ecore_list_destroy(files);
|
||||||
|
}
|
||||||
for (l = app->subapps; l; l = l->next)
|
for (l = app->subapps; l; l = l->next)
|
||||||
{
|
{
|
||||||
E_App *a2;
|
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! */
|
/* FIXME: We only need to tell about order changes if there are! */
|
||||||
evas_list_free(app->subapps);
|
evas_list_free(app->subapps);
|
||||||
app->subapps = subapps;
|
app->subapps = subapps;
|
||||||
|
#if 0
|
||||||
for (l = subapps; l; l = l->next)
|
for (l = subapps; l; l = l->next)
|
||||||
{
|
{
|
||||||
E_App *a;
|
E_App *a;
|
||||||
a = l->data;
|
a = l->data;
|
||||||
printf("subapps: %s\n", a->path);
|
printf("subapps: %s\n", a->path);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
ch = calloc(1, sizeof(E_App_Change_Info));
|
ch = calloc(1, sizeof(E_App_Change_Info));
|
||||||
ch->app = app;
|
ch->app = app;
|
||||||
ch->change = E_APP_ORDER;
|
ch->change = E_APP_ORDER;
|
||||||
|
|
Loading…
Reference in New Issue