forked from enlightenment/enlightenment
efm extension sorting now obeys directories first/last
SVN revision: 76122
This commit is contained in:
parent
9e990349cc
commit
22de6ede9b
|
@ -7676,22 +7676,6 @@ _e_fm2_cb_icon_sort(const void *data1, const void *data2)
|
||||||
if (ic1->info.label) l1 = (char *)ic1->info.label;
|
if (ic1->info.label) l1 = (char *)ic1->info.label;
|
||||||
l2 = (char *)ic2->info.file;
|
l2 = (char *)ic2->info.file;
|
||||||
if (ic2->info.label) l2 = (char *)ic2->info.label;
|
if (ic2->info.label) l2 = (char *)ic2->info.label;
|
||||||
if (ic1->sd->config->list.sort.extension)
|
|
||||||
{
|
|
||||||
int cmp;
|
|
||||||
const char *f1, *f2;
|
|
||||||
f1 = ecore_file_file_get(l1);
|
|
||||||
f1 = strrchr(f1, '.');
|
|
||||||
f2 = ecore_file_file_get(l2);
|
|
||||||
f2 = strrchr(f2, '.');
|
|
||||||
if (f1 && f2)
|
|
||||||
{
|
|
||||||
cmp = strcasecmp(f1, f2);
|
|
||||||
if (cmp) return cmp;
|
|
||||||
}
|
|
||||||
else if (f1) return 1;
|
|
||||||
else if (f2) return -1;
|
|
||||||
}
|
|
||||||
if (ic1->sd->config->list.sort.dirs.first)
|
if (ic1->sd->config->list.sort.dirs.first)
|
||||||
{
|
{
|
||||||
if ((S_ISDIR(ic1->info.statinfo.st_mode)) !=
|
if ((S_ISDIR(ic1->info.statinfo.st_mode)) !=
|
||||||
|
@ -7710,6 +7694,22 @@ _e_fm2_cb_icon_sort(const void *data1, const void *data2)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (ic1->sd->config->list.sort.extension)
|
||||||
|
{
|
||||||
|
int cmp;
|
||||||
|
const char *f1, *f2;
|
||||||
|
f1 = ecore_file_file_get(l1);
|
||||||
|
f1 = strrchr(f1, '.');
|
||||||
|
f2 = ecore_file_file_get(l2);
|
||||||
|
f2 = strrchr(f2, '.');
|
||||||
|
if (f1 && f2)
|
||||||
|
{
|
||||||
|
cmp = strcasecmp(f1, f2);
|
||||||
|
if (cmp) return cmp;
|
||||||
|
}
|
||||||
|
else if (f1) return 1;
|
||||||
|
else if (f2) return -1;
|
||||||
|
}
|
||||||
if (ic1->sd->config->list.sort.no_case)
|
if (ic1->sd->config->list.sort.no_case)
|
||||||
return strcasecmp(l1, l2);
|
return strcasecmp(l1, l2);
|
||||||
return strcmp(l1, l2);
|
return strcmp(l1, l2);
|
||||||
|
|
Loading…
Reference in New Issue