2010-04-10 13:05:57 -07:00
|
|
|
/*
|
|
|
|
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "Evry.h"
|
2009-09-17 23:33:33 -07:00
|
|
|
#include "e_mod_main.h"
|
2010-04-25 09:26:13 -07:00
|
|
|
#include <Efreet_Trash.h>
|
2009-08-13 08:10:54 -07:00
|
|
|
|
2010-05-01 09:27:13 -07:00
|
|
|
#define MAX_ITEMS 10
|
2010-04-25 04:00:53 -07:00
|
|
|
#define MAX_SHOWN 300
|
2009-09-17 23:33:33 -07:00
|
|
|
#define TERM_ACTION_DIR "%s"
|
2009-08-10 04:36:37 -07:00
|
|
|
|
2010-04-25 04:00:53 -07:00
|
|
|
#define CMD_NONE 0
|
|
|
|
#define CMD_SHOW_ROOT 1
|
|
|
|
#define CMD_SHOW_HIDDEN 2
|
|
|
|
#define CMD_SHOW_PARENT 3
|
|
|
|
|
2010-04-29 08:20:12 -07:00
|
|
|
#define ACT_TRASH 1
|
|
|
|
#define ACT_DELETE 2
|
|
|
|
#define ACT_COPY 3
|
|
|
|
#define ACT_MOVE 4
|
|
|
|
|
2010-05-02 14:47:28 -07:00
|
|
|
#define ONE_DAY 86400.0
|
|
|
|
#define SIX_DAYS_AGO (ecore_time_get() - 518400.0)
|
2010-05-01 16:03:14 -07:00
|
|
|
#define TIME_FACTOR(_now) (1.0 - (evry_hist->begin / _now)) / 1000000000000000.0
|
2010-04-29 14:42:03 -07:00
|
|
|
|
2010-05-02 08:46:02 -07:00
|
|
|
/* #undef DBG
|
|
|
|
* #define DBG(...) ERR(__VA_ARGS__) */
|
|
|
|
|
2009-08-21 15:42:06 -07:00
|
|
|
typedef struct _Plugin Plugin;
|
2009-08-27 15:58:34 -07:00
|
|
|
typedef struct _Data Data;
|
2010-04-20 10:48:21 -07:00
|
|
|
typedef struct _Module_Config Module_Config;
|
2009-06-21 03:31:38 -07:00
|
|
|
|
2009-08-21 15:42:06 -07:00
|
|
|
struct _Plugin
|
2009-06-21 03:31:38 -07:00
|
|
|
{
|
2009-08-21 15:42:06 -07:00
|
|
|
Evry_Plugin base;
|
|
|
|
|
2010-04-16 11:36:28 -07:00
|
|
|
Eina_List *files;
|
2009-06-21 03:31:38 -07:00
|
|
|
const char *directory;
|
2010-04-16 11:36:28 -07:00
|
|
|
const char *input;
|
2010-04-29 14:42:03 -07:00
|
|
|
unsigned int command;
|
2010-04-15 06:58:44 -07:00
|
|
|
Eina_Bool parent;
|
2010-04-20 10:48:21 -07:00
|
|
|
Eina_List *hist_added;
|
2010-04-25 04:00:53 -07:00
|
|
|
Eina_Bool show_hidden;
|
2010-04-29 14:42:03 -07:00
|
|
|
Eina_Bool dirs_only;
|
|
|
|
Eina_Bool show_recent;
|
2010-04-26 11:21:09 -07:00
|
|
|
|
2010-04-08 15:37:50 -07:00
|
|
|
Ecore_Thread *thread;
|
2010-04-25 12:37:30 -07:00
|
|
|
Ecore_Thread *thread2;
|
2010-04-25 09:26:13 -07:00
|
|
|
Ecore_File_Monitor *dir_mon;
|
2010-04-26 11:21:09 -07:00
|
|
|
int cleanup;
|
2009-08-27 15:58:34 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
struct _Data
|
|
|
|
{
|
|
|
|
Plugin *plugin;
|
2010-04-26 11:21:09 -07:00
|
|
|
char *directory;
|
2009-08-27 15:58:34 -07:00
|
|
|
long id;
|
|
|
|
int level;
|
|
|
|
int cnt;
|
|
|
|
Eina_List *files;
|
2010-04-16 07:15:30 -07:00
|
|
|
Eina_List *list;
|
2010-04-25 04:00:53 -07:00
|
|
|
DIR *dirp;
|
2010-05-01 09:27:13 -07:00
|
|
|
int run_cnt;
|
2009-06-21 03:31:38 -07:00
|
|
|
};
|
|
|
|
|
2010-04-20 10:48:21 -07:00
|
|
|
struct _Module_Config
|
|
|
|
{
|
|
|
|
int version;
|
|
|
|
|
|
|
|
unsigned char show_homedir;
|
|
|
|
unsigned char show_recent;
|
|
|
|
unsigned char search_recent;
|
2010-05-01 16:03:14 -07:00
|
|
|
unsigned char cache_dirs;
|
2010-05-01 18:09:49 -07:00
|
|
|
unsigned char search_cache;
|
2010-04-20 10:48:21 -07:00
|
|
|
|
|
|
|
// TODO
|
|
|
|
int sort_by;
|
|
|
|
Eina_List *search_dirs;
|
|
|
|
|
|
|
|
E_Config_Dialog *cfd;
|
|
|
|
E_Module *module;
|
|
|
|
};
|
|
|
|
|
|
|
|
static Module_Config *_conf;
|
2010-04-30 05:55:01 -07:00
|
|
|
static char _module_icon[] = "system-file-manager";
|
2009-08-27 19:25:13 -07:00
|
|
|
static Evry_Plugin *p1 = NULL;
|
|
|
|
static Evry_Plugin *p2 = NULL;
|
2010-04-25 12:37:30 -07:00
|
|
|
static Eina_List *_actions = NULL;
|
2010-04-30 05:55:01 -07:00
|
|
|
static const char *_mime_dir;
|
2010-05-01 16:03:14 -07:00
|
|
|
static Eina_Bool clear_cache = EINA_FALSE;
|
2009-06-21 03:31:38 -07:00
|
|
|
|
2010-04-15 06:58:44 -07:00
|
|
|
static void _cleanup(Evry_Plugin *plugin);
|
2010-05-01 18:57:52 -07:00
|
|
|
static Eina_Bool _hist_items_add_cb(const Eina_Hash *hash, const void *key, void *data, void *fdata);
|
2010-04-15 06:58:44 -07:00
|
|
|
|
2009-08-11 06:31:38 -07:00
|
|
|
static void
|
2009-08-22 20:12:05 -07:00
|
|
|
_item_fill(Evry_Item_File *file)
|
2009-08-11 06:31:38 -07:00
|
|
|
{
|
2009-08-17 18:00:18 -07:00
|
|
|
const char *mime;
|
2010-04-20 10:48:21 -07:00
|
|
|
|
2009-08-22 20:12:05 -07:00
|
|
|
if (file->mime) return;
|
2009-08-10 04:36:37 -07:00
|
|
|
|
2010-04-07 08:03:27 -07:00
|
|
|
if ((mime = efreet_mime_type_get(file->path)))
|
2009-08-11 06:31:38 -07:00
|
|
|
{
|
2009-08-22 20:12:05 -07:00
|
|
|
file->mime = eina_stringshare_add(mime);
|
2010-05-01 16:03:14 -07:00
|
|
|
|
2009-09-03 07:21:27 -07:00
|
|
|
EVRY_ITEM(file)->context = eina_stringshare_ref(file->mime);
|
2010-04-20 10:48:21 -07:00
|
|
|
|
2009-08-27 15:58:34 -07:00
|
|
|
if ((!strcmp(mime, "inode/directory")) ||
|
|
|
|
(!strcmp(mime, "inode/mount-point")))
|
|
|
|
EVRY_ITEM(file)->browseable = EINA_TRUE;
|
|
|
|
|
2009-08-17 20:15:36 -07:00
|
|
|
return;
|
2009-08-11 06:31:38 -07:00
|
|
|
}
|
2009-08-17 20:15:36 -07:00
|
|
|
|
2010-04-25 18:04:43 -07:00
|
|
|
file->mime = eina_stringshare_add("unknown");
|
2009-06-21 03:31:38 -07:00
|
|
|
}
|
|
|
|
|
2009-08-11 06:31:38 -07:00
|
|
|
static int
|
|
|
|
_cb_sort(const void *data1, const void *data2)
|
2009-06-21 03:31:38 -07:00
|
|
|
{
|
2009-08-14 07:44:18 -07:00
|
|
|
const Evry_Item *it1 = data1;
|
|
|
|
const Evry_Item *it2 = data2;
|
2009-08-11 06:31:38 -07:00
|
|
|
|
2009-08-14 07:44:18 -07:00
|
|
|
if (it1->browseable && !it2->browseable)
|
|
|
|
return -1;
|
2009-08-11 06:31:38 -07:00
|
|
|
|
2009-08-14 07:44:18 -07:00
|
|
|
if (!it1->browseable && it2->browseable)
|
|
|
|
return 1;
|
|
|
|
|
2009-08-25 20:12:00 -07:00
|
|
|
if (it1->fuzzy_match && it2->fuzzy_match)
|
|
|
|
if (it1->fuzzy_match - it2->fuzzy_match)
|
|
|
|
return (it1->fuzzy_match - it2->fuzzy_match);
|
2009-08-14 07:44:18 -07:00
|
|
|
|
|
|
|
return strcasecmp(it1->label, it2->label);
|
2009-08-11 06:31:38 -07:00
|
|
|
}
|
|
|
|
|
2009-08-22 20:12:05 -07:00
|
|
|
static void
|
|
|
|
_item_free(Evry_Item *it)
|
|
|
|
{
|
2010-04-27 20:22:40 -07:00
|
|
|
GET_FILE(file, it);
|
2010-04-29 08:20:12 -07:00
|
|
|
if (file->url) eina_stringshare_del(file->url);
|
2010-04-07 08:03:27 -07:00
|
|
|
if (file->path) eina_stringshare_del(file->path);
|
2009-08-22 20:12:05 -07:00
|
|
|
if (file->mime) eina_stringshare_del(file->mime);
|
|
|
|
|
|
|
|
E_FREE(file);
|
|
|
|
}
|
|
|
|
|
2009-08-12 12:14:45 -07:00
|
|
|
static void
|
2009-08-27 15:58:34 -07:00
|
|
|
_scan_func(void *data)
|
2009-06-21 03:31:38 -07:00
|
|
|
{
|
2009-08-27 15:58:34 -07:00
|
|
|
Data *d = data;
|
|
|
|
Plugin *p = d->plugin;
|
|
|
|
char *filename;
|
2010-04-25 04:00:53 -07:00
|
|
|
struct dirent *dp;
|
2009-08-22 20:12:05 -07:00
|
|
|
Evry_Item_File *file;
|
2009-08-27 15:58:34 -07:00
|
|
|
char buf[4096];
|
2010-04-29 14:42:03 -07:00
|
|
|
Eina_Bool is_dir;
|
2009-07-04 04:10:28 -07:00
|
|
|
|
2010-05-01 16:03:14 -07:00
|
|
|
d->dirp = opendir(d->directory);
|
|
|
|
if (!d->dirp) return;
|
|
|
|
|
|
|
|
while ((dp = readdir(d->dirp)))
|
2009-07-10 08:47:19 -07:00
|
|
|
{
|
2010-05-01 16:03:14 -07:00
|
|
|
if ((dp->d_name[0] == '.') &&
|
|
|
|
((dp->d_name[1] == '\0') ||
|
|
|
|
((dp->d_name[1] == '.') &&
|
|
|
|
(dp->d_name[2] == '\0'))))
|
|
|
|
continue;
|
2010-04-25 04:27:01 -07:00
|
|
|
|
2010-05-01 16:03:14 -07:00
|
|
|
#ifdef _DIRENT_HAVE_D_TYPE
|
|
|
|
if (dp->d_type == DT_FIFO ||
|
|
|
|
dp->d_type == DT_BLK ||
|
|
|
|
dp->d_type == DT_CHR ||
|
|
|
|
dp->d_type == DT_SOCK)
|
|
|
|
continue;
|
|
|
|
#endif
|
|
|
|
if (!p->show_hidden)
|
2009-08-12 05:17:43 -07:00
|
|
|
{
|
2010-05-01 16:03:14 -07:00
|
|
|
if (dp->d_name[0] == '.')
|
2010-04-25 04:00:53 -07:00
|
|
|
continue;
|
2010-05-01 16:03:14 -07:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (dp->d_name[0] != '.')
|
2010-04-25 04:00:53 -07:00
|
|
|
continue;
|
2010-05-01 16:03:14 -07:00
|
|
|
}
|
2010-04-25 04:27:01 -07:00
|
|
|
|
2010-05-01 16:03:14 -07:00
|
|
|
is_dir = EINA_FALSE;
|
2009-08-12 12:00:25 -07:00
|
|
|
|
2010-04-25 04:00:53 -07:00
|
|
|
#ifdef _DIRENT_HAVE_D_TYPE
|
2010-05-01 16:03:14 -07:00
|
|
|
if (dp->d_type & DT_UNKNOWN)
|
|
|
|
{
|
2010-04-26 11:21:09 -07:00
|
|
|
#endif
|
2010-05-01 16:03:14 -07:00
|
|
|
if (ecore_file_is_dir(file->path))
|
|
|
|
is_dir = EINA_TRUE;
|
2010-04-26 11:21:09 -07:00
|
|
|
|
|
|
|
#ifdef _DIRENT_HAVE_D_TYPE
|
2010-05-01 16:03:14 -07:00
|
|
|
}
|
|
|
|
else if (dp->d_type & DT_DIR)
|
|
|
|
{
|
|
|
|
is_dir = EINA_TRUE;
|
|
|
|
}
|
2010-04-26 11:21:09 -07:00
|
|
|
#endif
|
2010-04-29 14:42:03 -07:00
|
|
|
|
2010-05-01 16:03:14 -07:00
|
|
|
if (p->dirs_only && !is_dir)
|
|
|
|
continue;
|
2010-04-29 14:42:03 -07:00
|
|
|
|
2010-05-01 16:03:14 -07:00
|
|
|
file = EVRY_ITEM_NEW(Evry_Item_File, p, NULL, NULL, _item_free);
|
2010-04-29 14:42:03 -07:00
|
|
|
|
2010-05-01 16:03:14 -07:00
|
|
|
filename = strdup(dp->d_name);
|
|
|
|
EVRY_ITEM(file)->label = filename;
|
|
|
|
EVRY_ITEM(file)->browseable = is_dir;
|
|
|
|
d->files = eina_list_append(d->files, file);
|
2010-04-26 11:21:09 -07:00
|
|
|
|
2010-05-01 16:03:14 -07:00
|
|
|
snprintf(buf, sizeof(buf), "%s/%s", d->directory, filename);
|
|
|
|
file->path = strdup(buf);
|
2010-04-26 11:21:09 -07:00
|
|
|
}
|
2010-05-01 16:03:14 -07:00
|
|
|
closedir(d->dirp);
|
|
|
|
}
|
2010-04-26 11:21:09 -07:00
|
|
|
|
2010-05-01 16:03:14 -07:00
|
|
|
static void
|
|
|
|
_scan_mime_func(void *data)
|
|
|
|
{
|
|
|
|
Data *d = data;
|
|
|
|
Plugin *p = d->plugin;
|
|
|
|
Evry_Item_File *file;
|
|
|
|
Eina_List *l;
|
|
|
|
const char *mime;
|
|
|
|
int cnt = 0;
|
2010-04-26 11:21:09 -07:00
|
|
|
|
2010-05-01 16:03:14 -07:00
|
|
|
EINA_LIST_FOREACH(d->files, l, file)
|
|
|
|
{
|
2010-04-26 11:21:09 -07:00
|
|
|
if (!EVRY_ITEM(file)->browseable)
|
2010-04-16 07:15:30 -07:00
|
|
|
{
|
2010-04-25 04:00:53 -07:00
|
|
|
if ((mime = efreet_mime_type_get(file->path)))
|
|
|
|
{
|
|
|
|
file->mime = mime;
|
2010-04-26 11:21:09 -07:00
|
|
|
|
|
|
|
if (!strncmp(file->mime, "inode/", 6) &&
|
|
|
|
ecore_file_is_dir(file->path))
|
|
|
|
EVRY_ITEM(file)->browseable = EINA_TRUE;
|
2010-04-25 04:00:53 -07:00
|
|
|
}
|
2010-05-01 16:03:14 -07:00
|
|
|
else
|
|
|
|
{
|
|
|
|
file->mime = "unknown";
|
|
|
|
}
|
2010-04-16 07:15:30 -07:00
|
|
|
}
|
2010-05-01 16:03:14 -07:00
|
|
|
if (cnt++ > MAX_ITEMS * d->run_cnt) break;
|
2010-04-25 04:27:01 -07:00
|
|
|
}
|
2009-08-27 15:58:34 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
2010-04-25 18:04:43 -07:00
|
|
|
_append_files(Plugin *p)
|
2009-08-27 15:58:34 -07:00
|
|
|
{
|
|
|
|
int match;
|
2010-04-25 18:04:43 -07:00
|
|
|
int cnt = 0;
|
2010-05-02 13:40:21 -07:00
|
|
|
Evry_Item *it;
|
2010-04-25 18:04:43 -07:00
|
|
|
Eina_List *l;
|
2010-04-26 11:21:09 -07:00
|
|
|
|
2010-04-25 18:04:43 -07:00
|
|
|
EVRY_PLUGIN_ITEMS_CLEAR(p);
|
2010-04-26 11:21:09 -07:00
|
|
|
|
2010-05-02 13:40:21 -07:00
|
|
|
EINA_LIST_FOREACH(p->files, l, it)
|
2009-08-27 15:58:34 -07:00
|
|
|
{
|
2010-04-25 18:04:43 -07:00
|
|
|
if (cnt >= MAX_SHOWN) break;
|
2009-08-27 15:58:34 -07:00
|
|
|
|
2010-05-02 13:40:21 -07:00
|
|
|
if (p->dirs_only && !it->browseable)
|
2010-05-02 08:46:02 -07:00
|
|
|
continue;
|
|
|
|
|
2010-05-02 13:40:21 -07:00
|
|
|
if (p->input && (match = evry_fuzzy_match(it->label, p->input)))
|
2010-04-25 18:04:43 -07:00
|
|
|
{
|
2010-05-02 13:40:21 -07:00
|
|
|
it->fuzzy_match = match;
|
|
|
|
if (!it->browseable)
|
|
|
|
it->priority = 1;
|
|
|
|
EVRY_PLUGIN_ITEM_APPEND(p, it);
|
|
|
|
cnt++;
|
2010-04-25 18:04:43 -07:00
|
|
|
}
|
|
|
|
else if (!p->input)
|
|
|
|
{
|
2010-05-02 13:40:21 -07:00
|
|
|
if (!it->browseable)
|
|
|
|
it->priority = 1;
|
|
|
|
EVRY_PLUGIN_ITEM_APPEND(p, it);
|
|
|
|
cnt++;
|
2010-04-25 18:04:43 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return cnt;
|
2009-08-27 15:58:34 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2010-04-08 15:37:50 -07:00
|
|
|
_scan_cancel_func(void *data)
|
2009-08-27 15:58:34 -07:00
|
|
|
{
|
|
|
|
Data *d = data;
|
|
|
|
Plugin *p = d->plugin;
|
2010-04-08 15:37:50 -07:00
|
|
|
Evry_Item_File *file;
|
2010-05-01 16:03:14 -07:00
|
|
|
Evry_Item *item;
|
2010-04-20 10:48:21 -07:00
|
|
|
|
2010-05-01 18:57:52 -07:00
|
|
|
if (!d->run_cnt)
|
2009-08-27 15:58:34 -07:00
|
|
|
{
|
2010-05-01 16:03:14 -07:00
|
|
|
EINA_LIST_FREE(d->files, file)
|
|
|
|
{
|
2010-05-01 18:57:52 -07:00
|
|
|
if (file->base.label) free((char *)(file->base.label));
|
2010-05-01 16:03:14 -07:00
|
|
|
if (file->path) free((char *)file->path);
|
|
|
|
free(file);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2010-05-01 18:57:52 -07:00
|
|
|
EINA_LIST_FREE(d->files, file)
|
|
|
|
{
|
|
|
|
if (file->path)
|
|
|
|
eina_stringshare_del(file->path);
|
|
|
|
if (EVRY_ITEM(file)->label)
|
|
|
|
eina_stringshare_del(EVRY_ITEM(file)->label);
|
|
|
|
if (EVRY_ITEM(file)->detail)
|
|
|
|
eina_stringshare_del(EVRY_ITEM(file)->detail);
|
|
|
|
free(file);
|
|
|
|
}
|
2009-08-27 15:58:34 -07:00
|
|
|
}
|
2010-04-16 07:15:30 -07:00
|
|
|
|
2010-04-26 11:21:09 -07:00
|
|
|
free(d->directory);
|
2010-04-08 15:37:50 -07:00
|
|
|
E_FREE(d);
|
|
|
|
|
2010-04-15 06:58:44 -07:00
|
|
|
p->thread = NULL;
|
2010-04-20 10:48:21 -07:00
|
|
|
|
2010-04-26 11:21:09 -07:00
|
|
|
if (p->cleanup > 0)
|
|
|
|
{
|
|
|
|
p->cleanup--;
|
|
|
|
|
|
|
|
if (!p->cleanup)
|
|
|
|
E_FREE(p);
|
|
|
|
}
|
2010-04-08 15:37:50 -07:00
|
|
|
}
|
2009-08-12 05:17:43 -07:00
|
|
|
|
2010-04-08 15:37:50 -07:00
|
|
|
static void
|
|
|
|
_scan_end_func(void *data)
|
|
|
|
{
|
|
|
|
Data *d = data;
|
|
|
|
Plugin *p = d->plugin;
|
|
|
|
Evry_Item *item;
|
2010-04-16 07:15:30 -07:00
|
|
|
Evry_Item_File *f;
|
|
|
|
char *filename, *path, *mime;
|
2010-05-01 16:03:14 -07:00
|
|
|
Eina_List *l, *ll, *lll;
|
|
|
|
History_Item *hi;
|
|
|
|
History_Entry *he;
|
2010-05-02 13:40:21 -07:00
|
|
|
History_Types *ht = NULL;
|
2010-05-01 16:03:14 -07:00
|
|
|
int cnt = 0;
|
2010-04-20 10:48:21 -07:00
|
|
|
|
2010-05-02 13:40:21 -07:00
|
|
|
if (_conf->cache_dirs)
|
|
|
|
ht = evry_history_types_get(evry_hist->subjects, EVRY_TYPE_FILE);
|
|
|
|
|
2010-05-01 16:03:14 -07:00
|
|
|
if (!d->run_cnt)
|
2009-08-27 15:58:34 -07:00
|
|
|
{
|
2010-05-01 16:03:14 -07:00
|
|
|
EINA_LIST_FOREACH_SAFE(d->files, l, ll, item)
|
|
|
|
{
|
|
|
|
GET_FILE(file, item);
|
2009-08-22 20:12:05 -07:00
|
|
|
|
2010-05-01 16:03:14 -07:00
|
|
|
filename = (char *)item->label;
|
|
|
|
path = (char *) file->path;
|
|
|
|
mime = (char *) file->mime;
|
2010-04-20 10:48:21 -07:00
|
|
|
|
2010-05-01 16:03:14 -07:00
|
|
|
file->path = eina_stringshare_add(path);
|
2010-04-16 07:15:30 -07:00
|
|
|
|
2010-05-01 16:03:14 -07:00
|
|
|
/* filter out files that we already have from history */
|
|
|
|
EINA_LIST_FOREACH(p->files, lll, f)
|
2010-04-16 07:15:30 -07:00
|
|
|
{
|
2010-05-01 16:03:14 -07:00
|
|
|
if (f->path == file->path)
|
|
|
|
{
|
|
|
|
free(filename);
|
|
|
|
free(path);
|
|
|
|
eina_stringshare_del(file->path);
|
|
|
|
d->files = eina_list_remove_list(d->files, l);
|
|
|
|
E_FREE(file);
|
|
|
|
file = NULL;
|
|
|
|
break;
|
|
|
|
}
|
2010-04-16 07:15:30 -07:00
|
|
|
}
|
2010-05-01 16:03:14 -07:00
|
|
|
if (!file) continue;
|
2010-04-20 10:48:21 -07:00
|
|
|
|
2010-05-01 16:03:14 -07:00
|
|
|
if (item->browseable)
|
2010-05-02 14:47:28 -07:00
|
|
|
{
|
|
|
|
file->mime = eina_stringshare_ref(_mime_dir);
|
|
|
|
}
|
|
|
|
|
2010-05-01 16:03:14 -07:00
|
|
|
/* check if we can grab the mimetype from history */
|
2010-05-02 13:40:21 -07:00
|
|
|
if ((!file->mime && _conf->cache_dirs && ht) &&
|
|
|
|
(he = eina_hash_find(ht->types, file->path)))
|
2010-05-01 16:03:14 -07:00
|
|
|
{
|
|
|
|
EINA_LIST_FOREACH(he->items, lll, hi)
|
|
|
|
{
|
|
|
|
if (hi->data)
|
|
|
|
{
|
|
|
|
file->mime = eina_stringshare_ref(hi->data);
|
|
|
|
DBG("cached: %s %s", file->mime, file->path);
|
|
|
|
hi->transient = 0;
|
2010-05-02 14:47:28 -07:00
|
|
|
item->usage = -1;
|
2010-05-02 08:46:02 -07:00
|
|
|
item->hi = hi;
|
2010-05-01 16:03:14 -07:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2010-04-16 07:15:30 -07:00
|
|
|
|
2010-05-01 16:03:14 -07:00
|
|
|
if (file->mime)
|
|
|
|
{
|
|
|
|
item->context = eina_stringshare_ref(file->mime);
|
2009-08-27 15:58:34 -07:00
|
|
|
|
2010-05-01 16:03:14 -07:00
|
|
|
d->files = eina_list_remove_list(d->files, l);
|
|
|
|
p->files = eina_list_append(p->files, file);
|
|
|
|
}
|
2009-08-27 15:58:34 -07:00
|
|
|
|
2010-05-01 16:03:14 -07:00
|
|
|
item->id = eina_stringshare_ref(file->path);
|
|
|
|
item->label = eina_stringshare_add(filename);
|
|
|
|
evry_util_file_detail_set(file);
|
2010-04-26 11:21:09 -07:00
|
|
|
|
2010-05-01 16:03:14 -07:00
|
|
|
free(filename);
|
|
|
|
free(path);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (d->files)
|
|
|
|
{
|
2010-05-01 18:57:52 -07:00
|
|
|
d->run_cnt++;
|
2010-05-01 16:03:14 -07:00
|
|
|
d->files = eina_list_sort(d->files, -1, _cb_sort);
|
2010-05-02 13:40:21 -07:00
|
|
|
p->thread = ecore_thread_run(_scan_mime_func,
|
|
|
|
_scan_end_func,
|
|
|
|
_scan_cancel_func, d);
|
2010-05-01 16:03:14 -07:00
|
|
|
return;
|
|
|
|
}
|
2010-04-25 12:37:30 -07:00
|
|
|
}
|
2010-04-16 07:15:30 -07:00
|
|
|
else
|
2010-05-01 16:03:14 -07:00
|
|
|
{
|
|
|
|
EINA_LIST_FREE(d->files, item)
|
|
|
|
{
|
|
|
|
GET_FILE(file, item);
|
|
|
|
|
|
|
|
mime = (char *) file->mime;
|
|
|
|
|
|
|
|
if (!mime) break;
|
|
|
|
|
|
|
|
file->mime = eina_stringshare_add(mime);
|
|
|
|
item->context = eina_stringshare_ref(file->mime);
|
|
|
|
|
|
|
|
p->files = eina_list_append(p->files, file);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (d->files)
|
|
|
|
{
|
2010-05-01 18:57:52 -07:00
|
|
|
d->run_cnt++;
|
2010-05-02 13:40:21 -07:00
|
|
|
p->thread = ecore_thread_run(_scan_mime_func,
|
|
|
|
_scan_end_func,
|
|
|
|
_scan_cancel_func, d);
|
2010-05-01 16:03:14 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!d->files)
|
2010-04-25 12:37:30 -07:00
|
|
|
{
|
2010-05-01 18:57:52 -07:00
|
|
|
if (_conf->cache_dirs)
|
|
|
|
{
|
2010-05-02 14:47:28 -07:00
|
|
|
EINA_LIST_REVERSE_FOREACH(p->files, l, item)
|
2010-05-01 18:57:52 -07:00
|
|
|
{
|
|
|
|
GET_FILE(file, item);
|
|
|
|
|
2010-05-02 13:40:21 -07:00
|
|
|
if (!item->usage && (hi = evry_history_add(evry_hist->subjects,
|
|
|
|
item, NULL, NULL)))
|
2010-05-01 18:57:52 -07:00
|
|
|
{
|
2010-05-02 14:47:28 -07:00
|
|
|
hi->last_used = SIX_DAYS_AGO + (0.001 * (double) cnt++);
|
2010-05-01 18:57:52 -07:00
|
|
|
hi->usage = TIME_FACTOR(hi->last_used);
|
|
|
|
hi->data = eina_stringshare_ref(file->mime);
|
2010-05-02 08:46:02 -07:00
|
|
|
item->hi = hi;
|
2010-05-01 18:57:52 -07:00
|
|
|
}
|
2010-05-02 14:47:28 -07:00
|
|
|
else if (item->hi && (item->hi->count == 1) &&
|
|
|
|
(item->hi->last_used < SIX_DAYS_AGO))
|
2010-05-01 18:57:52 -07:00
|
|
|
{
|
2010-05-02 14:47:28 -07:00
|
|
|
item->hi->last_used = SIX_DAYS_AGO + (0.001 * (double) cnt++);
|
2010-05-02 13:40:21 -07:00
|
|
|
item->hi->usage = TIME_FACTOR(hi->last_used);
|
2010-05-01 18:57:52 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-04-26 11:21:09 -07:00
|
|
|
free(d->directory);
|
2010-04-25 12:37:30 -07:00
|
|
|
E_FREE(d);
|
2010-04-26 11:21:09 -07:00
|
|
|
p->thread = NULL;
|
2010-04-25 12:37:30 -07:00
|
|
|
}
|
2010-05-02 14:47:28 -07:00
|
|
|
|
|
|
|
p->files = eina_list_sort(p->files, -1, _cb_sort);
|
|
|
|
|
2010-04-26 11:21:09 -07:00
|
|
|
_append_files(p);
|
|
|
|
|
2010-04-15 06:58:44 -07:00
|
|
|
evry_plugin_async_update(EVRY_PLUGIN(p), EVRY_ASYNC_UPDATE_ADD);
|
2009-08-27 15:58:34 -07:00
|
|
|
}
|
|
|
|
|
2010-04-25 09:26:13 -07:00
|
|
|
static void
|
|
|
|
_dir_watcher(void *data, Ecore_File_Monitor *em, Ecore_File_Event event, const char *path)
|
|
|
|
{
|
|
|
|
Plugin *p = data;
|
|
|
|
Evry_Item_File *file;
|
2010-04-25 18:04:43 -07:00
|
|
|
const char *label;
|
|
|
|
Eina_List *ll, *l;
|
2010-04-26 11:21:09 -07:00
|
|
|
|
2010-04-25 18:04:43 -07:00
|
|
|
switch (event)
|
2010-04-25 09:26:13 -07:00
|
|
|
{
|
2010-04-25 18:04:43 -07:00
|
|
|
case ECORE_FILE_EVENT_DELETED_SELF:
|
2010-04-30 15:12:02 -07:00
|
|
|
EINA_LIST_FREE(p->files, file)
|
2010-04-25 18:04:43 -07:00
|
|
|
evry_item_free(EVRY_ITEM(file));
|
|
|
|
break;
|
2010-04-26 11:21:09 -07:00
|
|
|
|
2010-04-25 18:04:43 -07:00
|
|
|
case ECORE_FILE_EVENT_CREATED_DIRECTORY:
|
|
|
|
case ECORE_FILE_EVENT_CREATED_FILE:
|
2010-04-30 15:12:02 -07:00
|
|
|
DBG("added %s", path);
|
2010-04-25 18:04:43 -07:00
|
|
|
|
|
|
|
label = ecore_file_file_get(path);
|
2010-04-26 11:21:09 -07:00
|
|
|
|
2010-04-27 20:22:40 -07:00
|
|
|
file = EVRY_ITEM_NEW(Evry_Item_File, p, label, NULL, _item_free);
|
2010-04-26 11:21:09 -07:00
|
|
|
file->path = eina_stringshare_add(path);
|
2010-04-25 18:04:43 -07:00
|
|
|
|
|
|
|
evry_util_file_detail_set(file);
|
|
|
|
|
|
|
|
if (event == ECORE_FILE_EVENT_CREATED_DIRECTORY)
|
|
|
|
{
|
2010-04-26 11:21:09 -07:00
|
|
|
file->mime = eina_stringshare_ref(_mime_dir);
|
|
|
|
EVRY_ITEM(file)->browseable = EINA_TRUE;
|
2010-04-25 18:04:43 -07:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2010-04-26 11:21:09 -07:00
|
|
|
_item_fill(file);
|
2010-04-25 18:04:43 -07:00
|
|
|
}
|
2010-04-26 11:21:09 -07:00
|
|
|
p->files = eina_list_append(p->files, file);
|
2010-04-30 15:12:02 -07:00
|
|
|
|
2010-04-25 18:04:43 -07:00
|
|
|
break;
|
2010-04-26 11:21:09 -07:00
|
|
|
|
2010-04-25 18:04:43 -07:00
|
|
|
case ECORE_FILE_EVENT_DELETED_FILE:
|
|
|
|
case ECORE_FILE_EVENT_DELETED_DIRECTORY:
|
|
|
|
label = eina_stringshare_add(path);
|
2010-04-30 15:12:02 -07:00
|
|
|
DBG("delete %s", path);
|
2010-04-25 18:04:43 -07:00
|
|
|
|
|
|
|
EINA_LIST_FOREACH_SAFE(p->files, l, ll, file)
|
|
|
|
{
|
|
|
|
if (file->path != label) continue;
|
2010-04-26 11:21:09 -07:00
|
|
|
|
|
|
|
p->files = eina_list_remove_list(p->files, l);
|
2010-04-30 15:12:02 -07:00
|
|
|
if (eina_list_data_find_list(p->hist_added, file))
|
|
|
|
{
|
|
|
|
p->hist_added = eina_list_remove(p->hist_added, file);
|
|
|
|
evry_item_free(EVRY_ITEM(file));
|
|
|
|
}
|
|
|
|
|
2010-04-25 18:04:43 -07:00
|
|
|
evry_item_free(EVRY_ITEM(file));
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
eina_stringshare_del(label);
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
_append_files(p);
|
2010-04-26 11:21:09 -07:00
|
|
|
|
2010-04-25 18:04:43 -07:00
|
|
|
evry_plugin_async_update(EVRY_PLUGIN(p), EVRY_ASYNC_UPDATE_ADD);
|
2010-04-25 09:26:13 -07:00
|
|
|
}
|
|
|
|
|
2009-08-27 15:58:34 -07:00
|
|
|
static void
|
|
|
|
_read_directory(Plugin *p)
|
|
|
|
{
|
|
|
|
Data *d = E_NEW(Data, 1);
|
|
|
|
d->plugin = p;
|
2010-04-26 11:21:09 -07:00
|
|
|
d->directory = strdup(p->directory);
|
2010-04-10 13:05:57 -07:00
|
|
|
|
2010-04-08 15:37:50 -07:00
|
|
|
p->thread = ecore_thread_run(_scan_func, _scan_end_func, _scan_cancel_func, d);
|
2010-04-25 09:26:13 -07:00
|
|
|
|
|
|
|
if (p->dir_mon)
|
|
|
|
ecore_file_monitor_del(p->dir_mon);
|
|
|
|
|
2010-04-26 11:21:09 -07:00
|
|
|
p->dir_mon = ecore_file_monitor_add(p->directory, _dir_watcher, p);
|
2009-08-12 12:14:45 -07:00
|
|
|
}
|
|
|
|
|
2009-08-21 15:42:06 -07:00
|
|
|
static Evry_Plugin *
|
|
|
|
_begin(Evry_Plugin *plugin, const Evry_Item *it)
|
2009-08-12 12:14:45 -07:00
|
|
|
{
|
2009-08-22 20:12:05 -07:00
|
|
|
Plugin *p = NULL;
|
2009-08-12 12:00:25 -07:00
|
|
|
|
2010-04-28 09:39:50 -07:00
|
|
|
if (it && CHECK_TYPE(it, EVRY_TYPE_FILE))
|
2009-08-21 15:42:06 -07:00
|
|
|
{
|
2010-04-29 14:42:03 -07:00
|
|
|
/* browsing */
|
|
|
|
GET_PLUGIN(parent, plugin);
|
2010-04-27 20:22:40 -07:00
|
|
|
GET_FILE(file, it);
|
2009-08-22 20:12:05 -07:00
|
|
|
|
2010-04-29 08:20:12 -07:00
|
|
|
if (!evry_file_path_get(file) ||
|
|
|
|
!ecore_file_is_dir(file->path))
|
2009-08-21 15:42:06 -07:00
|
|
|
return NULL;
|
2009-06-21 03:31:38 -07:00
|
|
|
|
2009-08-21 15:42:06 -07:00
|
|
|
p = E_NEW(Plugin, 1);
|
|
|
|
p->base = *plugin;
|
2009-08-22 14:22:38 -07:00
|
|
|
p->base.items = NULL;
|
2009-08-22 20:12:05 -07:00
|
|
|
|
2010-04-07 08:03:27 -07:00
|
|
|
p->directory = eina_stringshare_add(file->path);
|
2010-04-15 06:58:44 -07:00
|
|
|
p->parent = EINA_TRUE;
|
2010-04-29 14:42:03 -07:00
|
|
|
p->dirs_only = parent->dirs_only;
|
|
|
|
}
|
|
|
|
else if (it && CHECK_TYPE(it, EVRY_TYPE_ACTION))
|
|
|
|
{
|
|
|
|
/* provide object */
|
2010-04-30 15:12:02 -07:00
|
|
|
/* GET_ACTION(act, it); */
|
2010-04-29 14:42:03 -07:00
|
|
|
|
|
|
|
p = E_NEW(Plugin, 1);
|
|
|
|
p->base = *plugin;
|
|
|
|
p->base.items = NULL;
|
|
|
|
|
2010-04-30 15:12:02 -07:00
|
|
|
/* if (act->it2.subtype == EVRY_TYPE_DIR)
|
|
|
|
* p->dirs_only = EINA_TRUE; */
|
2010-04-29 14:42:03 -07:00
|
|
|
|
|
|
|
p->directory = eina_stringshare_add(e_user_homedir_get());
|
|
|
|
p->parent = EINA_FALSE;
|
2010-04-29 17:38:36 -07:00
|
|
|
p->show_recent = EINA_TRUE;
|
2009-08-21 15:42:06 -07:00
|
|
|
}
|
2010-04-27 20:22:40 -07:00
|
|
|
else if (!it)
|
2009-08-21 15:42:06 -07:00
|
|
|
{
|
2010-04-29 14:42:03 -07:00
|
|
|
/* provide subject */
|
2009-08-21 15:42:06 -07:00
|
|
|
p = E_NEW(Plugin, 1);
|
|
|
|
p->base = *plugin;
|
2009-08-22 14:22:38 -07:00
|
|
|
p->base.items = NULL;
|
2010-04-20 10:48:21 -07:00
|
|
|
if (_conf->show_homedir)
|
|
|
|
p->directory = eina_stringshare_add(e_user_homedir_get());
|
2010-04-29 17:38:36 -07:00
|
|
|
|
|
|
|
/* p->show_recent = (_conf->show_recent || _conf->search_recent); */
|
2010-04-30 15:12:02 -07:00
|
|
|
p->show_recent = EINA_TRUE;
|
2010-04-15 06:58:44 -07:00
|
|
|
p->parent = EINA_FALSE;
|
2010-05-01 18:57:52 -07:00
|
|
|
|
|
|
|
if (clear_cache)
|
|
|
|
{
|
2010-05-02 13:40:21 -07:00
|
|
|
History_Types *ht = evry_history_types_get(evry_hist->subjects, EVRY_TYPE_FILE);
|
|
|
|
if (ht)
|
|
|
|
{
|
|
|
|
eina_hash_foreach(ht->types, _hist_items_add_cb, p);
|
|
|
|
}
|
2010-05-01 18:57:52 -07:00
|
|
|
clear_cache = EINA_FALSE;
|
|
|
|
}
|
2009-08-21 15:42:06 -07:00
|
|
|
}
|
2010-04-27 20:22:40 -07:00
|
|
|
else
|
|
|
|
{
|
|
|
|
return NULL;
|
|
|
|
}
|
2009-08-22 20:12:05 -07:00
|
|
|
|
2010-04-20 10:48:21 -07:00
|
|
|
if (p->directory)
|
|
|
|
_read_directory(p);
|
2009-08-12 13:26:27 -07:00
|
|
|
|
2009-08-22 20:12:05 -07:00
|
|
|
return EVRY_PLUGIN(p);
|
2009-06-21 03:31:38 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2009-08-21 15:42:06 -07:00
|
|
|
_cleanup(Evry_Plugin *plugin)
|
2009-06-21 03:31:38 -07:00
|
|
|
{
|
2010-04-27 20:22:40 -07:00
|
|
|
GET_PLUGIN(p, plugin);
|
2009-08-22 20:12:05 -07:00
|
|
|
|
|
|
|
Evry_Item_File *file;
|
2010-04-20 10:48:21 -07:00
|
|
|
|
2010-04-20 12:00:05 -07:00
|
|
|
if (p->directory)
|
|
|
|
eina_stringshare_del(p->directory);
|
|
|
|
|
|
|
|
EINA_LIST_FREE(p->files, file)
|
2010-04-29 14:42:03 -07:00
|
|
|
evry_item_free(EVRY_ITEM(file));
|
2010-04-26 11:21:09 -07:00
|
|
|
|
2010-04-20 12:00:05 -07:00
|
|
|
EVRY_PLUGIN_ITEMS_CLEAR(p);
|
|
|
|
|
|
|
|
if (p->input)
|
|
|
|
eina_stringshare_del(p->input);
|
|
|
|
|
2010-04-25 09:26:13 -07:00
|
|
|
if (p->dir_mon)
|
|
|
|
ecore_file_monitor_del(p->dir_mon);
|
|
|
|
|
2010-04-25 12:37:30 -07:00
|
|
|
if (p->thread2)
|
2010-04-26 11:21:09 -07:00
|
|
|
{
|
|
|
|
ecore_thread_cancel(p->thread2);
|
|
|
|
p->cleanup++;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
EINA_LIST_FREE(p->hist_added, file)
|
|
|
|
evry_item_free(EVRY_ITEM(file));
|
|
|
|
|
2010-04-08 15:37:50 -07:00
|
|
|
if (p->thread)
|
2010-04-20 10:48:21 -07:00
|
|
|
{
|
2010-04-08 15:37:50 -07:00
|
|
|
ecore_thread_cancel(p->thread);
|
2010-04-26 11:21:09 -07:00
|
|
|
p->cleanup++;
|
2010-04-08 15:37:50 -07:00
|
|
|
}
|
2009-08-12 12:00:25 -07:00
|
|
|
|
2010-04-26 11:21:09 -07:00
|
|
|
if (!p->cleanup)
|
|
|
|
E_FREE(p);
|
2009-06-21 03:31:38 -07:00
|
|
|
}
|
|
|
|
|
2010-04-25 12:37:30 -07:00
|
|
|
/* use thread only to not block ui for ecore_file_exists ... */
|
2010-04-26 11:21:09 -07:00
|
|
|
static void
|
|
|
|
_hist_func(void *data)
|
|
|
|
{
|
|
|
|
Plugin *p = data;
|
2010-04-29 14:42:03 -07:00
|
|
|
Eina_List *l;
|
2010-04-26 11:21:09 -07:00
|
|
|
Evry_Item_File *file;
|
2010-04-29 14:42:03 -07:00
|
|
|
History_Item *hi;
|
2010-04-26 11:21:09 -07:00
|
|
|
|
2010-04-29 14:42:03 -07:00
|
|
|
EINA_LIST_FOREACH(p->hist_added, l, file)
|
2010-04-26 11:21:09 -07:00
|
|
|
{
|
2010-04-29 08:20:12 -07:00
|
|
|
if (!evry_file_path_get(file))
|
2010-04-29 14:42:03 -07:00
|
|
|
goto clear;
|
|
|
|
|
2010-04-26 11:21:09 -07:00
|
|
|
if (!ecore_file_exists(file->path))
|
2010-04-29 14:42:03 -07:00
|
|
|
goto clear;
|
|
|
|
|
2010-04-27 20:22:40 -07:00
|
|
|
if (!file->mime)
|
2010-04-29 14:42:03 -07:00
|
|
|
file->mime = eina_stringshare_add(efreet_mime_type_get(file->path));
|
|
|
|
|
2010-04-29 08:20:12 -07:00
|
|
|
if (!file->mime)
|
2010-05-01 16:03:14 -07:00
|
|
|
file->mime = eina_stringshare_add("unknown");
|
2010-04-29 14:42:03 -07:00
|
|
|
|
2010-04-29 08:20:12 -07:00
|
|
|
if ((!strcmp(file->mime, "inode/directory")) ||
|
|
|
|
(!strcmp(file->mime, "inode/mount-point")))
|
|
|
|
EVRY_ITEM(file)->browseable = EINA_TRUE;
|
|
|
|
|
|
|
|
evry_util_file_detail_set(file);
|
2010-04-29 14:42:03 -07:00
|
|
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
clear:
|
|
|
|
|
|
|
|
hi = EVRY_ITEM(file)->data;
|
|
|
|
hi->last_used -= ONE_DAY;
|
|
|
|
EVRY_ITEM(file)->data = NULL;
|
2010-04-26 11:21:09 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_hist_cancel_func(void *data)
|
|
|
|
{
|
|
|
|
Plugin *p = data;
|
|
|
|
Evry_Item_File *file;
|
|
|
|
|
|
|
|
EINA_LIST_FREE(p->hist_added, file)
|
|
|
|
{
|
2010-04-29 14:42:03 -07:00
|
|
|
/* XXX it cant be in p->files already, no ?*/
|
2010-04-26 11:21:09 -07:00
|
|
|
p->files = eina_list_remove(p->files, file);
|
|
|
|
evry_item_free(EVRY_ITEM(file));
|
|
|
|
}
|
|
|
|
|
|
|
|
p->thread2 = NULL;
|
|
|
|
|
|
|
|
if (p->cleanup > 0)
|
|
|
|
{
|
|
|
|
p->cleanup--;
|
|
|
|
|
|
|
|
if (!p->cleanup)
|
|
|
|
E_FREE(p);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_hist_end_func(void *data)
|
|
|
|
{
|
|
|
|
Plugin *p = data;
|
2010-04-29 14:42:03 -07:00
|
|
|
Eina_List *l, *ll;
|
|
|
|
Evry_Item *it;
|
|
|
|
History_Item *hi;
|
|
|
|
const char *label;
|
2010-04-26 11:21:09 -07:00
|
|
|
|
2010-04-29 14:42:03 -07:00
|
|
|
EINA_LIST_FOREACH_SAFE(p->hist_added, l, ll, it)
|
2010-04-26 11:21:09 -07:00
|
|
|
{
|
2010-04-29 14:42:03 -07:00
|
|
|
if (!it->data)
|
|
|
|
{
|
|
|
|
p->hist_added = eina_list_remove_list(p->hist_added, l);
|
2010-05-02 08:46:02 -07:00
|
|
|
evry_item_free(it);
|
2010-04-29 14:42:03 -07:00
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
GET_FILE(file, it);
|
|
|
|
|
|
|
|
/* remember mimetype */
|
|
|
|
if (it->data && file->mime)
|
|
|
|
{
|
|
|
|
hi = it->data;
|
|
|
|
|
|
|
|
if (!hi->data)
|
|
|
|
hi->data = eina_stringshare_ref(file->mime);
|
|
|
|
}
|
|
|
|
|
|
|
|
label = ecore_file_file_get(file->path);
|
|
|
|
if (label)
|
|
|
|
it->label = eina_stringshare_add(label);
|
|
|
|
else
|
|
|
|
it->label = eina_stringshare_add(file->path);
|
|
|
|
|
|
|
|
evry_item_ref(it);
|
2010-04-29 17:38:36 -07:00
|
|
|
|
2010-05-02 08:46:02 -07:00
|
|
|
p->files = eina_list_append(p->files, it);
|
2010-04-26 11:21:09 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
p->thread2 = NULL;
|
|
|
|
|
|
|
|
_append_files(p);
|
|
|
|
|
|
|
|
evry_plugin_async_update(EVRY_PLUGIN(p), EVRY_ASYNC_UPDATE_ADD);
|
|
|
|
}
|
2010-04-25 12:37:30 -07:00
|
|
|
|
2010-04-16 07:15:30 -07:00
|
|
|
static Eina_Bool
|
|
|
|
_hist_items_add_cb(const Eina_Hash *hash, const void *key, void *data, void *fdata)
|
2009-08-27 15:58:34 -07:00
|
|
|
{
|
2010-04-16 07:15:30 -07:00
|
|
|
History_Entry *he = data;
|
2010-04-29 14:42:03 -07:00
|
|
|
History_Item *hi = NULL, *hi2;
|
2010-04-16 07:15:30 -07:00
|
|
|
Plugin *p = fdata;
|
2010-04-16 11:36:28 -07:00
|
|
|
Eina_List *l, *ll;
|
2010-04-16 07:15:30 -07:00
|
|
|
Evry_Item_File *file;
|
2010-04-29 14:42:03 -07:00
|
|
|
double last_used = 0.0;
|
2010-04-20 10:48:21 -07:00
|
|
|
|
2010-04-29 14:42:03 -07:00
|
|
|
EINA_LIST_FOREACH(he->items, l, hi2)
|
2010-04-16 07:15:30 -07:00
|
|
|
{
|
2010-04-29 14:42:03 -07:00
|
|
|
if (hi2->last_used > last_used)
|
|
|
|
hi = hi2;
|
|
|
|
}
|
2010-04-17 05:40:28 -07:00
|
|
|
|
2010-04-29 14:42:03 -07:00
|
|
|
if (!hi)
|
|
|
|
return EINA_TRUE;
|
2010-04-20 10:48:21 -07:00
|
|
|
|
2010-05-01 16:03:14 -07:00
|
|
|
if (clear_cache)
|
|
|
|
{
|
2010-05-02 13:40:21 -07:00
|
|
|
printf("clear item %s\n", (char *)key);
|
|
|
|
|
2010-05-01 16:03:14 -07:00
|
|
|
/* transient marks them for deletion */
|
2010-05-02 14:47:28 -07:00
|
|
|
if (hi->count && (hi->last_used < SIX_DAYS_AGO))
|
2010-05-02 13:40:21 -07:00
|
|
|
{
|
|
|
|
hi->transient = 1;
|
|
|
|
hi->count--;
|
|
|
|
}
|
|
|
|
|
2010-05-01 18:57:52 -07:00
|
|
|
return EINA_TRUE;
|
2010-05-01 16:03:14 -07:00
|
|
|
}
|
|
|
|
|
2010-05-01 17:58:33 -07:00
|
|
|
if (!hi->count)
|
2010-05-01 16:03:14 -07:00
|
|
|
return EINA_TRUE;
|
|
|
|
|
2010-05-01 18:09:49 -07:00
|
|
|
if (!_conf->search_cache)
|
|
|
|
{
|
2010-05-02 14:47:28 -07:00
|
|
|
if ((hi->count == 1) && (hi->last_used < SIX_DAYS_AGO))
|
2010-05-01 18:09:49 -07:00
|
|
|
return EINA_TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2010-05-02 13:40:21 -07:00
|
|
|
DBG("add %s", (char *) key);
|
2010-05-01 16:03:14 -07:00
|
|
|
|
2010-04-29 14:42:03 -07:00
|
|
|
EINA_LIST_FOREACH(p->files, ll, file)
|
|
|
|
if (!strcmp(file->path, key))
|
|
|
|
return EINA_TRUE;
|
2010-04-16 07:15:30 -07:00
|
|
|
|
2010-04-29 14:42:03 -07:00
|
|
|
file = EVRY_ITEM_NEW(Evry_Item_File, p, NULL, NULL, _item_free);
|
2010-04-16 07:15:30 -07:00
|
|
|
|
2010-04-29 14:42:03 -07:00
|
|
|
file->path = eina_stringshare_add(key);
|
2010-04-16 07:15:30 -07:00
|
|
|
|
2010-04-29 14:42:03 -07:00
|
|
|
if (hi->data)
|
|
|
|
file->mime = eina_stringshare_add(hi->data);
|
|
|
|
|
|
|
|
EVRY_ITEM(file)->data = hi;
|
|
|
|
|
|
|
|
if (file->mime)
|
|
|
|
EVRY_ITEM(file)->context = eina_stringshare_ref(file->mime);
|
|
|
|
|
|
|
|
EVRY_ITEM(file)->id = eina_stringshare_ref(file->path);
|
|
|
|
|
|
|
|
p->hist_added = eina_list_append(p->hist_added, file);
|
2010-04-16 11:36:28 -07:00
|
|
|
|
2010-04-16 07:15:30 -07:00
|
|
|
return EINA_TRUE;
|
2009-08-27 15:58:34 -07:00
|
|
|
}
|
|
|
|
|
2010-04-21 03:59:08 -07:00
|
|
|
static void
|
|
|
|
_folder_item_add(Plugin *p, const char *path)
|
|
|
|
{
|
2010-04-27 20:22:40 -07:00
|
|
|
Evry_Item_File *file;
|
2010-04-21 03:59:08 -07:00
|
|
|
|
2010-04-27 20:22:40 -07:00
|
|
|
file = EVRY_ITEM_NEW(Evry_Item_File, p, path, NULL, _item_free);
|
2010-04-21 03:59:08 -07:00
|
|
|
file->path = eina_stringshare_add(path);
|
2010-04-26 11:21:09 -07:00
|
|
|
file->mime = eina_stringshare_ref(_mime_dir);
|
2010-04-21 03:59:08 -07:00
|
|
|
EVRY_ITEM(file)->browseable = EINA_TRUE;
|
|
|
|
p->files = eina_list_append(p->files, file);
|
|
|
|
EVRY_PLUGIN_ITEM_APPEND(p, file);
|
|
|
|
}
|
|
|
|
|
2010-04-25 12:37:30 -07:00
|
|
|
static void
|
|
|
|
_free_files(Plugin *p)
|
|
|
|
{
|
|
|
|
Evry_Item_File *file;
|
2010-04-26 11:21:09 -07:00
|
|
|
|
2010-04-25 12:37:30 -07:00
|
|
|
if (p->thread)
|
|
|
|
ecore_thread_cancel(p->thread);
|
|
|
|
p->thread = NULL;
|
|
|
|
|
2010-04-26 11:21:09 -07:00
|
|
|
if (p->thread2)
|
|
|
|
ecore_thread_cancel(p->thread2);
|
|
|
|
p->thread2 = NULL;
|
|
|
|
|
2010-04-25 12:37:30 -07:00
|
|
|
EINA_LIST_FREE(p->files, file)
|
|
|
|
evry_item_free(EVRY_ITEM(file));
|
2010-04-26 11:21:09 -07:00
|
|
|
|
|
|
|
EINA_LIST_FREE(p->hist_added, file)
|
|
|
|
evry_item_free(EVRY_ITEM(file));
|
2010-04-25 12:37:30 -07:00
|
|
|
|
|
|
|
if (p->dir_mon)
|
|
|
|
ecore_file_monitor_del(p->dir_mon);
|
|
|
|
p->dir_mon = NULL;
|
|
|
|
}
|
|
|
|
|
2009-06-21 03:31:38 -07:00
|
|
|
static int
|
2009-08-21 15:42:06 -07:00
|
|
|
_fetch(Evry_Plugin *plugin, const char *input)
|
2009-06-21 03:31:38 -07:00
|
|
|
{
|
2010-04-27 20:22:40 -07:00
|
|
|
GET_PLUGIN(p, plugin);
|
2009-08-22 20:12:05 -07:00
|
|
|
Evry_Item_File *file;
|
2010-04-26 11:21:09 -07:00
|
|
|
|
2009-08-21 15:42:06 -07:00
|
|
|
if (!p->command)
|
2009-08-22 20:12:05 -07:00
|
|
|
EVRY_PLUGIN_ITEMS_CLEAR(p);
|
2009-08-12 05:17:43 -07:00
|
|
|
|
2010-04-15 06:58:44 -07:00
|
|
|
if (p->input)
|
2010-04-20 10:48:21 -07:00
|
|
|
eina_stringshare_del(p->input);
|
2010-04-15 06:58:44 -07:00
|
|
|
p->input = NULL;
|
2009-08-27 15:58:34 -07:00
|
|
|
|
2010-04-25 18:04:43 -07:00
|
|
|
if (!p->parent && input && !strncmp(input, "/", 1))
|
2009-07-10 07:08:06 -07:00
|
|
|
{
|
2010-04-27 20:22:40 -07:00
|
|
|
char *path = NULL;
|
|
|
|
|
|
|
|
if ((p->command != CMD_SHOW_ROOT) ||
|
|
|
|
((ecore_file_is_dir(input) ? (path = strdup(input)) : 0) ||
|
|
|
|
((path = ecore_file_dir_get(input)) &&
|
|
|
|
(strcmp(p->directory, path)))))
|
2010-04-25 18:04:43 -07:00
|
|
|
{
|
|
|
|
_free_files(p);
|
2010-04-26 11:21:09 -07:00
|
|
|
|
2010-04-25 18:04:43 -07:00
|
|
|
eina_stringshare_del(p->directory);
|
2010-04-27 20:22:40 -07:00
|
|
|
|
|
|
|
if (path)
|
|
|
|
{
|
|
|
|
p->directory = eina_stringshare_add(path);
|
|
|
|
free(path);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
p->directory = eina_stringshare_add("/");
|
|
|
|
}
|
|
|
|
|
2010-04-25 18:04:43 -07:00
|
|
|
_read_directory(p);
|
2010-04-24 16:07:13 -07:00
|
|
|
|
2010-04-25 18:04:43 -07:00
|
|
|
p->command = CMD_SHOW_ROOT;
|
2010-04-21 03:59:08 -07:00
|
|
|
|
2010-04-25 18:04:43 -07:00
|
|
|
return 0;
|
|
|
|
}
|
2010-04-27 20:22:40 -07:00
|
|
|
int len = strlen(p->directory);
|
|
|
|
len = (len == 1) ? len : len+1;
|
2010-05-02 08:46:02 -07:00
|
|
|
|
2010-04-27 20:22:40 -07:00
|
|
|
p->input = eina_stringshare_add(input + len);
|
2010-04-21 03:59:08 -07:00
|
|
|
}
|
2010-04-25 18:04:43 -07:00
|
|
|
else if (p->directory && input && !strncmp(input, "..", 2))
|
2010-04-21 03:59:08 -07:00
|
|
|
{
|
2010-04-25 04:00:53 -07:00
|
|
|
if (p->command != CMD_SHOW_PARENT)
|
2010-04-20 10:48:21 -07:00
|
|
|
{
|
2010-04-26 11:21:09 -07:00
|
|
|
char *dir;
|
|
|
|
char buf[PATH_MAX];
|
|
|
|
|
|
|
|
if (strncmp(p->directory, "/", 1))
|
|
|
|
return 0;
|
2010-04-25 18:04:43 -07:00
|
|
|
|
2010-04-25 12:37:30 -07:00
|
|
|
_free_files(p);
|
2010-04-21 03:59:08 -07:00
|
|
|
|
2010-04-26 11:21:09 -07:00
|
|
|
strncpy(buf, p->directory, PATH_MAX);
|
2010-04-21 03:59:08 -07:00
|
|
|
|
2010-04-29 14:42:03 -07:00
|
|
|
_folder_item_add(p, p->directory);
|
|
|
|
|
2010-04-26 11:21:09 -07:00
|
|
|
while (strlen(buf) > 1)
|
|
|
|
{
|
|
|
|
buf[PATH_MAX - 1] = 0;
|
|
|
|
dir = dirname(buf);
|
|
|
|
_folder_item_add(p, dir);
|
|
|
|
strncpy(buf, dir, PATH_MAX);
|
2010-04-21 03:59:08 -07:00
|
|
|
}
|
|
|
|
|
2010-04-25 04:00:53 -07:00
|
|
|
p->command = CMD_SHOW_PARENT;
|
2010-04-20 10:48:21 -07:00
|
|
|
}
|
2010-04-21 03:59:08 -07:00
|
|
|
return 1;
|
2010-04-15 06:58:44 -07:00
|
|
|
}
|
2010-04-25 18:04:43 -07:00
|
|
|
else if (p->directory && input && !strncmp(input, ".", 1))
|
2010-04-25 04:00:53 -07:00
|
|
|
{
|
|
|
|
if (p->command != CMD_SHOW_HIDDEN)
|
2010-04-26 11:21:09 -07:00
|
|
|
{
|
2010-04-25 12:37:30 -07:00
|
|
|
_free_files(p);
|
2010-04-26 11:21:09 -07:00
|
|
|
|
2010-04-25 04:00:53 -07:00
|
|
|
p->show_hidden = EINA_TRUE;
|
|
|
|
_read_directory(p);
|
|
|
|
|
|
|
|
p->command = CMD_SHOW_HIDDEN;
|
2010-05-02 08:46:02 -07:00
|
|
|
|
2010-04-25 04:00:53 -07:00
|
|
|
return 0;
|
|
|
|
}
|
2010-05-02 08:46:02 -07:00
|
|
|
p->input = eina_stringshare_add(input);
|
2010-04-25 04:00:53 -07:00
|
|
|
}
|
2010-04-25 18:04:43 -07:00
|
|
|
else if (p->command)
|
2010-04-15 06:58:44 -07:00
|
|
|
{
|
2010-04-26 11:21:09 -07:00
|
|
|
/* clear command items */
|
2010-04-15 06:58:44 -07:00
|
|
|
EINA_LIST_FREE(p->files, file)
|
|
|
|
evry_item_free(EVRY_ITEM(file));
|
2009-08-21 15:42:06 -07:00
|
|
|
|
2010-04-25 04:00:53 -07:00
|
|
|
if (p->command == CMD_SHOW_ROOT)
|
|
|
|
{
|
|
|
|
if (p->directory)
|
|
|
|
eina_stringshare_del(p->directory);
|
2010-04-26 11:21:09 -07:00
|
|
|
|
2010-04-25 12:37:30 -07:00
|
|
|
p->directory = eina_stringshare_add(e_user_homedir_get());
|
2010-04-25 04:00:53 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
p->show_hidden = EINA_FALSE;
|
2010-04-15 06:58:44 -07:00
|
|
|
_read_directory(p);
|
2010-04-25 04:00:53 -07:00
|
|
|
|
|
|
|
p->command = CMD_NONE;
|
2009-07-10 07:08:06 -07:00
|
|
|
}
|
2009-08-11 06:31:38 -07:00
|
|
|
|
2010-05-02 08:46:02 -07:00
|
|
|
if (p->show_recent)
|
2010-05-01 16:03:14 -07:00
|
|
|
{
|
2010-04-29 17:38:36 -07:00
|
|
|
if ((!p->parent && !p->command && !p->hist_added) &&
|
2010-05-02 08:46:02 -07:00
|
|
|
(((_conf->search_recent || _conf->search_cache) &&
|
|
|
|
(input && strlen(input) > 2)) ||
|
2010-04-29 17:38:36 -07:00
|
|
|
(_conf->show_recent)))
|
2010-04-26 11:21:09 -07:00
|
|
|
{
|
2010-05-02 13:40:21 -07:00
|
|
|
History_Types *ht = evry_history_types_get(evry_hist->subjects, EVRY_TYPE_FILE);
|
|
|
|
if (ht)
|
|
|
|
{
|
|
|
|
eina_hash_foreach(ht->types, _hist_items_add_cb, p);
|
|
|
|
p->thread2 = ecore_thread_run(_hist_func, _hist_end_func,
|
|
|
|
_hist_cancel_func, p);
|
|
|
|
}
|
2010-04-29 17:38:36 -07:00
|
|
|
}
|
2010-05-02 08:46:02 -07:00
|
|
|
else if ((_conf->search_recent || _conf->search_cache) &&
|
|
|
|
(p->hist_added && (!input || (strlen(input) < 3))))
|
2010-04-29 17:38:36 -07:00
|
|
|
{
|
|
|
|
EINA_LIST_FREE(p->hist_added, file)
|
|
|
|
{
|
|
|
|
p->files = eina_list_remove(p->files, file);
|
|
|
|
evry_item_free(EVRY_ITEM(file));
|
2010-05-02 08:46:02 -07:00
|
|
|
evry_item_free(EVRY_ITEM(file));
|
2010-04-29 17:38:36 -07:00
|
|
|
}
|
2010-04-26 11:21:09 -07:00
|
|
|
}
|
2010-04-21 03:59:08 -07:00
|
|
|
}
|
2010-04-30 15:12:02 -07:00
|
|
|
|
2010-04-27 20:22:40 -07:00
|
|
|
if (input && !p->command)
|
|
|
|
p->input = eina_stringshare_add(input);
|
2010-04-19 00:26:56 -07:00
|
|
|
|
2010-04-25 18:04:43 -07:00
|
|
|
_append_files(p);
|
2010-04-26 11:21:09 -07:00
|
|
|
|
2009-08-22 20:12:05 -07:00
|
|
|
if (!EVRY_PLUGIN(p)->items)
|
2010-05-02 08:46:02 -07:00
|
|
|
return 1;
|
2009-08-21 15:42:06 -07:00
|
|
|
|
2010-04-20 10:48:21 -07:00
|
|
|
if (!p->parent && _conf->show_recent)
|
|
|
|
EVRY_PLUGIN_ITEMS_SORT(p, _cb_sort);
|
|
|
|
|
2009-08-22 20:12:05 -07:00
|
|
|
return 1;
|
2009-06-21 03:31:38 -07:00
|
|
|
}
|
|
|
|
|
2009-08-15 21:08:35 -07:00
|
|
|
static int
|
|
|
|
_open_folder_check(Evry_Action *act __UNUSED__, const Evry_Item *it)
|
|
|
|
{
|
2009-08-16 09:26:49 -07:00
|
|
|
return (it->browseable && e_action_find("fileman"));
|
2009-08-15 21:08:35 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
2009-08-21 18:15:21 -07:00
|
|
|
_open_folder_action(Evry_Action *act)
|
2009-08-15 21:47:43 -07:00
|
|
|
{
|
2010-04-29 08:20:12 -07:00
|
|
|
E_Action *action;
|
2009-08-15 21:08:35 -07:00
|
|
|
Eina_List *m;
|
2010-04-29 08:20:12 -07:00
|
|
|
char *dir;
|
2010-04-29 14:42:03 -07:00
|
|
|
|
2010-04-29 08:20:12 -07:00
|
|
|
if (!(action = e_action_find("fileman")))
|
|
|
|
return 0;
|
2009-08-15 21:47:43 -07:00
|
|
|
|
2010-04-28 05:58:24 -07:00
|
|
|
GET_FILE(file, act->it1.item);
|
2010-04-29 14:42:03 -07:00
|
|
|
|
2010-04-29 08:20:12 -07:00
|
|
|
if (!(evry_file_path_get(file)))
|
|
|
|
return 0;
|
2010-04-29 14:42:03 -07:00
|
|
|
|
2010-04-29 08:20:12 -07:00
|
|
|
m = e_manager_list();
|
2009-08-22 20:12:05 -07:00
|
|
|
|
2010-04-29 08:20:12 -07:00
|
|
|
if (!IS_BROWSEABLE(file))
|
2009-08-15 21:47:43 -07:00
|
|
|
{
|
2010-04-29 08:20:12 -07:00
|
|
|
dir = ecore_file_dir_get(file->path);
|
|
|
|
if (!dir) return 0;
|
|
|
|
action->func.go(E_OBJECT(m->data), dir);
|
|
|
|
free(dir);
|
2009-08-15 21:47:43 -07:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2010-04-07 08:03:27 -07:00
|
|
|
action->func.go(E_OBJECT(m->data), file->path);
|
2009-08-15 21:47:43 -07:00
|
|
|
}
|
2009-08-15 21:08:35 -07:00
|
|
|
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
2009-08-27 19:25:13 -07:00
|
|
|
static int
|
|
|
|
_open_term_action(Evry_Action *act)
|
|
|
|
{
|
2010-04-28 05:58:24 -07:00
|
|
|
GET_FILE(file, act->it1.item);
|
2009-08-27 19:25:13 -07:00
|
|
|
Evry_Item_App *tmp;
|
2009-09-17 23:33:33 -07:00
|
|
|
char cwd[4096];
|
|
|
|
char *dir;
|
2010-04-26 11:21:09 -07:00
|
|
|
int ret = 0;
|
2010-04-29 14:42:03 -07:00
|
|
|
|
2010-04-29 08:20:12 -07:00
|
|
|
if (!(evry_file_path_get(file)))
|
|
|
|
return 0;
|
2009-08-27 19:25:13 -07:00
|
|
|
|
2010-04-29 08:20:12 -07:00
|
|
|
if (IS_BROWSEABLE(file))
|
2010-04-07 08:03:27 -07:00
|
|
|
dir = strdup(file->path);
|
2009-08-27 19:25:13 -07:00
|
|
|
else
|
2010-04-07 08:03:27 -07:00
|
|
|
dir = ecore_file_dir_get(file->path);
|
2009-08-27 19:25:13 -07:00
|
|
|
|
2009-09-17 23:33:33 -07:00
|
|
|
if (dir)
|
2009-08-27 19:25:13 -07:00
|
|
|
{
|
2010-04-25 04:00:53 -07:00
|
|
|
if (!getcwd(cwd, sizeof(cwd)))
|
|
|
|
return 0;
|
|
|
|
if (chdir(dir))
|
|
|
|
return 0;
|
2010-04-20 10:48:21 -07:00
|
|
|
|
2009-08-27 19:25:13 -07:00
|
|
|
tmp = E_NEW(Evry_Item_App, 1);
|
2009-09-17 23:33:33 -07:00
|
|
|
tmp->file = evry_conf->cmd_terminal;
|
|
|
|
|
2009-08-27 19:25:13 -07:00
|
|
|
ret = evry_util_exec_app(EVRY_ITEM(tmp), NULL);
|
|
|
|
E_FREE(tmp);
|
2009-09-17 23:33:33 -07:00
|
|
|
E_FREE(dir);
|
2010-04-25 04:00:53 -07:00
|
|
|
if (chdir(cwd))
|
|
|
|
return 0;
|
2009-08-27 19:25:13 -07:00
|
|
|
}
|
2010-04-20 10:48:21 -07:00
|
|
|
|
2009-08-27 19:25:13 -07:00
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2010-04-25 09:26:13 -07:00
|
|
|
|
|
|
|
static int
|
|
|
|
_file_trash_action(Evry_Action *act)
|
|
|
|
{
|
2010-04-29 08:20:12 -07:00
|
|
|
Efreet_Uri *euri;
|
2010-04-26 11:21:09 -07:00
|
|
|
int ok = 0;
|
2010-04-27 20:22:40 -07:00
|
|
|
int force = (EVRY_ITEM_DATA_INT_GET(act) == ACT_DELETE);
|
2010-04-29 14:42:03 -07:00
|
|
|
|
2010-04-28 05:58:24 -07:00
|
|
|
GET_FILE(file, act->it1.item);
|
2010-04-25 09:26:13 -07:00
|
|
|
|
2010-04-29 08:20:12 -07:00
|
|
|
if (!(evry_file_uri_get(file)))
|
|
|
|
return 0;
|
2010-04-25 18:04:43 -07:00
|
|
|
|
2010-04-29 08:20:12 -07:00
|
|
|
euri = efreet_uri_decode(file->url);
|
2010-04-29 14:42:03 -07:00
|
|
|
|
2010-04-29 08:20:12 -07:00
|
|
|
if (euri)
|
2010-04-25 09:26:13 -07:00
|
|
|
{
|
2010-04-29 08:20:12 -07:00
|
|
|
ok = efreet_trash_delete_uri(euri, force);
|
|
|
|
efreet_uri_free(euri);
|
2010-04-25 09:26:13 -07:00
|
|
|
}
|
|
|
|
|
2010-04-29 08:20:12 -07:00
|
|
|
return (ok > 0);
|
2010-04-25 09:26:13 -07:00
|
|
|
}
|
|
|
|
|
2010-04-25 12:37:30 -07:00
|
|
|
static int
|
|
|
|
_file_copy_action(Evry_Action *act)
|
|
|
|
{
|
2010-04-29 08:20:12 -07:00
|
|
|
GET_FILE(src, act->it1.item);
|
2010-04-28 05:58:24 -07:00
|
|
|
GET_FILE(dst, act->it2.item);
|
2010-04-25 12:37:30 -07:00
|
|
|
|
|
|
|
char buf[PATH_MAX];
|
2010-04-29 08:20:12 -07:00
|
|
|
char *ddst;
|
|
|
|
|
|
|
|
if (!(evry_file_path_get(src)))
|
|
|
|
return 0;
|
2010-04-26 11:21:09 -07:00
|
|
|
|
2010-04-29 08:20:12 -07:00
|
|
|
if (!(evry_file_path_get(dst)))
|
|
|
|
return 0;
|
2010-04-29 14:42:03 -07:00
|
|
|
|
2010-04-25 12:37:30 -07:00
|
|
|
if (!ecore_file_is_dir(dst->path))
|
2010-04-29 08:20:12 -07:00
|
|
|
ddst = ecore_file_dir_get(dst->path);
|
2010-04-25 12:37:30 -07:00
|
|
|
else
|
2010-04-29 08:20:12 -07:00
|
|
|
ddst = strdup(dst->path);
|
|
|
|
if (!ddst)
|
|
|
|
return 0;
|
2010-04-29 14:42:03 -07:00
|
|
|
|
2010-04-29 08:20:12 -07:00
|
|
|
snprintf(buf, sizeof(buf), "%s/%s", ddst, ecore_file_file_get(src->path));
|
|
|
|
free(ddst);
|
2010-04-25 12:37:30 -07:00
|
|
|
|
2010-04-29 08:20:12 -07:00
|
|
|
DBG(" %s -> %s\n", src->path, buf);
|
2010-04-29 14:42:03 -07:00
|
|
|
|
2010-04-27 20:22:40 -07:00
|
|
|
if (EVRY_ITEM_DATA_INT_GET(act) == ACT_COPY)
|
2010-04-25 12:37:30 -07:00
|
|
|
{
|
2010-04-29 08:20:12 -07:00
|
|
|
return ecore_file_cp(src->path, buf);
|
2010-04-25 12:37:30 -07:00
|
|
|
}
|
2010-04-27 20:22:40 -07:00
|
|
|
else if (EVRY_ITEM_DATA_INT_GET(act) == ACT_MOVE)
|
2010-04-25 12:37:30 -07:00
|
|
|
{
|
2010-04-29 08:20:12 -07:00
|
|
|
return ecore_file_mv(src->path, buf);
|
2010-04-25 12:37:30 -07:00
|
|
|
}
|
2010-04-26 11:21:09 -07:00
|
|
|
|
2010-04-29 08:20:12 -07:00
|
|
|
return 0;
|
2010-04-25 12:37:30 -07:00
|
|
|
}
|
|
|
|
|
2009-08-11 06:31:38 -07:00
|
|
|
static Eina_Bool
|
2010-04-24 16:07:13 -07:00
|
|
|
_plugins_init(void)
|
2009-06-21 03:31:38 -07:00
|
|
|
{
|
2010-04-25 12:37:30 -07:00
|
|
|
Evry_Action *act;
|
2010-04-26 11:21:09 -07:00
|
|
|
|
2010-04-08 04:55:15 -07:00
|
|
|
if (!evry_api_version_check(EVRY_API_VERSION))
|
|
|
|
return EINA_FALSE;
|
|
|
|
|
2010-04-29 08:20:12 -07:00
|
|
|
p1 = EVRY_PLUGIN_NEW(Evry_Plugin, N_("Files"), NULL,
|
|
|
|
EVRY_TYPE_FILE,
|
|
|
|
_begin, _cleanup, _fetch, NULL);
|
2010-04-27 20:22:40 -07:00
|
|
|
p1->config_path = "extensions/everything-files";
|
|
|
|
evry_plugin_register(p1, EVRY_PLUGIN_SUBJECT, 3);
|
|
|
|
/* p1->complete = &_complete; */
|
2010-04-26 11:21:09 -07:00
|
|
|
|
2010-04-29 08:20:12 -07:00
|
|
|
p2 = EVRY_PLUGIN_NEW(Evry_Plugin, N_("Files"), NULL,
|
|
|
|
EVRY_TYPE_FILE,
|
|
|
|
_begin, _cleanup, _fetch, NULL);
|
2010-04-27 20:22:40 -07:00
|
|
|
p2->config_path = "extensions/everything-files";
|
|
|
|
evry_plugin_register(p2, EVRY_PLUGIN_OBJECT, 1);
|
2009-06-21 03:31:38 -07:00
|
|
|
|
2010-04-29 08:20:12 -07:00
|
|
|
act = EVRY_ACTION_NEW(N_("Open Folder (EFM)"),
|
|
|
|
EVRY_TYPE_FILE, 0,
|
|
|
|
"folder-open",
|
|
|
|
_open_folder_action,
|
|
|
|
_open_folder_check);
|
2010-04-25 12:37:30 -07:00
|
|
|
evry_action_register(act, 0);
|
2010-04-26 11:21:09 -07:00
|
|
|
_actions = eina_list_append(_actions, act);
|
|
|
|
|
2010-04-29 08:20:12 -07:00
|
|
|
act = EVRY_ACTION_NEW(N_("Open Terminal here"),
|
|
|
|
EVRY_TYPE_FILE, 0,
|
|
|
|
"system-run",
|
2010-04-15 14:42:30 -07:00
|
|
|
_open_term_action, NULL);
|
2010-05-02 06:11:32 -07:00
|
|
|
act->remember_context = EINA_FALSE;
|
2010-04-25 12:37:30 -07:00
|
|
|
evry_action_register(act, 2);
|
|
|
|
_actions = eina_list_append(_actions, act);
|
2010-04-26 11:21:09 -07:00
|
|
|
|
2010-04-29 08:20:12 -07:00
|
|
|
act = EVRY_ACTION_NEW(N_("Move to Trash"),
|
|
|
|
EVRY_TYPE_FILE, 0,
|
|
|
|
"edit-delete",
|
2010-04-25 09:26:13 -07:00
|
|
|
_file_trash_action, NULL);
|
2010-05-02 06:11:32 -07:00
|
|
|
act->remember_context = EINA_FALSE;
|
2010-04-27 20:22:40 -07:00
|
|
|
EVRY_ITEM_DATA_INT_SET(act, ACT_TRASH);
|
2010-04-26 11:21:09 -07:00
|
|
|
evry_action_register(act, 2);
|
|
|
|
_actions = eina_list_append(_actions, act);
|
|
|
|
|
2010-04-29 16:11:53 -07:00
|
|
|
/* TODO ask if really want to delete !*/
|
|
|
|
/* act = EVRY_ACTION_NEW(N_("Delete"),
|
|
|
|
* EVRY_TYPE_FILE, 0,
|
|
|
|
* "list-remove",
|
|
|
|
* _file_trash_action, NULL);
|
|
|
|
* EVRY_ITEM_DATA_INT_SET(act, ACT_DELETE);
|
|
|
|
* evry_action_register(act, 2);
|
|
|
|
* _actions = eina_list_append(_actions, act); */
|
2010-04-25 12:37:30 -07:00
|
|
|
|
2010-04-29 08:20:12 -07:00
|
|
|
act = EVRY_ACTION_NEW(N_("Copy To ..."),
|
|
|
|
EVRY_TYPE_FILE, EVRY_TYPE_FILE,
|
|
|
|
"go-next",
|
2010-04-25 12:37:30 -07:00
|
|
|
_file_copy_action, NULL);
|
2010-04-29 14:42:03 -07:00
|
|
|
act->it2.subtype = EVRY_TYPE_DIR;
|
2010-05-02 06:11:32 -07:00
|
|
|
act->remember_context = EINA_FALSE;
|
2010-04-27 20:22:40 -07:00
|
|
|
EVRY_ITEM_DATA_INT_SET(act, ACT_COPY);
|
2010-04-25 12:37:30 -07:00
|
|
|
evry_action_register(act, 2);
|
2010-04-26 11:21:09 -07:00
|
|
|
_actions = eina_list_append(_actions, act);
|
2010-04-25 12:37:30 -07:00
|
|
|
|
2010-04-29 08:20:12 -07:00
|
|
|
act = EVRY_ACTION_NEW(N_("Move To ..."),
|
|
|
|
EVRY_TYPE_FILE, EVRY_TYPE_FILE,
|
|
|
|
"go-next",
|
2010-04-25 12:37:30 -07:00
|
|
|
_file_copy_action, NULL);
|
2010-04-29 14:42:03 -07:00
|
|
|
act->it2.subtype = EVRY_TYPE_DIR;
|
2010-05-02 06:11:32 -07:00
|
|
|
act->remember_context = EINA_FALSE;
|
2010-04-27 20:22:40 -07:00
|
|
|
EVRY_ITEM_DATA_INT_SET(act, ACT_MOVE);
|
2010-04-25 12:37:30 -07:00
|
|
|
evry_action_register(act, 2);
|
2010-04-26 11:21:09 -07:00
|
|
|
_actions = eina_list_append(_actions, act);
|
2010-04-25 09:26:13 -07:00
|
|
|
|
2009-08-11 06:31:38 -07:00
|
|
|
return EINA_TRUE;
|
2009-06-21 03:31:38 -07:00
|
|
|
}
|
2009-08-10 04:36:37 -07:00
|
|
|
|
2009-08-11 06:31:38 -07:00
|
|
|
static void
|
2010-04-24 16:07:13 -07:00
|
|
|
_plugins_shutdown(void)
|
2009-08-10 04:36:37 -07:00
|
|
|
{
|
2010-04-25 12:37:30 -07:00
|
|
|
Evry_Action *act;
|
2010-04-26 11:21:09 -07:00
|
|
|
|
2009-08-22 20:12:05 -07:00
|
|
|
EVRY_PLUGIN_FREE(p1);
|
|
|
|
EVRY_PLUGIN_FREE(p2);
|
2009-08-21 15:42:06 -07:00
|
|
|
|
2010-04-25 12:37:30 -07:00
|
|
|
EINA_LIST_FREE(_actions, act)
|
|
|
|
evry_action_free(act);
|
2009-08-10 04:36:37 -07:00
|
|
|
}
|
2009-08-11 06:31:38 -07:00
|
|
|
|
2010-04-10 13:05:57 -07:00
|
|
|
|
|
|
|
/***************************************************************************/
|
2010-04-16 11:36:28 -07:00
|
|
|
|
2010-04-20 10:48:21 -07:00
|
|
|
static E_Config_DD *conf_edd = NULL;
|
|
|
|
|
|
|
|
struct _E_Config_Dialog_Data
|
|
|
|
{
|
|
|
|
int show_homedir;
|
|
|
|
int show_recent;
|
|
|
|
int search_recent;
|
2010-05-01 18:09:49 -07:00
|
|
|
int search_cache;
|
2010-05-01 16:03:14 -07:00
|
|
|
int cache_dirs;
|
2010-04-20 10:48:21 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
static void *_create_data(E_Config_Dialog *cfd);
|
|
|
|
static void _free_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
|
|
|
|
static void _fill_data(E_Config_Dialog_Data *cfdata);
|
|
|
|
static Evas_Object *_basic_create(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata);
|
|
|
|
static int _basic_apply(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
|
|
|
|
|
|
|
|
static E_Config_Dialog *
|
|
|
|
_conf_dialog(E_Container *con, const char *params)
|
|
|
|
{
|
|
|
|
E_Config_Dialog *cfd = NULL;
|
|
|
|
E_Config_Dialog_View *v = NULL;
|
|
|
|
|
|
|
|
if (e_config_dialog_find("everything-files", "extensions/everything-files")) return NULL;
|
|
|
|
|
|
|
|
v = E_NEW(E_Config_Dialog_View, 1);
|
|
|
|
if (!v) return NULL;
|
|
|
|
|
|
|
|
v->create_cfdata = _create_data;
|
|
|
|
v->free_cfdata = _free_data;
|
|
|
|
v->basic.create_widgets = _basic_create;
|
|
|
|
v->basic.apply_cfdata = _basic_apply;
|
|
|
|
|
|
|
|
cfd = e_config_dialog_new(con, _("Everything Files"), "everything-files",
|
2010-04-30 05:55:01 -07:00
|
|
|
"extensions/everything-files", _module_icon, 0, v, NULL);
|
2010-04-20 10:48:21 -07:00
|
|
|
|
|
|
|
_conf->cfd = cfd;
|
|
|
|
return cfd;
|
|
|
|
}
|
|
|
|
|
2010-05-01 16:03:14 -07:00
|
|
|
static void
|
|
|
|
_clear_cache_cb(void *data, void *data2)
|
|
|
|
{
|
|
|
|
clear_cache = EINA_TRUE;
|
|
|
|
}
|
|
|
|
|
2010-04-20 10:48:21 -07:00
|
|
|
static Evas_Object *
|
|
|
|
_basic_create(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata)
|
|
|
|
{
|
|
|
|
Evas_Object *o = NULL, *of = NULL, *ow = NULL;
|
|
|
|
|
|
|
|
o = e_widget_list_add(evas, 0, 0);
|
|
|
|
|
|
|
|
of = e_widget_framelist_add(evas, _("General"), 0);
|
|
|
|
e_widget_framelist_content_align_set(of, 0.0, 0.0);
|
|
|
|
|
2010-05-01 16:03:14 -07:00
|
|
|
ow = e_widget_check_add(evas, _("Show home directory"),
|
2010-04-20 10:48:21 -07:00
|
|
|
&(cfdata->show_homedir));
|
|
|
|
e_widget_framelist_object_append(of, ow);
|
|
|
|
|
2010-05-01 16:03:14 -07:00
|
|
|
ow = e_widget_check_add(evas, _("Show recent files"),
|
2010-04-20 10:48:21 -07:00
|
|
|
&(cfdata->show_recent));
|
|
|
|
e_widget_framelist_object_append(of, ow);
|
|
|
|
|
2010-05-01 16:03:14 -07:00
|
|
|
ow = e_widget_check_add(evas, _("Search recent files"),
|
2010-04-20 10:48:21 -07:00
|
|
|
&(cfdata->search_recent));
|
|
|
|
e_widget_framelist_object_append(of, ow);
|
|
|
|
|
2010-05-01 18:09:49 -07:00
|
|
|
ow = e_widget_check_add(evas, _("Search cached files"),
|
|
|
|
&(cfdata->search_cache));
|
|
|
|
e_widget_framelist_object_append(of, ow);
|
|
|
|
|
2010-05-01 16:03:14 -07:00
|
|
|
ow = e_widget_check_add(evas, _("Cache visited directories"),
|
|
|
|
&(cfdata->cache_dirs));
|
|
|
|
e_widget_framelist_object_append(of, ow);
|
|
|
|
|
|
|
|
ow = e_widget_button_add(evas, _("Clear cache"), NULL,
|
|
|
|
_clear_cache_cb,
|
|
|
|
NULL, NULL);
|
|
|
|
e_widget_framelist_object_append(of, ow);
|
|
|
|
|
|
|
|
|
2010-04-20 10:48:21 -07:00
|
|
|
e_widget_list_object_append(o, of, 1, 1, 0.5);
|
|
|
|
return o;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void *
|
|
|
|
_create_data(E_Config_Dialog *cfd)
|
|
|
|
{
|
|
|
|
E_Config_Dialog_Data *cfdata = NULL;
|
|
|
|
|
|
|
|
cfdata = E_NEW(E_Config_Dialog_Data, 1);
|
|
|
|
_fill_data(cfdata);
|
|
|
|
return cfdata;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_free_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
|
|
|
|
{
|
|
|
|
_conf->cfd = NULL;
|
|
|
|
E_FREE(cfdata);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_fill_data(E_Config_Dialog_Data *cfdata)
|
|
|
|
{
|
|
|
|
#define C(_name) cfdata->_name = _conf->_name;
|
|
|
|
C(show_homedir);
|
|
|
|
C(show_recent);
|
|
|
|
C(search_recent);
|
2010-05-01 18:09:49 -07:00
|
|
|
C(search_cache);
|
2010-05-01 16:03:14 -07:00
|
|
|
C(cache_dirs);
|
2010-04-20 10:48:21 -07:00
|
|
|
#undef C
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
_basic_apply(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
|
|
|
|
{
|
|
|
|
#define C(_name) _conf->_name = cfdata->_name;
|
|
|
|
C(show_homedir);
|
|
|
|
C(show_recent);
|
|
|
|
C(search_recent);
|
2010-05-01 18:09:49 -07:00
|
|
|
C(search_cache);
|
2010-05-01 16:03:14 -07:00
|
|
|
C(cache_dirs);
|
2010-04-20 10:48:21 -07:00
|
|
|
#undef C
|
|
|
|
|
|
|
|
e_config_domain_save("module.everything-files", conf_edd, _conf);
|
|
|
|
e_config_save_queue();
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_conf_new(void)
|
|
|
|
{
|
|
|
|
_conf = E_NEW(Module_Config, 1);
|
|
|
|
_conf->version = (MOD_CONFIG_FILE_EPOCH << 16);
|
|
|
|
|
|
|
|
#define IFMODCFG(v) if ((_conf->version & 0xffff) < v) {
|
|
|
|
#define IFMODCFGEND }
|
|
|
|
|
|
|
|
/* setup defaults */
|
|
|
|
IFMODCFG(0x008d);
|
|
|
|
_conf->show_recent = 0;
|
|
|
|
_conf->show_homedir = 1;
|
|
|
|
_conf->search_recent = 1;
|
2010-05-01 16:03:14 -07:00
|
|
|
_conf->cache_dirs = 0;
|
2010-05-01 18:09:49 -07:00
|
|
|
_conf->search_cache = 0;
|
2010-04-20 10:48:21 -07:00
|
|
|
IFMODCFGEND;
|
|
|
|
|
|
|
|
_conf->version = MOD_CONFIG_FILE_VERSION;
|
|
|
|
|
|
|
|
e_config_domain_save("module.everything-files", conf_edd, _conf);
|
|
|
|
e_config_save_queue();
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_conf_free(void)
|
|
|
|
{
|
|
|
|
E_FREE(_conf);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_conf_init(E_Module *m)
|
|
|
|
{
|
|
|
|
e_configure_registry_category_add("extensions", 80, _("Extensions"),
|
|
|
|
NULL, "preferences-extensions");
|
|
|
|
|
|
|
|
e_configure_registry_item_add("extensions/everything-files", 110, _("Everything Files"),
|
2010-04-30 05:55:01 -07:00
|
|
|
NULL, _module_icon, _conf_dialog);
|
2010-04-20 10:48:21 -07:00
|
|
|
|
|
|
|
conf_edd = E_CONFIG_DD_NEW("Module_Config", Module_Config);
|
2010-04-26 11:21:09 -07:00
|
|
|
|
2010-04-20 10:48:21 -07:00
|
|
|
#undef T
|
|
|
|
#undef D
|
|
|
|
#define T Module_Config
|
|
|
|
#define D conf_edd
|
|
|
|
E_CONFIG_VAL(D, T, version, INT);
|
|
|
|
E_CONFIG_VAL(D, T, show_homedir, UCHAR);
|
|
|
|
E_CONFIG_VAL(D, T, show_recent, UCHAR);
|
|
|
|
E_CONFIG_VAL(D, T, search_recent, UCHAR);
|
2010-05-01 18:09:49 -07:00
|
|
|
E_CONFIG_VAL(D, T, search_cache, UCHAR);
|
2010-05-01 16:03:14 -07:00
|
|
|
E_CONFIG_VAL(D, T, cache_dirs, UCHAR);
|
2010-04-20 10:48:21 -07:00
|
|
|
#undef T
|
|
|
|
#undef D
|
|
|
|
|
|
|
|
_conf = e_config_domain_load("module.everything-files", conf_edd);
|
|
|
|
|
|
|
|
if (_conf && !evry_util_module_config_check(_("Everything Files"), _conf->version,
|
|
|
|
MOD_CONFIG_FILE_EPOCH, MOD_CONFIG_FILE_VERSION))
|
|
|
|
_conf_free();
|
|
|
|
|
|
|
|
if (!_conf) _conf_new();
|
|
|
|
|
|
|
|
_conf->module = m;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_conf_shutdown(void)
|
|
|
|
{
|
|
|
|
E_FREE(_conf);
|
|
|
|
|
|
|
|
E_CONFIG_DD_FREE(conf_edd);
|
|
|
|
}
|
|
|
|
|
|
|
|
/***************************************************************************/
|
|
|
|
|
|
|
|
static Eina_Bool active = EINA_FALSE;
|
|
|
|
|
|
|
|
EAPI E_Module_Api e_modapi =
|
2010-04-10 13:05:57 -07:00
|
|
|
{
|
|
|
|
E_MODULE_API_VERSION,
|
|
|
|
"everything-files"
|
|
|
|
};
|
|
|
|
|
|
|
|
EAPI void *
|
|
|
|
e_modapi_init(E_Module *m)
|
|
|
|
{
|
|
|
|
if (e_datastore_get("everything_loaded"))
|
2010-04-24 16:07:13 -07:00
|
|
|
active = _plugins_init();
|
2010-04-10 14:38:36 -07:00
|
|
|
|
2010-04-20 10:48:21 -07:00
|
|
|
_conf_init(m);
|
|
|
|
|
2010-04-25 04:00:53 -07:00
|
|
|
_mime_dir = eina_stringshare_add("inode/directory");
|
2010-04-26 11:21:09 -07:00
|
|
|
|
2010-04-20 10:48:21 -07:00
|
|
|
e_module_delayed_set(m, 1);
|
|
|
|
|
2010-04-10 13:05:57 -07:00
|
|
|
return m;
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI int
|
|
|
|
e_modapi_shutdown(E_Module *m)
|
|
|
|
{
|
|
|
|
if (active && e_datastore_get("everything_loaded"))
|
2010-04-24 16:07:13 -07:00
|
|
|
_plugins_shutdown();
|
2010-04-10 13:05:57 -07:00
|
|
|
|
2010-04-25 04:00:53 -07:00
|
|
|
eina_stringshare_del(_mime_dir);
|
2010-04-26 11:21:09 -07:00
|
|
|
|
2010-04-20 10:48:21 -07:00
|
|
|
_conf_shutdown();
|
|
|
|
|
2010-04-10 13:05:57 -07:00
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI int
|
|
|
|
e_modapi_save(E_Module *m)
|
|
|
|
{
|
2010-04-20 10:48:21 -07:00
|
|
|
e_config_domain_save("module.everything-files", conf_edd, _conf);
|
2010-04-10 13:05:57 -07:00
|
|
|
return 1;
|
|
|
|
}
|