forked from enlightenment/efl
parent
626a99a438
commit
5c0aaab8f1
|
@ -152,21 +152,15 @@ efreet_mime_type_get(const char *file)
|
|||
if ((type = efreet_mime_special_check(file)))
|
||||
return type;
|
||||
|
||||
/*
|
||||
* Check magics with priority > 80
|
||||
*/
|
||||
/* Check magics with priority > 80 */
|
||||
if ((type = efreet_mime_magic_check_priority(file, 0, 80)))
|
||||
return type;
|
||||
|
||||
/*
|
||||
* Check globs
|
||||
*/
|
||||
/* Check globs */
|
||||
if ((type = efreet_mime_globs_type_get(file)))
|
||||
return type;
|
||||
|
||||
/*
|
||||
* Check rest of magics
|
||||
*/
|
||||
/* Check rest of magics */
|
||||
if ((type = efreet_mime_magic_check_priority(file, 80, 0)))
|
||||
return type;
|
||||
|
||||
|
@ -200,8 +194,7 @@ efreet_mime_type_icon_get(const char *mime, const char *theme, const char *size)
|
|||
pp = p;
|
||||
while (*pp)
|
||||
{
|
||||
if (*pp == '/')
|
||||
*pp = '-';
|
||||
if (*pp == '/') *pp = '-';
|
||||
pp++;
|
||||
}
|
||||
ecore_list_append(icons, p);
|
||||
|
@ -236,7 +229,6 @@ efreet_mime_type_icon_get(const char *mime, const char *theme, const char *size)
|
|||
|
||||
/* Search for icons using list */
|
||||
icon = efreet_icon_list_find(theme, icons, size);
|
||||
|
||||
ecore_list_destroy(icons);
|
||||
|
||||
return icon;
|
||||
|
@ -266,9 +258,7 @@ efreet_mime_globs_type_get(const char *file)
|
|||
const char *s;
|
||||
char *ext, *mime;
|
||||
|
||||
/*
|
||||
* Check in the extension hash for the type
|
||||
*/
|
||||
/* Check in the extension hash for the type */
|
||||
ext = strchr(file, '.');
|
||||
if (ext)
|
||||
{
|
||||
|
@ -284,9 +274,7 @@ efreet_mime_globs_type_get(const char *file)
|
|||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Fallback to the other globs if not found
|
||||
*/
|
||||
/* Fallback to the other globs if not found */
|
||||
ecore_list_first_goto(globs);
|
||||
while ((g = ecore_list_next(globs)))
|
||||
{
|
||||
|
@ -602,14 +590,13 @@ efreet_mime_fallback_check(const char *file)
|
|||
char buf[32];
|
||||
int i;
|
||||
|
||||
if (!(f = fopen(file, "r")))
|
||||
return NULL;
|
||||
if (!(f = fopen(file, "r"))) return NULL;
|
||||
|
||||
i = fread(buf, 1, sizeof(buf), f);
|
||||
fclose(f);
|
||||
|
||||
if (i == 0)
|
||||
return "application/octet-stream";
|
||||
if (i == 0) return "application/octet-stream";
|
||||
|
||||
/*
|
||||
* Check for ASCII control characters in the first 32 bytes.
|
||||
* Line Feeds, carriage returns, and tabs are ignored as they are
|
||||
|
@ -1105,7 +1092,6 @@ efreet_mime_magic_check_priority(const char *file,
|
|||
else if ((level > e->indent) && match)
|
||||
{
|
||||
fclose(f);
|
||||
|
||||
if (last_mime) return last_mime;
|
||||
}
|
||||
|
||||
|
|
|
@ -193,9 +193,7 @@ efreet_trash_ls(void)
|
|||
files = ecore_file_ls(buf);
|
||||
|
||||
while (infofile = ecore_list_next(files))
|
||||
{
|
||||
printf("FILE: %s\n", infofile);
|
||||
}
|
||||
|
||||
return files;
|
||||
}
|
||||
|
@ -284,7 +282,6 @@ efreet_uri_escape(Efreet_Uri *uri)
|
|||
memset(dest, 0, PATH_MAX * 3 + 4);
|
||||
snprintf(dest, strlen(uri->protocol) + 4, "%s://", uri->protocol);
|
||||
|
||||
|
||||
/* Most app doesn't handle the hostname in the uri so it's put to NULL */
|
||||
for (i = strlen(uri->protocol) + 3, p = uri->path; *p != '\0'; p++, i++)
|
||||
{
|
||||
|
@ -311,6 +308,5 @@ efreet_uri_free(Efreet_Uri *uri)
|
|||
IF_RELEASE(uri->protocol);
|
||||
IF_RELEASE(uri->path);
|
||||
IF_RELEASE(uri->hostname);
|
||||
free(uri);
|
||||
uri = NULL;
|
||||
FREE(uri);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue