Mercurial > geeqie
changeset 366:ce00494827e2
collection_load(): use booleans and always count failures (for debug).
author | zas_ |
---|---|
date | Mon, 14 Apr 2008 23:39:46 +0000 |
parents | addd05a425fe |
children | 3556cc825e59 |
files | src/collect-io.c |
diffstat | 1 files changed, 6 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/src/collect-io.c Mon Apr 14 23:29:54 2008 +0000 +++ b/src/collect-io.c Mon Apr 14 23:39:46 2008 +0000 @@ -67,9 +67,9 @@ guint fail = 0; gboolean changed = FALSE; CollectManagerEntry *entry = NULL; - guint flush = flags & COLLECTION_LOAD_FLUSH; - guint append = flags & COLLECTION_LOAD_APPEND; - guint only_geometry = flags & COLLECTION_LOAD_GEOMETRY; + guint flush = !!(flags & COLLECTION_LOAD_FLUSH); + guint append = !!(flags & COLLECTION_LOAD_APPEND); + guint only_geometry = !!(flags & COLLECTION_LOAD_GEOMETRY); if (!only_geometry) { @@ -159,10 +159,11 @@ g_free(buf); total++; - if (!valid && limit_failures) + if (!valid) { fail++; - if (fail > GQ_COLLECTION_FAIL_MIN && + if (limit_failures && + fail > GQ_COLLECTION_FAIL_MIN && fail * 100 / total > GQ_COLLECTION_FAIL_PERCENT) { printf("%d invalid filenames in unoffical collection file, closing: %s\n", fail, path);