.order file saving.

SVN revision: 29064
This commit is contained in:
Sebastian Dransfeld 2007-03-24 23:41:24 +00:00
parent 8cc44f1675
commit b5085e0a19
1 changed files with 30 additions and 0 deletions

View File

@ -10,6 +10,7 @@
static void _e_order_free (E_Order *eo);
static void _e_order_cb_monitor (void *data, Ecore_File_Monitor *em, Ecore_File_Event event, const char *path);
static void _e_order_save (E_Order *eo);
EAPI E_Order *
e_order_new(const char *path)
@ -69,3 +70,32 @@ _e_order_cb_monitor(void *data, Ecore_File_Monitor *em, Ecore_File_Event event,
{
/* TODO */
}
static void
_e_order_save(E_Order *eo)
{
FILE *f;
Evas_List *l;
f = fopen(eo->path, "wb");
if (!f) return;
for (l = eo->desktops; l; l = l->next)
{
Efreet_Desktop *desktop;
char *id, *path;
/* TODO: This only allows us to save .desktop files which are in
* the default paths. If it isn't, we should copy it to the users
* application directory */
desktop = l->data;
path = efreet_util_path_in_default("applications", desktop->orig_path);
if (!path) continue;
id = efreet_util_path_to_file_id(path, desktop->orig_path);
fprintf(f, "%s\n", id);
free(id);
free(path);
}
fclose(f);
}