forked from enlightenment/enlightenment
parent
c418127adf
commit
25fc32e2bd
|
@ -5,6 +5,7 @@
|
||||||
/***************************************************
|
/***************************************************
|
||||||
TODO option for maximum items to cache
|
TODO option for maximum items to cache
|
||||||
TODO keep common list for recent file instances
|
TODO keep common list for recent file instances
|
||||||
|
FIXME
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "e.h"
|
#include "e.h"
|
||||||
|
@ -175,7 +176,6 @@ _scan_func(void *data)
|
||||||
{
|
{
|
||||||
Data *d = data;
|
Data *d = data;
|
||||||
Plugin *p = d->plugin;
|
Plugin *p = d->plugin;
|
||||||
char *filename;
|
|
||||||
struct dirent *dp;
|
struct dirent *dp;
|
||||||
Evry_Item_File *file;
|
Evry_Item_File *file;
|
||||||
char buf[4096];
|
char buf[4096];
|
||||||
|
@ -186,6 +186,8 @@ _scan_func(void *data)
|
||||||
|
|
||||||
while ((dp = readdir(d->dirp)))
|
while ((dp = readdir(d->dirp)))
|
||||||
{
|
{
|
||||||
|
is_dir = EINA_FALSE;
|
||||||
|
|
||||||
if ((dp->d_name[0] == '.') &&
|
if ((dp->d_name[0] == '.') &&
|
||||||
((dp->d_name[1] == '\0') ||
|
((dp->d_name[1] == '\0') ||
|
||||||
((dp->d_name[1] == '.') &&
|
((dp->d_name[1] == '.') &&
|
||||||
|
@ -210,8 +212,6 @@ _scan_func(void *data)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
is_dir = EINA_FALSE;
|
|
||||||
|
|
||||||
if (d->directory[1])
|
if (d->directory[1])
|
||||||
snprintf(buf, sizeof(buf), "%s/%s",
|
snprintf(buf, sizeof(buf), "%s/%s",
|
||||||
d->directory,
|
d->directory,
|
||||||
|
@ -239,13 +239,10 @@ _scan_func(void *data)
|
||||||
|
|
||||||
file = EVRY_ITEM_NEW(Evry_Item_File, p,
|
file = EVRY_ITEM_NEW(Evry_Item_File, p,
|
||||||
NULL, NULL, _item_free);
|
NULL, NULL, _item_free);
|
||||||
|
file->path = strdup(buf);
|
||||||
filename = strdup(dp->d_name);
|
EVRY_ITEM(file)->label = strdup(dp->d_name);
|
||||||
EVRY_ITEM(file)->label = filename;
|
|
||||||
EVRY_ITEM(file)->browseable = is_dir;
|
EVRY_ITEM(file)->browseable = is_dir;
|
||||||
d->files = eina_list_append(d->files, file);
|
d->files = eina_list_append(d->files, file);
|
||||||
|
|
||||||
file->path = strdup(buf);
|
|
||||||
}
|
}
|
||||||
closedir(d->dirp);
|
closedir(d->dirp);
|
||||||
}
|
}
|
||||||
|
@ -266,8 +263,7 @@ _scan_mime_func(void *data)
|
||||||
ecore_file_is_dir(file->path))
|
ecore_file_is_dir(file->path))
|
||||||
EVRY_ITEM(file)->browseable = EINA_TRUE;
|
EVRY_ITEM(file)->browseable = EINA_TRUE;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
if (!file->mime)
|
|
||||||
file->mime = _mime_unknown;
|
file->mime = _mime_unknown;
|
||||||
|
|
||||||
if (cnt++ > MAX_ITEMS * d->run_cnt) break;
|
if (cnt++ > MAX_ITEMS * d->run_cnt) break;
|
||||||
|
@ -1385,7 +1381,7 @@ _plugins_init(const Evry_API *api)
|
||||||
|
|
||||||
_mime_dir = eina_stringshare_add("inode/directory");
|
_mime_dir = eina_stringshare_add("inode/directory");
|
||||||
_mime_mount = eina_stringshare_add("inode/mountpoint");
|
_mime_mount = eina_stringshare_add("inode/mountpoint");
|
||||||
_mime_mount = eina_stringshare_add("unknown");
|
_mime_unknown = eina_stringshare_add("unknown");
|
||||||
|
|
||||||
#define ACTION_NEW(_name, _type2, _icon, _act, _check, _register) \
|
#define ACTION_NEW(_name, _type2, _icon, _act, _check, _register) \
|
||||||
act = EVRY_ACTION_NEW(_name, EVRY_TYPE_FILE, _type2, _icon, _act, _check); \
|
act = EVRY_ACTION_NEW(_name, EVRY_TYPE_FILE, _type2, _icon, _act, _check); \
|
||||||
|
|
Loading…
Reference in New Issue