Enlightenment CVS committal Author : onefang Project : e17 Module : apps/e
Dir : e17/apps/e/src/bin Modified Files: e_apps.c e_main.c Log Message: More cache tweaking. The next step is to add the next major peice of the cache puzzle. =================================================================== RCS file: /cvs/e/e17/apps/e/src/bin/e_apps.c,v retrieving revision 1.204 retrieving revision 1.205 diff -u -3 -r1.204 -r1.205 --- e_apps.c 29 Sep 2006 14:46:55 -0000 1.204 +++ e_apps.c 30 Sep 2006 04:49:30 -0000 1.205 @@ -57,7 +57,6 @@ static void _e_app_resolve_file_name(char *buf, size_t size, const char *path, const char *file); /* local subsystem globals */ -static Evas_List *_e_apps_list = NULL; static int _e_apps_callbacks_walking = 0; static int _e_apps_callbacks_delete_me = 0; static Evas_List *_e_apps_change_callbacks = NULL; @@ -152,11 +151,6 @@ _e_apps_all = e_app_new(_e_apps_path_all, 0); evas_hash_foreach(_e_apps_every_app, _e_apps_hash_cb_init, NULL); printf("INITIAL APP SCAN %3.3f\n", ecore_time_get() - begin); -#if NO_APP_LIST - /* The list already exists, and it doesn't care what order it is in. */ - if (_e_apps_all) - _e_apps_list = _e_apps_all->subapps; -#endif ecore_desktop_instrumentation_print(); return 1; } @@ -168,10 +162,10 @@ a = data; /* Link it in to all if needed. */ - if ((!a->parent) && (_e_apps_all) && (a != _e_apps_all) && (strncmp(a->path, _e_apps_path_all, strlen(_e_apps_path_all)) == 0)) + if ((!a->parent) && (_e_apps_all) && (a != _e_apps_all) /*&& (strncmp(a->path, _e_apps_path_all, strlen(_e_apps_path_all)) == 0)*/) { a->parent = _e_apps_all; - _e_apps_all->subapps = evas_list_append(_e_apps_all->subapps, a); + _e_apps_all->subapps = evas_list_prepend(_e_apps_all->subapps, a); e_object_ref(E_OBJECT(a)); } return 1; @@ -206,7 +200,7 @@ evas_stringshare_del(_e_apps_path_all); { Evas_List *l; - for (l = _e_apps_list; l; l = l->next) + for (l = _e_apps_all->subapps; l; l = l->next) { E_App *a; a = l->data; @@ -224,7 +218,7 @@ { Evas_List *l; - for (l = _e_apps_list; l; l = l->next) + for (l = _e_apps_all->subapps; l; l = l->next) { E_App *a; @@ -258,6 +252,17 @@ if (!path) return NULL; a = e_app_path_find(path); + /* Is it a virtual path from inside a .order file? */ + if ((!a) && (!ecore_file_exists(path))) + { + snprintf(buf, sizeof(buf), "%s/%s", _e_apps_path_all, ecore_file_get_file(path)); + if (ecore_file_exists(path)) + { + path = buf; + a = e_app_path_find(path); + } + } + /* Check if the cache is still valid. */ if (a) { @@ -303,7 +308,7 @@ { if (!a->filled) e_app_fields_fill(a, a->path); -// _e_apps_hash_cb_init(_e_apps_every_app, a->path, a, NULL); + _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)) @@ -318,9 +323,11 @@ a->mtime = st.st_mtime; stated = 1; } -#if ! NO_APP_LIST - _e_apps_list = evas_list_prepend(_e_apps_list, a); -#endif + if ((_e_apps_all) && (_e_apps_all->subapps)) + { + _e_apps_all->subapps = evas_list_remove(_e_apps_all->subapps, a); + _e_apps_all->subapps = evas_list_prepend(_e_apps_all->subapps, a); + } } else goto error; @@ -380,7 +387,6 @@ while (current) { -printf("e_app_is_parent(%s, %s) - %s\n", parent->path, app->path, current->path); if (current == parent) return 1; current = current->parent; @@ -462,7 +468,7 @@ e_object_ref(E_OBJECT(a3)); a2->references = evas_list_append(a2->references, a3); #if ! NO_APP_LIST - _e_apps_list = evas_list_prepend(_e_apps_list, a3); + _e_apps_all->subapps = evas_list_prepend(_e_apps_all->subapps, a3); #endif } else @@ -537,6 +543,10 @@ inst->launch_id = launch_id; inst->launch_time = ecore_time_get(); inst->expire_timer = ecore_timer_add(10.0, _e_app_cb_expire_timer, inst); + + _e_apps_all->subapps = evas_list_remove(_e_apps_all->subapps, original); + _e_apps_all->subapps = evas_list_prepend(_e_apps_all->subapps, original); + original->instances = evas_list_append(original->instances, inst); _e_apps_start_pending = evas_list_append(_e_apps_start_pending, original); if (original->startup_notify) original->starting = 1; @@ -620,7 +630,7 @@ for (l2 = files; l2; l2 = l2->next) { char *file; - + file = l2->data; fprintf(f, "%s\n", ecore_file_get_file(file)); } @@ -938,15 +948,14 @@ { Evas_List *l, *ll; - for (l = _e_apps_list; l; l = l->next) + for (l = _e_apps_all->subapps; l; l = l->next) { E_App *a; a = l->data; E_OBJECT_CHECK_RETURN(a, NULL); E_OBJECT_TYPE_CHECK_RETURN(a, E_APP_TYPE, NULL); - if (!a->filled) - e_app_fields_fill(a, a->path); + /* No need to fill up unfilled E_Apps during this scan. */ for (ll = a->instances; ll; ll = ll->next) { E_App_Instance *ai; @@ -955,9 +964,8 @@ if (((launch_id > 0) && (ai->launch_id > 0) && (ai->launch_id == launch_id)) || ((pid > 1) && (ai->exe) && (ecore_exe_pid_get(ai->exe) == pid))) { - _e_apps_list = evas_list_remove_list(_e_apps_list, l); - _e_apps_list = evas_list_prepend(_e_apps_list, a); -printf("e_app_launch_id_pid_find() - FOUND - %s\n", a->path); + _e_apps_all->subapps = evas_list_remove_list(_e_apps_all->subapps, l); + _e_apps_all->subapps = evas_list_prepend(_e_apps_all->subapps, a); return a; } } @@ -980,13 +988,17 @@ title = bd->client.netwm.name; if (!title) title = bd->client.icccm.title; - for (l = _e_apps_list; l; l = l->next) + for (l = _e_apps_all->subapps; l; l = l->next) { a = l->data; E_OBJECT_CHECK_RETURN(a, NULL); E_OBJECT_TYPE_CHECK_RETURN(a, E_APP_TYPE, NULL); - if (!a->filled) - e_app_fields_fill(a, a->path); + /* No need to fill up unfilled E_Apps during this scan, + * although this might fail for apps started without E's help. + * That gets fixed when the next cache code is implemented. + */ +// if (!a->filled) +// e_app_fields_fill(a, a->path); ok = 0; if ((a->win_name) || (a->win_class) || (a->win_title) || (a->win_role) || (a->exe)) { @@ -1039,9 +1051,8 @@ } if ((a_match) && (l_match)) { -printf("e_app_border_find() - FOUND - %s\n", a_match->path); - _e_apps_list = evas_list_remove_list(_e_apps_list, l_match); - _e_apps_list = evas_list_prepend(_e_apps_list, a_match); + _e_apps_all->subapps = evas_list_remove_list(_e_apps_all->subapps, l_match); + _e_apps_all->subapps = evas_list_prepend(_e_apps_all->subapps, a_match); } return a_match; } @@ -1053,7 +1064,7 @@ if (!file) return NULL; - for (l = _e_apps_list; l; l = l->next) + for (l = _e_apps_all->subapps; l; l = l->next) { E_App *a; @@ -1070,8 +1081,8 @@ p++; if (!strcmp(p, file)) { - _e_apps_list = evas_list_remove_list(_e_apps_list, l); - _e_apps_list = evas_list_prepend(_e_apps_list, a); + _e_apps_all->subapps = evas_list_remove_list(_e_apps_all->subapps, l); + _e_apps_all->subapps = evas_list_prepend(_e_apps_all->subapps, a); return a; } } @@ -1097,7 +1108,7 @@ if (!name) return NULL; - for (l = _e_apps_list; l; l = l->next) + for (l = _e_apps_all->subapps; l; l = l->next) { E_App *a; @@ -1110,8 +1121,8 @@ { if (!strcasecmp(a->name, name)) { - _e_apps_list = evas_list_remove_list(_e_apps_list, l); - _e_apps_list = evas_list_prepend(_e_apps_list, a); + _e_apps_all->subapps = evas_list_remove_list(_e_apps_all->subapps, l); + _e_apps_all->subapps = evas_list_prepend(_e_apps_all->subapps, a); return a; } } @@ -1126,7 +1137,7 @@ if (!generic) return NULL; - for (l = _e_apps_list; l; l = l->next) + for (l = _e_apps_all->subapps; l; l = l->next) { E_App *a; @@ -1139,8 +1150,8 @@ { if (!strcasecmp(a->generic, generic)) { - _e_apps_list = evas_list_remove_list(_e_apps_list, l); - _e_apps_list = evas_list_prepend(_e_apps_list, a); + _e_apps_all->subapps = evas_list_remove_list(_e_apps_all->subapps, l); + _e_apps_all->subapps = evas_list_prepend(_e_apps_all->subapps, a); return a; } } @@ -1155,7 +1166,7 @@ if (!exe) return NULL; - for (l = _e_apps_list; l; l = l->next) + for (l = _e_apps_all->subapps; l; l = l->next) { E_App *a; @@ -1168,8 +1179,8 @@ { if (!strcmp(a->exe, exe)) { - _e_apps_list = evas_list_remove_list(_e_apps_list, l); - _e_apps_list = evas_list_prepend(_e_apps_list, a); + _e_apps_all->subapps = evas_list_remove_list(_e_apps_all->subapps, l); + _e_apps_all->subapps = evas_list_prepend(_e_apps_all->subapps, a); return a; } } @@ -1186,7 +1197,7 @@ if (!name) return NULL; - for (l = _e_apps_list; l; l = l->next) + for (l = _e_apps_all->subapps; l; l = l->next) { E_App *a; @@ -1211,7 +1222,7 @@ if (!generic) return NULL; - for (l = _e_apps_list; l; l = l->next) + for (l = _e_apps_all->subapps; l; l = l->next) { E_App *a; @@ -1236,7 +1247,7 @@ if (!exe) return NULL; - for (l = _e_apps_list; l; l = l->next) + for (l = _e_apps_all->subapps; l; l = l->next) { E_App *a; @@ -1261,7 +1272,7 @@ if (!comment) return NULL; - for (l = _e_apps_list; l; l = l->next) + for (l = _e_apps_all->subapps; l; l = l->next) { E_App *a; @@ -2057,9 +2068,6 @@ a->parent->subapps = evas_list_remove(a->parent->subapps, a); } a->orig->references = evas_list_remove(a->orig->references, a); -#if ! NO_APP_LIST - _e_apps_list = evas_list_remove(_e_apps_list, a); -#endif e_object_unref(E_OBJECT(a->orig)); free(a); } @@ -2111,9 +2119,6 @@ a->parent->subapps = evas_list_remove(a->parent->subapps, a); if (a->monitor) ecore_file_monitor_del(a->monitor); -#if ! NO_APP_LIST - _e_apps_list = evas_list_remove(_e_apps_list, a); -#endif e_app_fields_empty(a); if (a->path) { @@ -2418,7 +2423,7 @@ e_object_ref(E_OBJECT(a3)); a2->references = evas_list_append(a2->references, a3); #if ! NO_APP_LIST - _e_apps_list = evas_list_prepend(_e_apps_list, a3); + _e_apps_all->subapps = evas_list_prepend(_e_apps_all->subapps, a3); #endif } else @@ -2750,7 +2755,7 @@ { Evas_List *l; - for (l = _e_apps_list; l; l = l->next) + for (l = _e_apps_all->subapps; l; l = l->next) { E_App *a; =================================================================== RCS file: /cvs/e/e17/apps/e/src/bin/e_main.c,v retrieving revision 1.189 retrieving revision 1.190 diff -u -3 -r1.189 -r1.190 --- e_main.c 22 Sep 2006 19:55:11 -0000 1.189 +++ e_main.c 30 Sep 2006 04:49:31 -0000 1.190 @@ -53,7 +53,7 @@ char buf[PATH_MAX]; char *s; struct sigaction action; - double t, tstart; + double t, tstart, begin; /* trap deadly bug signals and allow some form of sane recovery */ /* or ability to gdb attach and debug at this point - better than your */ /* wm/desktop vanishing and not knowing what happened */ @@ -370,6 +370,7 @@ _e_main_shutdown_push(ecore_ipc_shutdown); /* init FDO desktop */ + begin = ecore_time_get(); if (!ecore_desktop_init()) { e_error_message_show(_("Enlightenment cannot initialize the FDO desktop system.\n" @@ -383,6 +384,8 @@ snprintf(buf, sizeof(buf), "%s/data/icons", e_prefix_data_get()); ecore_desktop_paths_append_system(ECORE_DESKTOP_PATHS_ICONS, buf); ecore_desktop_paths_regen(); + + printf("SETUP FDO %3.3f\n", ecore_time_get() - begin); /* init the evas wrapper */ if (!ecore_evas_init()) ------------------------------------------------------------------------- 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