From 2c403e3e62feff15b715ec2ef7f7436e472487a0 Mon Sep 17 00:00:00 2001 From: David Walter Seikel Date: Fri, 1 Sep 2006 09:26:55 +0000 Subject: [PATCH] Since raster added the ability for fm2 to delete from within .order files that are displayed as a virtual folder, there is no need for the all apps app deletion buttons and code. If you are still having issues with deleting apps, take it up with raster. SVN revision: 25274 --- src/bin/e_apps.c | 53 --------------------- src/bin/e_apps.h | 1 - src/bin/e_int_config_apps.c | 95 ------------------------------------- 3 files changed, 149 deletions(-) diff --git a/src/bin/e_apps.c b/src/bin/e_apps.c index 677eefbe1..70fe44b9a 100644 --- a/src/bin/e_apps.c +++ b/src/bin/e_apps.c @@ -812,59 +812,6 @@ e_app_remove(E_App *a) e_object_unref(E_OBJECT(a)); } - -EAPI void -e_app_remove_file_from_order(const char *order, const char *file) -{ - char buf[4096]; - Evas_List *list = NULL, *l; - int ret = 0; - FILE *f; - - snprintf(buf, sizeof(buf), "%s/.order", order); - if (!ecore_file_exists(buf)) return; - f = fopen(buf, "rb"); - if (!f) return; - - while (fgets(buf, sizeof(buf), f)) - { - int len; - - len = strlen(buf); - if (len > 0) - { - if (buf[len - 1] == '\n') - { - buf[len - 1] = 0; - len--; - } - if (strcmp(buf, file) != 0) - list = evas_list_append(list, strdup(buf)); - } - } - fclose(f); - - snprintf(buf, sizeof(buf), "%s/.order", order); - ecore_file_unlink(buf); - f = fopen(buf, "wb"); - if (!f) return; - for (l = list; l; l = l->next) - { - char *text; - - text = l->data; - fprintf(f, "%s\n", text); - free(text); - } - fclose(f); - evas_list_free(list); - - snprintf(buf, sizeof(buf), "%s/.eap.cache.cfg", order); - ecore_file_unlink(buf); - - return; -} - EAPI void e_app_change_callback_add(void (*func) (void *data, E_App *a, E_App_Change ch), void *data) { diff --git a/src/bin/e_apps.h b/src/bin/e_apps.h index 704872d2f..dc57318b2 100644 --- a/src/bin/e_apps.h +++ b/src/bin/e_apps.h @@ -112,7 +112,6 @@ EAPI void e_app_append (E_App *add, E_App *par EAPI void e_app_files_prepend_relative (Evas_List *files, E_App *before); EAPI void e_app_files_append (Evas_List *files, E_App *parent); EAPI void e_app_remove (E_App *a); -EAPI void e_app_remove_file_from_order (const char *order, const char *file); EAPI void e_app_change_callback_add (void (*func) (void *data, E_App *a, E_App_Change ch), void *data); EAPI void e_app_change_callback_del (void (*func) (void *data, E_App *a, E_App_Change ch), void *data); diff --git a/src/bin/e_int_config_apps.c b/src/bin/e_int_config_apps.c index 678cf2560..3b27323bd 100644 --- a/src/bin/e_int_config_apps.c +++ b/src/bin/e_int_config_apps.c @@ -243,91 +243,6 @@ _cb_files_add_edited(void *data, Evas_Object *obj, E_Menu *m, E_Fm2_Icon_Info *i e_menu_item_callback_set(mi, _cb_files_edited, cfdata); } -static void -_cb_button_delete_left(void *data1, void *data2) -{ - E_Config_Dialog_Data *cfdata; - Evas_List *l; - E_Fm2_Icon_Info *ici; - const char *realpath; - char buf[4096]; - - cfdata = data1; - if (!cfdata->gui.o_fm_all) return; - if (!cfdata->parent_all) return; - - l = e_fm2_selected_list_get(cfdata->gui.o_fm_all); - if (!l) return; - ici = l->data; - evas_list_free(l); - -#if 0 - /* This just isn't working, lets try the crude method instead. */ - for (l = cfdata->parent_all->subapps; l; l = l->next) - { - E_App *a2; - - a2 = l->data; - if ((a2->deleted) || ((a2->orig) && (a2->orig->deleted))) continue; - if (!strcmp(ecore_file_get_file(a2->path), ecore_file_get_file(ici->file))) - { - e_app_remove(a2); - e_fm2_refresh(cfdata->gui.o_fm_all); - break; - } - } -#else - realpath = e_fm2_real_path_get(cfdata->gui.o_fm_all); - if (!strcmp(realpath, "/")) - snprintf(buf, sizeof(buf), "/%s", ici->file); - else - snprintf(buf, sizeof(buf), "%s/%s", realpath, ici->file); - ecore_file_unlink(buf); - snprintf(buf, sizeof(buf), "%s/.eap.cache.cfg", realpath); - ecore_file_unlink(buf); - e_fm2_refresh(cfdata->gui.o_fm_all); -#endif -} - -static void -_cb_button_delete_right(void *data1, void *data2) -{ - E_Config_Dialog_Data *cfdata; - Evas_List *l; - E_Fm2_Icon_Info *ici; - const char *realpath; - - cfdata = data1; - if (!cfdata->gui.o_fm) return; - - l = e_fm2_selected_list_get(cfdata->gui.o_fm); - if (!l) return; - ici = l->data; - evas_list_free(l); - -#if 0 - /* This just isn't working, lets try the crude method instead. */ - if (!cfdata->parent) return; - for (l = cfdata->parent->subapps; l; l = l->next) - { - E_App *a2; - - a2 = l->data; - if ((a2->deleted) || ((a2->orig) && (a2->orig->deleted))) continue; - if (!strcmp(ecore_file_get_file(a2->path), ecore_file_get_file(ici->file))) - { - e_app_remove_from_order(a2); - e_fm2_refresh(cfdata->gui.o_fm); - break; - } - } -#else - realpath = e_fm2_real_path_get(cfdata->gui.o_fm); - e_app_remove_file_from_order(realpath, ecore_file_get_file(ici->file)); - e_fm2_refresh(cfdata->gui.o_fm); -#endif -} - static void _cb_button_add(void *data1, void *data2) { @@ -462,11 +377,6 @@ _basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cf cfdata->gui.o_add_button = mt; e_widget_framelist_object_append(of, mt); - mt = e_widget_button_add(evas, _("Delete application"), "enlightenment/e", - _cb_button_delete_left, cfdata, NULL); - cfdata->gui.o_delete_left_button = mt; - e_widget_framelist_object_append(of, mt); - e_widget_table_object_append(ot, of, 0, 0, 2, 4, 1, 1, 1, 1); if (!once) @@ -513,11 +423,6 @@ _basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cf e_widget_min_size_set(ob, 150, 220); e_widget_framelist_object_append(of, ob); - mt = e_widget_button_add(evas, _("Remove application"), "enlightenment/e", - _cb_button_delete_right, cfdata, NULL); - cfdata->gui.o_delete_right_button = mt; - e_widget_framelist_object_append(of, mt); - mt = e_widget_button_add(evas, _("Regenerate \"All Applications\" Menu"), "enlightenment/e", _cb_button_regen, cfdata, NULL); cfdata->gui.o_regen_button = mt;