*Saving E_Apps forces new ones into ~/.e/e/applications/all, and adds

them to the _e_apps_all list directly.

* No monitoring of ~/.e/e/applications/all, it should all be taken care
of internally.


SVN revision: 25880
This commit is contained in:
David Walter Seikel 2006-09-16 12:09:29 +00:00
parent cdecc1f4aa
commit 6064d537f9
2 changed files with 26 additions and 5 deletions

View File

@ -192,6 +192,7 @@ e_app_unmonitor_all(void)
}
}
/* FIXME: Not actualy used anywhere, should we nuke it or should we use it everywhere that an E_App is allocated? */
EAPI E_App *
e_app_raw_new(void)
{
@ -248,7 +249,9 @@ e_app_new(const char *path, int scan_subdirs)
a->name = evas_stringshare_add(ecore_file_get_file(a->path));
if (scan_subdirs) e_app_subdir_scan(a, scan_subdirs);
a->monitor = ecore_file_monitor_add(a->path, _e_app_cb_monitor, a);
/* Don't monitor the all directory, all changes to that must go through e_app. */
if (strcmp(_e_apps_path_all, a->path) != 0)
a->monitor = ecore_file_monitor_add(a->path, _e_app_cb_monitor, a);
}
else if (_e_app_is_eapp(path))
{
@ -1312,6 +1315,7 @@ e_app_fields_save(E_App *a)
{
char buf[PATH_MAX];
const char *lang, *ext = NULL;
int new_eap = 0;
/* Check if it's a new one that has not been saved yet. */
if (a->path)
@ -1321,6 +1325,19 @@ e_app_fields_save(E_App *a)
snprintf(buf, sizeof(buf), "%s/%s.desktop", _e_apps_all->path, a->name);
a->path = evas_stringshare_add(buf);
}
if (!a->path) return;
/* This still lets old ones that are not in all to be saved, but new ones are forced to be in all. */
if (!ecore_file_exists(a->path))
{
/* Force it to be in all. */
snprintf(buf, sizeof(buf), "%s/%s", _e_apps_all->path, ecore_file_get_file(a->path));
a->path = evas_stringshare_add(buf);
}
if (!a->path) return;
if (!ecore_file_exists(a->path))
{
new_eap = 1;
}
ext = strrchr(a->path, '.');
if ((ext) && (strcmp(ext, ".desktop") == 0))
@ -1485,6 +1502,14 @@ e_app_fields_save(E_App *a)
}
_e_app_subdir_rescan(a->parent);
}
if (new_eap)
{
/* Careful, if this is being created from the border icon, this E_App is already part of the border. */
a->parent = _e_apps_all;
_e_apps_all->subapps = evas_list_append(_e_apps_all->subapps, a);
/* FIXME: Don't know if we need to copy and reference this since it is in the repository. */
_e_app_change(a, E_APP_ADD);
}
}
EAPI void

View File

@ -141,7 +141,6 @@ _e_eap_edit_fill_data(E_Config_Dialog_Data *cfdata)
cfdata->width = cfdata->editor->eap->width;
if (cfdata->image) cfdata->editor->img_set = 1;
IFADD(cfdata->editor->eap->path, cfdata->eap.path);
IFADD(cfdata->editor->eap->icon_class, cfdata->eap.icon_class);
IFDEL(cfdata->eap.icon_path);
@ -176,7 +175,6 @@ _e_eap_edit_free_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *data)
IFFREE(data->ipath);
IFFREE(data->image);
IFDEL(data->eap.path);
IFDEL(data->eap.icon_class);
IFDEL(data->eap.icon_path);
@ -522,12 +520,10 @@ _e_eap_edit_cb_icon_select_ok(void *data, E_Dialog *dia)
cfdata->editor->img_set = 1;
if (cfdata->editor->img) evas_object_del(cfdata->editor->img);
// IFDEL(cfdata->eap.path);
IFDEL(cfdata->eap.icon_class);
IFDEL(cfdata->eap.icon_path);
cfdata->eap.icon_path = evas_stringshare_add(cfdata->image);
// cfdata->eap.path = evas_stringshare_add("");
cfdata->eap.icon_class = NULL;
cfdata->editor->img = e_app_icon_add(cfdata->editor->evas, &(cfdata->eap));
#if 0