Skip to content

Commit

Permalink
fixes sidecar file grouping
Browse files Browse the repository at this point in the history
files with a number in extension were listed twice, it 
caused problems later
  • Loading branch information
nadvornik committed Sep 7, 2009
1 parent b319e56 commit 23f8333
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions src/filedata.c
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ gboolean file_data_check_changed_files(FileData *fd)

file_data_disconnect_sidecar_file(fd, sfd);
}
if (sfd) file_data_check_sidecars(sfd, FALSE); /* this will group the sidecars back together */
if (sfd) file_data_check_sidecars(sfd, NULL); /* this will group the sidecars back together */
file_data_send_notification(fd, NOTIFY_REREAD);
}
else
Expand Down Expand Up @@ -444,7 +444,7 @@ static GList *check_case_insensitive_ext(gchar *path)
GList *list = NULL;

sl = path_from_utf8(path);

extl = strrchr(sl, '.');
if (extl)
{
Expand All @@ -455,13 +455,25 @@ static GList *check_case_insensitive_ext(gchar *path)
for (i = 0; i < (1 << ext_len); i++)
{
struct stat st;
gboolean skip = FALSE;
for (j = 0; j < ext_len; j++)
{
if (i & (1 << (ext_len - 1 - j)))
{
extl[j] = g_ascii_tolower(extl[j]);
/* make sure the result does not contain duplicates */
if (extl[j] == g_ascii_toupper(extl[j]))
{
/* no change, probably a number, we have already tested this combination */
skip = TRUE;
break;
}
}
else
extl[j] = g_ascii_toupper(extl[j]);
}
if (skip) continue;

if (stat(sl, &st) == 0)
{
list = g_list_prepend(list, file_data_new_local(sl, &st, FALSE, FALSE));
Expand Down

0 comments on commit 23f8333

Please sign in to comment.