changeset 360:822040a51249

Increase collection_load() buffer size and do not activate error limiting for GQview collections.
author zas_
date Mon, 14 Apr 2008 22:45:53 +0000
parents 96fb24f948b7
children e0295af4f716
files src/collect-io.c
diffstat 1 files changed, 11 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/collect-io.c	Mon Apr 14 22:28:29 2008 +0000
+++ b/src/collect-io.c	Mon Apr 14 22:45:53 2008 +0000
@@ -26,6 +26,7 @@
 
 #define GQ_COLLECTION_FAIL_MIN     300
 #define GQ_COLLECTION_FAIL_PERCENT 98
+#define GQ_COLLECTION_READ_BUFSIZE 4096
 
 typedef struct _CollectManagerEntry CollectManagerEntry;
 
@@ -53,7 +54,7 @@
 
 static gint collection_load_private(CollectionData *cd, const gchar *path, CollectionLoadFlags flags)
 {
-	gchar s_buf[2048];
+	gchar s_buf[GQ_COLLECTION_READ_BUFSIZE];
 	FILE *f;
 	gchar *pathl;
 	gint official = FALSE;
@@ -85,6 +86,9 @@
 	if (!path && !cd->path) return FALSE;
 
 	if (!path) path = cd->path;
+	
+	if (debug) printf("collection load: append=%d flush=%d only_geometry=%d path=%s\n",
+			  append, flush, only_geometry, path);
 
 	/* load it */
 	pathl = path_from_utf8(path);
@@ -120,6 +124,12 @@
 					return TRUE;
 					}
 				}
+			else if (strncasecmp(s_buf, "GQview collection", strlen("GQview collection")) == 0)
+				{
+				/* As 2008/04/15 there is no difference between our collection file format
+				 * and GQview 2.1.5 collection file format so ignore failures as well. */
+				official = TRUE;
+				}
 			continue;
 			}
 		if (s_buf[0]=='\n') continue;