From: Enlightenment S. <no-...@en...> - 2010-06-04 22:58:05
|
Log: and set _mime_unknown actually... Author: jeffdameth Date: 2010-06-04 15:57:58 -0700 (Fri, 04 Jun 2010) New Revision: 49462 Modified: trunk/e/src/modules/everything-files/e_mod_main.c Modified: trunk/e/src/modules/everything-files/e_mod_main.c =================================================================== --- trunk/e/src/modules/everything-files/e_mod_main.c 2010-06-04 22:24:46 UTC (rev 49461) +++ trunk/e/src/modules/everything-files/e_mod_main.c 2010-06-04 22:57:58 UTC (rev 49462) @@ -5,6 +5,7 @@ /*************************************************** TODO option for maximum items to cache TODO keep common list for recent file instances +FIXME */ #include "e.h" @@ -175,7 +176,6 @@ { Data *d = data; Plugin *p = d->plugin; - char *filename; struct dirent *dp; Evry_Item_File *file; char buf[4096]; @@ -186,6 +186,8 @@ while ((dp = readdir(d->dirp))) { + is_dir = EINA_FALSE; + if ((dp->d_name[0] == '.') && ((dp->d_name[1] == '\0') || ((dp->d_name[1] == '.') && @@ -210,8 +212,6 @@ continue; } - is_dir = EINA_FALSE; - if (d->directory[1]) snprintf(buf, sizeof(buf), "%s/%s", d->directory, @@ -239,13 +239,10 @@ file = EVRY_ITEM_NEW(Evry_Item_File, p, NULL, NULL, _item_free); - - filename = strdup(dp->d_name); - EVRY_ITEM(file)->label = filename; + file->path = strdup(buf); + EVRY_ITEM(file)->label = strdup(dp->d_name); EVRY_ITEM(file)->browseable = is_dir; d->files = eina_list_append(d->files, file); - - file->path = strdup(buf); } closedir(d->dirp); } @@ -266,8 +263,7 @@ ecore_file_is_dir(file->path)) EVRY_ITEM(file)->browseable = EINA_TRUE; } - - if (!file->mime) + else file->mime = _mime_unknown; if (cnt++ > MAX_ITEMS * d->run_cnt) break; @@ -1383,9 +1379,9 @@ if (!evry->api_version_check(EVRY_API_VERSION)) return EINA_FALSE; - _mime_dir = eina_stringshare_add("inode/directory"); - _mime_mount = eina_stringshare_add("inode/mountpoint"); - _mime_mount = eina_stringshare_add("unknown"); + _mime_dir = eina_stringshare_add("inode/directory"); + _mime_mount = eina_stringshare_add("inode/mountpoint"); + _mime_unknown = eina_stringshare_add("unknown"); #define ACTION_NEW(_name, _type2, _icon, _act, _check, _register) \ act = EVRY_ACTION_NEW(_name, EVRY_TYPE_FILE, _type2, _icon, _act, _check); \ |