parent
5970c2685d
commit
70026fb099
|
@ -240,6 +240,7 @@ e_exehist_sorted_list_get(E_Exehist_Sort sort_type, int max)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
const char *exe;
|
const char *exe;
|
||||||
|
|
||||||
EINA_LIST_FOREACH(list, m, exe)
|
EINA_LIST_FOREACH(list, m, exe)
|
||||||
{
|
{
|
||||||
if (!exe) continue;
|
if (!exe) continue;
|
||||||
|
@ -437,9 +438,8 @@ _e_exehist_normalize_exe(const char *exe)
|
||||||
const char *ret;
|
const char *ret;
|
||||||
Eina_Bool flag = EINA_FALSE;
|
Eina_Bool flag = EINA_FALSE;
|
||||||
|
|
||||||
base = basename(exe);
|
base = basename((char *)exe);
|
||||||
if (base[0] == '.' && base[1] == '\0')
|
if ((base[0] == '.') && (base[1] == '\0')) return NULL;
|
||||||
return NULL;
|
|
||||||
|
|
||||||
base = strdup(base);
|
base = strdup(base);
|
||||||
cp = base;
|
cp = base;
|
||||||
|
@ -447,31 +447,26 @@ _e_exehist_normalize_exe(const char *exe)
|
||||||
{
|
{
|
||||||
if (isspace(*cp))
|
if (isspace(*cp))
|
||||||
{
|
{
|
||||||
if (!space)
|
if (!space) space = cp;
|
||||||
space = cp;
|
if (flag) flag = EINA_FALSE;
|
||||||
if (flag)
|
|
||||||
flag = EINA_FALSE;
|
|
||||||
}
|
}
|
||||||
else if (!flag)
|
else if (!flag)
|
||||||
{
|
{
|
||||||
|
|
||||||
/* usually a variable in the desktop exe field */
|
/* usually a variable in the desktop exe field */
|
||||||
if (space && *cp == '%')
|
if (space && *cp == '%')
|
||||||
flag = EINA_TRUE;
|
flag = EINA_TRUE;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
char lower = tolower(*cp);
|
char lower = tolower(*cp);
|
||||||
space = NULL;
|
|
||||||
|
|
||||||
if (lower != *cp)
|
space = NULL;
|
||||||
*cp = lower;
|
if (lower != *cp) *cp = lower;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
cp++;
|
cp++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (space)
|
if (space) *space = '\0';
|
||||||
*space = '\0';
|
|
||||||
|
|
||||||
ret = eina_stringshare_add(base);
|
ret = eina_stringshare_add(base);
|
||||||
free(base);
|
free(base);
|
||||||
|
@ -499,8 +494,8 @@ _e_exehist_sort_exe_cb(const void *d1, const void *d2)
|
||||||
ei1 = d1;
|
ei1 = d1;
|
||||||
ei2 = d2;
|
ei2 = d2;
|
||||||
|
|
||||||
if (!ei1 || !ei1->normalized_exe) return 1;
|
if ((!ei1) || (!ei1->normalized_exe)) return 1;
|
||||||
if (!ei2 || !ei2->normalized_exe) return -1;
|
if ((!ei2) || (!ei2->normalized_exe)) return -1;
|
||||||
|
|
||||||
return strcmp(ei1->normalized_exe, ei2->normalized_exe);
|
return strcmp(ei1->normalized_exe, ei2->normalized_exe);
|
||||||
}
|
}
|
||||||
|
@ -510,11 +505,8 @@ _e_exehist_sort_pop_cb(const void *d1, const void *d2)
|
||||||
{
|
{
|
||||||
const E_Exehist_Item *ei1, *ei2;
|
const E_Exehist_Item *ei1, *ei2;
|
||||||
|
|
||||||
ei1 = d1;
|
if (!(ei1 = d1)) return 1;
|
||||||
ei2 = d2;
|
if (!(ei2 = d2)) return -1;
|
||||||
|
|
||||||
if (!ei1) return 1;
|
|
||||||
if (!ei2) return -1;
|
|
||||||
|
|
||||||
return ei2->count - ei1->count;
|
return ei2->count - ei1->count;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue