Mercurial > hg > forks > geeqie
changeset 2268:649f2c4bbfed
Reintroduce file_data_new_simple()
This was removed by Vladimir with
efc8096527d6f743d17c44b9982616a169973f39 to always check for sidecars.
However, the newly introduced function file_data_new_group() is very
expensive. Having it in collection (in sort manager) where the dirs of
that files have huge amount of files inside, that is simply blocking
whole geeqie.
It might be that the file_data_new_group() function need to be disarmed
on other places too.
author | Klaus Ethgen <Klaus@Ethgen.de> |
---|---|
date | Thu, 25 Feb 2016 16:48:22 +0100 |
parents | 63a479808748 |
children | a87a8d0af47c |
files | src/collect-io.c src/filedata.c |
diffstat | 2 files changed, 22 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/collect-io.c Thu Feb 25 16:46:32 2016 +0100 +++ b/src/collect-io.c Thu Feb 25 16:48:22 2016 +0100 @@ -162,7 +162,7 @@ if (!flush) changed |= collect_manager_process_action(entry, &buf); - valid = (buf[0] == G_DIR_SEPARATOR && collection_add_check(cd, file_data_new_group(buf), FALSE, TRUE)); + valid = (buf[0] == G_DIR_SEPARATOR && collection_add_check(cd, file_data_new_simple(buf), FALSE, TRUE)); if (!valid) DEBUG_1("collection invalid file: %s", buf); total++;
--- a/src/filedata.c Thu Feb 25 16:46:32 2016 +0100 +++ b/src/filedata.c Thu Feb 25 16:48:22 2016 +0100 @@ -414,6 +414,27 @@ return ret; } +FileData *file_data_new_simple(const gchar *path_utf8) +{ + struct stat st; + FileData *fd; + + if (!stat_utf8(path_utf8, &st)) + { + st.st_size = 0; + st.st_mtime = 0; + } + + fd = g_hash_table_lookup(file_data_pool, path_utf8); + if (!fd) fd = file_data_new(path_utf8, &st, TRUE); + if (fd) + { + file_data_ref(fd); + } + + return fd; +} + void init_exif_time_data(GList *files) { FileData *file;