reducing complexity a little

This commit is contained in:
Andy Williams 2030-07-10 00:04:01 +01:00
parent 64862ac5f1
commit 21a5f2b1b4
1 changed files with 26 additions and 26 deletions

View File

@ -287,20 +287,20 @@ _edi_mainview_tab_stat_done(void *data, Eio_File *handler EINA_UNUSED, const Ein
const char *mime;
options = data;
if (S_ISREG(stat->mode))
if (!S_ISREG(stat->mode))
return;
mime = efreet_mime_type_get(options->path);
if (!strcasecmp(mime, "text/plain") || !strcasecmp(mime, "application/x-shellscript"))
options->type = "text";
else if (!strcasecmp(mime, "text/x-chdr") || !strcasecmp(mime, "text/x-csrc"))
options->type = "text"; // TODO make a code view
else if (!strncasecmp(mime, "image/", 6))
options->type = "image";
else
{
mime = efreet_mime_type_get(options->path);
if (!strcasecmp(mime, "text/plain") || !strcasecmp(mime, "application/x-shellscript"))
options->type = "text";
else if (!strcasecmp(mime, "text/x-chdr") || !strcasecmp(mime, "text/x-csrc"))
options->type = "text"; // TODO make a code view
else if (!strncasecmp(mime, "image/", 6))
options->type = "image";
else
{
_edi_mainview_choose_type(nf, options, _edi_mainview_choose_type_tab_cb);
return;
}
_edi_mainview_choose_type(nf, options, _edi_mainview_choose_type_tab_cb);
return;
}
_edi_mainview_item_tab_add(options);
@ -313,20 +313,20 @@ _edi_mainview_win_stat_done(void *data, Eio_File *handler EINA_UNUSED, const Ein
const char *mime;
options = data;
if (S_ISREG(stat->mode))
if (!S_ISREG(stat->mode))
return;
mime = efreet_mime_type_get(options->path);
if (!strcasecmp(mime, "text/plain") || !strcasecmp(mime, "application/x-shellscript"))
options->type = "text";
else if (!strcasecmp(mime, "text/x-chdr") || !strcasecmp(mime, "text/x-csrc"))
options->type = "text"; // TODO make a code view
else if (!strncasecmp(mime, "image/", 6))
options->type = "image";
else
{
mime = efreet_mime_type_get(options->path);
if (!strcasecmp(mime, "text/plain") || !strcasecmp(mime, "application/x-shellscript"))
options->type = "text";
else if (!strcasecmp(mime, "text/x-chdr") || !strcasecmp(mime, "text/x-csrc"))
options->type = "text"; // TODO make a code view
else if (!strncasecmp(mime, "image/", 6))
options->type = "image";
else
{
_edi_mainview_choose_type(nf, options, _edi_mainview_choose_type_win_cb);
return;
}
_edi_mainview_choose_type(nf, options, _edi_mainview_choose_type_win_cb);
return;
}
_edi_mainview_item_win_add(options);