Enlightenment CVS committal Author : onefang Project : e17 Module : apps/e_utils
Dir : e17/apps/e_utils/src/bin/e17genmenu/src/bin Modified Files: fdo_menus.c global.c main.c menus.c parse.c Log Message: Put generated menus and converted menus into their own sub menu, and leave any pre existing menus as they are. This is for testing and comparison purposes, once things are solid, then top level menus will be generated instead. Convert fdo menus and generate menus from standard places by default, but don't generate fdo menus if a directory was specified, and allow only converting fdo menus mith the --fdo option. Add more standard places to generate menus from by default. Some other small things. =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e_utils/src/bin/e17genmenu/src/bin/fdo_menus.c,v retrieving revision 1.24 retrieving revision 1.25 diff -u -3 -r1.24 -r1.25 --- fdo_menus.c 4 Mar 2006 23:43:22 -0000 1.24 +++ fdo_menus.c 7 Mar 2006 19:52:37 -0000 1.25 @@ -140,20 +140,24 @@ { dumb_tree_foreach(menu_xml, 0, _fdo_menus_expand_default_dirs, &data); +#ifdef DEBUG convert_time += ecore_time_get() - begin; dumb_tree_dump(menu_xml, 0); printf("\n\n"); begin = ecore_time_get(); +#endif data.unallocated = FALSE; dumb_tree_foreach(menu_xml, 0, _fdo_menus_generate, &data); data.unallocated = TRUE; dumb_tree_foreach(menu_xml, 0, _fdo_menus_generate, &data); +#ifdef DEBUG convert_time += ecore_time_get() - begin; dumb_tree_dump(menu_xml, 0); printf("\n\n"); begin = ecore_time_get(); +#endif } } } @@ -832,7 +836,9 @@ sprintf(merge_path, "%s%s", unxml_data->path, string); legacy_data.path = merge_path; legacy_data.length = strlen(merge_path); +#ifdef DEBUG printf("<LEGACYDIR> - %s - %s\n", legacy_data.prefix, merge_path); +#endif fdo_paths_recursive_search(merge_path, NULL, _fdo_menus_legacy_menu_dir, _fdo_menus_legacy_menu, &legacy_data); legacy_data.menu[legacy_data.menu_length] = '>'; result = 1; @@ -1098,7 +1104,9 @@ /* Process the rules. */ if (generate_data.name[9] == (generate_data.unallocated ? 'O' : ' ')) { +#ifdef DEBUG printf("MAKING MENU - %s \t\t%s\n", generate_data.path, generate_data.name); +#endif for (i = 0; i < generate_data.rules->size; i++) { if (generate_data.rules->elements[i].type == DUMB_TREE_ELEMENT_TYPE_TREE) @@ -1166,12 +1174,16 @@ if (generate_data->include) { ecore_hash_set(generate_data->apps, key, strdup(app)); +#ifdef DEBUG printf("INCLUDING %s%s\n", ((generate_data->unallocated) ? "UNALLOCATED " : ""), key); +#endif } else { ecore_hash_remove(generate_data->apps, key); +#ifdef DEBUG printf("EXCLUDING %s%s\n", ((generate_data->unallocated) ? "UNALLOCATED " : ""), key); +#endif } } } =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e_utils/src/bin/e17genmenu/src/bin/global.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -3 -r1.9 -r1.10 --- global.c 22 Feb 2006 04:30:53 -0000 1.9 +++ global.c 7 Mar 2006 19:52:38 -0000 1.10 @@ -149,7 +149,7 @@ } } /* Doesn't this tie us specifically to KDE ? */ - return "crystalsvg"; + return "hicolor"; } int =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e_utils/src/bin/e17genmenu/src/bin/main.c,v retrieving revision 1.33 retrieving revision 1.34 diff -u -3 -r1.33 -r1.34 --- main.c 22 Feb 2006 20:25:14 -0000 1.33 +++ main.c 7 Mar 2006 19:52:38 -0000 1.34 @@ -132,7 +132,7 @@ printf(" -d=<dir> | --desktop-dir=<dir>\tCreate eaps for .desktop files in <dir>\n"); printf(" -o | --overwrite\tOverwrite Eaps\n"); printf(" -m | --mapping\tGenerate Mapping File\n"); - printf(" -f | --fdo\tGenerate menus from fdo files\n"); + printf(" -f | --fdo\tGenerate menus from freedesktop.org (fdo) files only\n"); printf(" -h | --help\t\tShow this help screen\n"); /* Stop E Stuff */ @@ -239,14 +239,26 @@ paths = ecore_time_get() - begin; parse_ini_init(); + /* Just being paranoid, and cause people have removed these during testing. */ + snprintf(path, sizeof(path), "%s/.e/e/applications/all", get_home()); + ecore_file_mkpath(path); + snprintf(path, sizeof(path), "%s/.e/e/applications/favorite", get_home()); + ecore_file_mkpath(path); + begin = ecore_time_get(); /* Start Making Menus */ make_menus(); gen = ecore_time_get() - begin; /* Sort Menus */ + /* FIXME: One or both of these get's it wrong, plus they don't seem to be needed anyway. sort_favorites(); sort_menus(); + * + * Currently I do this instead, it seems to work - + */ + snprintf(path, sizeof(path), "%s/.e/e/applications/favorite/.eap.cache.cfg", get_home()); + ecore_file_unlink(path); /* Update E Cache */ begin = ecore_time_get(); @@ -259,8 +271,7 @@ system(path); cache_time += ecore_time_get() - begin; - printf - ("\nTotal time %3.3f seconds, finding fdo paths %3.3f, converting fdo menus %3.3f, generating %d (rejected %d) eaps in %d menus %3.3f, finding icons %3.3f, generating eap caches %3.3f.\n", + printf("\nTotal time %3.3f seconds, finding fdo paths %3.3f, converting fdo menus %3.3f, generating %d (rejected %d) eaps in %d menus %3.3f, finding icons %3.3f, generating eap caches %3.3f.\n", ecore_time_get() - start, paths, convert_time, item_count, reject_count, menu_count, gen - icon_time, icon_time, cache_time); parse_ini_shutdown(); =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e_utils/src/bin/e17genmenu/src/bin/menus.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -3 -r1.14 -r1.15 --- menus.c 22 Feb 2006 13:22:45 -0000 1.14 +++ menus.c 7 Mar 2006 19:52:38 -0000 1.15 @@ -14,13 +14,32 @@ make_menus() { char *d; + char *menu = "applications.menu"; + char *menu_file; - if (get_fdo()) - { - char *menu = "applications.menu"; - char *menu_file; + d = get_desktop_dir(); + if ((d) && (!get_fdo())) + check_for_dirs(strdup(d)); + + if (!d) + { + if (!get_fdo()) + { + int i; + + printf("Generating menus.\n"); + /* Check desktop files in these directories */ + check_for_dirs(GNOME_DIRS); /* FIXME: probably obsolete. */ + check_for_dirs(KDE_DIRS); /* FIXME: probably obsolete. */ + check_for_dirs(DEBIAN_DIRS); /* FIXME: may or may not be obsolete. */ + for (i = 0; i < fdo_paths_desktops->size; i++) + check_for_dirs((char *)fdo_paths_desktops->elements[i].element); + for (i = 0; i < fdo_paths_kde_legacy->size; i++) + check_for_dirs((char *)fdo_paths_kde_legacy->elements[i].element); + } - /* First, find the main menu file. */ + printf("Converting freedesktop.org (fdo) menus.\n"); + /* Find the main menu file. */ menu_file = fdo_paths_search_for_file(FDO_PATHS_TYPE_MENU, menu, 1, NULL, NULL); if (menu_file) { @@ -41,23 +60,11 @@ } E_FREE(path); } - } - else - { - d = get_desktop_dir(); - if (d) - check_for_dirs(strdup(d)); - if (!d) - { - /* Check desktop files in these directories */ - check_for_dirs(GNOME_DIRS); - check_for_dirs(KDE_DIRS); - check_for_dirs(DEBIAN_DIRS); - } - if (d) - free(d); } + + if (d) + free(d); } void @@ -148,7 +155,9 @@ path = (char *)tree->elements[element + 1].element; pool = (Ecore_Hash *) tree->elements[element + 2].element; apps = (Ecore_Hash *) tree->elements[element + 4].element; +#ifdef DEBUG printf("MAKING MENU - %s \t\t%s\n", path, name); +#endif menu_count++; ecore_hash_for_each_node(apps, _menu_dump_each_hash_node, &path[11]); } @@ -165,7 +174,9 @@ path = (char *)user_data; node = (Ecore_Hash_Node *) value; file = (char *)node->value; +#ifdef DEBUG printf("MAKING EAP %s -> %s\n", path, file); +#endif item_count++; parse_desktop_file(strdup(file), path); } =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e_utils/src/bin/e17genmenu/src/bin/parse.c,v retrieving revision 1.20 retrieving revision 1.21 diff -u -3 -r1.20 -r1.21 --- parse.c 22 Feb 2006 04:30:53 -0000 1.20 +++ parse.c 7 Mar 2006 19:52:38 -0000 1.21 @@ -236,7 +236,7 @@ { if (menu_path != NULL) { - snprintf(order_path, sizeof(order_path), "%s" EFAVDIR "/%s", home, menu_path); + snprintf(order_path, sizeof(order_path), "%s" EFAVDIR "/Converted Menus/%s", home, menu_path); modify_order(order_path, eap->eap_name); } else @@ -247,7 +247,7 @@ category = find_category(eap->categories); if (category != NULL) { - snprintf(order_path, sizeof(order_path), "%s" EFAVDIR "/%s", home, category); + snprintf(order_path, sizeof(order_path), "%s" EFAVDIR "/Generated Menus/%s", home, category); modify_order(order_path, eap->eap_name); } } @@ -294,7 +294,7 @@ category = NULL; if (menu_path != NULL) { - snprintf(order_path, sizeof(order_path), "%s" EFAVDIR "/%s", home, menu_path); + snprintf(order_path, sizeof(order_path), "%s" EFAVDIR "/Converted Menus/%s", home, menu_path); modify_order(order_path, eap->eap_name); } else if (eap->categories != NULL) @@ -302,7 +302,7 @@ category = find_category(eap->categories); if (category != NULL) { - snprintf(order_path, sizeof(order_path), "%s" EFAVDIR "/%s", home, category); + snprintf(order_path, sizeof(order_path), "%s" EFAVDIR "/Generated Menus/%s", home, category); modify_order(order_path, eap->eap_name); } } ------------------------------------------------------- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs