From: Laurent Monin Date: Mon, 14 Apr 2008 23:39:46 +0000 (+0000) Subject: collection_load(): use booleans and always count failures (for debug). X-Git-Tag: v1.0.0~1437 X-Git-Url: http://geeqie.org/cgi-bin/gitweb.cgi?p=geeqie.git;a=commitdiff_plain;h=ec46e7a26e75c60f577a17dbdadddf5421c17ce1 collection_load(): use booleans and always count failures (for debug). --- diff --git a/src/collect-io.c b/src/collect-io.c index fa19228d..61433e05 100644 --- a/src/collect-io.c +++ b/src/collect-io.c @@ -67,9 +67,9 @@ static gint collection_load_private(CollectionData *cd, const gchar *path, Colle 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 @@ static gint collection_load_private(CollectionData *cd, const gchar *path, Colle 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);