snprintf(buf, sizeof(buf), "%s/%s", d->directory, filename);
else
snprintf(buf, sizeof(buf), "/%s", filename);
-
+
file->path = strdup(buf);
}
closedir(d->dirp);
_scan_mime_func(void *data)
{
Data *d = data;
- Plugin *p = d->plugin;
+ /* Plugin *p = d->plugin; */
Evry_Item_File *file;
Eina_List *l;
const char *mime;
Data *d = data;
Plugin *p = d->plugin;
Evry_Item_File *file;
- Evry_Item *item;
+ /* Evry_Item *item; */
if (!d->run_cnt)
{
Data *d = data;
Plugin *p = d->plugin;
Evry_Item *item;
- Evry_Item_File *f;
+ /* Evry_Item_File *f; */
char *filename, *path, *mime;
Eina_List *l, *ll, *lll;
History_Item *hi;
* _scan_cancel_func(d);
* return;
* } */
-
+
if (_conf->cache_dirs)
ht = evry->history_types_get(EVRY_TYPE_FILE);
{
if (!hi->data)
continue;
-
+
if (!file->mime)
file->mime = eina_stringshare_ref(hi->data);
if (!it || (it && !CHECK_TYPE(it, EVRY_TYPE_FILE)))
return NULL;
- GET_PLUGIN(parent, plugin);
+ /* GET_PLUGIN(parent, plugin); */
GET_FILE(file, it);
if (!evry->file_path_get(file) ||
Evry_Item_File *file;
EVRY_PLUGIN_ITEMS_CLEAR(p);
-
+
if (p->thread)
ecore_thread_cancel(p->thread);
p->thread = NULL;
_fetch(Evry_Plugin *plugin, const char *input)
{
GET_PLUGIN(p, plugin);
- Evry_Item_File *file;
+ /* Evry_Item_File *file; */
int len = (input ? strlen(input) : 0);
if (!p->command)
if (strncmp(p->directory, "/", 1))
return 0;
-
+
_free_files(p);
strncpy(buf, p->directory, PATH_MAX);
return cnt;
}
+
+#if 0
/* use thread only to not block ui for ecore_file_exists ... */
+
static void
_recentf_func(void *data)
{
Data *d = data;
- Plugin *p = d->plugin;
Eina_List *l;
Evry_Item_File *file;
- History_Item *hi;
EINA_LIST_FOREACH(d->files, l, file)
{
{
Data *d = data;
Plugin *p = d->plugin;
- Eina_List *l, *ll;
Evry_Item *it;
- const char *label;
EINA_LIST_FREE(d->files, it)
{
_item_fill(file);
- it->hi->data = eina_stringshare_ref(file->mime);
+ if (!it->hi->data)
+ it->hi->data = eina_stringshare_ref(file->mime);
p->files = eina_list_append(p->files, it);
}
p->thread = NULL;
E_FREE(d);
}
+#endif
static Eina_Bool
_recentf_items_add_cb(const Eina_Hash *hash, const void *key, void *data, void *fdata)
int match = 0;
EINA_LIST_FOREACH(he->items, l, hi2)
- {
- if (hi2->last_used > last_used)
+ if (hi2->last_used > last_used)
+ {
+ last_used = hi2->last_used;
hi = hi2;
- }
+ }
if (!hi)
return EINA_TRUE;
{
if (file->path == path)
{
- /* DBG("already added %s", path); */
eina_stringshare_del(path);
EVRY_ITEM(file)->fuzzy_match = -1;
return EINA_TRUE;
if (!(match = evry->fuzzy_match(label, p->input)) &&
!(match = evry->fuzzy_match(path, p->input)))
{
- /* DBG("not matched %s", path); */
eina_stringshare_del(path);
return EINA_TRUE;
}
- DBG("add %s", path);
-
file = EVRY_ITEM_NEW(Evry_Item_File, p, label, NULL, _item_free);
-
file->path = path;
if (hi->data)
- file->mime = eina_stringshare_ref(hi->data);
+ file->mime = eina_stringshare_add(hi->data);
EVRY_ITEM(file)->hi = hi;
EVRY_ITEM(file)->fuzzy_match = match;
EVRY_ITEM(file)->id = eina_stringshare_ref(file->path);
+ _item_fill(file);
+
+ if (!hi->data)
+ hi->data = eina_stringshare_ref(file->mime);
+
d->files = eina_list_append(d->files, file);
+ if (eina_list_count(d->files) > 100)
+ return EINA_FALSE;
+
return EINA_TRUE;
}
if (!it || (it && !CHECK_TYPE(it, EVRY_TYPE_FILE)))
return NULL;
- GET_PLUGIN(parent, plugin);
GET_FILE(file, it);
if (!evry->file_path_get(file) ||
IF_RELEASE(p->input);
- if (p->thread)
- ecore_thread_cancel(p->thread);
- p->thread = NULL;
+ /* if (p->thread)
+ * ecore_thread_cancel(p->thread);
+ * p->thread = NULL; */
if (input && isspace(input[len - 1]))
return !!(plugin->items);
if (len >= plugin->config->min_query)
{
- Eina_List *l;
- Evry_Item *it;
-
if (input)
p->input = eina_stringshare_add(input);
- EINA_LIST_FOREACH(p->files, l, it)
- it->fuzzy_match = -1;
-
if ((ht = evry->history_types_get(EVRY_TYPE_FILE)))
{
Data *d = E_NEW(Data, 1);
d->plugin = p;
eina_hash_foreach(ht->types, _recentf_items_add_cb, d);
- p->thread = ecore_thread_run(_recentf_func, _recentf_end_func,
- _recentf_cancel_func, d);
+ EINA_LIST_FREE(d->files, file)
+ p->files = eina_list_append(p->files, file);
+ E_FREE(d);
+
+ _recentf_append_files(p);
+
+ /* _recentf_end_func(d);
+ * p->thread = NULL; */
+ /* p->thread = ecore_thread_run(_recentf_func, _recentf_end_func,
+ * _recentf_cancel_func, d); */
}
return !!(plugin->items);
}
return EINA_TRUE;
evry = api;
-
+
if (!evry->api_version_check(EVRY_API_VERSION))
return EINA_FALSE;
p->config->top_level = EINA_FALSE;
p->config->min_query = 3;
}
-
+
PLUGIN_NEW(N_("Recent Files"), _module_icon,
_recentf_begin, _finish, _recentf_fetch);
p->browse = &_recentf_browse;
act->it2.subtype = EVRY_TYPE_DIR;
EVRY_ITEM_DATA_INT_SET(act, ACT_MOVE);
- ACTION_NEW(N_("Move to Trash"), 0, "edit-delete",
+ ACTION_NEW(N_("Move to Trash"), 0, "user-trash",
_file_trash_action, NULL);
EVRY_ITEM_DATA_INT_SET(act, ACT_TRASH);
+ /* ACTION_NEW(N_("Delete File"), 0, "user-trash",
+ * _file_trash_action, NULL);
+ * EVRY_ITEM_DATA_INT_SET(act, ACT_DELETE); */
+
ACTION_NEW(N_("Open Folder (EFM)"), 0, "folder-open",
_open_folder_action, _open_folder_check);
act->remember_context = EINA_TRUE;
if (!evry_module->active)
return;
-
+
eina_stringshare_del(_mime_dir);
eina_stringshare_del(_mime_mount);
if ((evry = e_datastore_get("everything_loaded")))
evry_module->active = _plugins_init(evry);
-
+
e_module_delayed_set(m, 1);
-
+
return m;
}
e_modapi_shutdown(E_Module *m)
{
_plugins_shutdown();
-
+
EVRY_MODULE_UNREGISTER(evry_module);
E_FREE(evry_module);
_conf_shutdown();
-
+
return 1;
}