Mercurial > geeqie
comparison src/collect-io.c @ 283:e213fb025621
GQVIEW_* -> GQ_*
author | zas_ |
---|---|
date | Tue, 08 Apr 2008 23:16:12 +0000 |
parents | 9995c5fb202a |
children | d1f74154463e |
comparison
equal
deleted
inserted
replaced
282:c2cb12def9d6 | 283:e213fb025621 |
---|---|
19 #include "thumb.h" | 19 #include "thumb.h" |
20 #include "ui_fileops.h" | 20 #include "ui_fileops.h" |
21 #include "filelist.h" | 21 #include "filelist.h" |
22 | 22 |
23 | 23 |
24 #define GQVIEW_COLLECTION_MARKER "#Geeqie" | 24 #define GQ_COLLECTION_MARKER "#Geeqie" |
25 | 25 |
26 #define GQVIEW_COLLECTION_FAIL_MIN 300 | 26 #define GQ_COLLECTION_FAIL_MIN 300 |
27 #define GQVIEW_COLLECTION_FAIL_PERCENT 98 | 27 #define GQ_COLLECTION_FAIL_PERCENT 98 |
28 | 28 |
29 typedef struct _CollectManagerEntry CollectManagerEntry; | 29 typedef struct _CollectManagerEntry CollectManagerEntry; |
30 | 30 |
31 static void collection_load_thumb_step(CollectionData *cd); | 31 static void collection_load_thumb_step(CollectionData *cd); |
32 static gint collection_save_private(CollectionData *cd, const gchar *path); | 32 static gint collection_save_private(CollectionData *cd, const gchar *path); |
92 while (fgets(s_buf, sizeof(s_buf), f)) | 92 while (fgets(s_buf, sizeof(s_buf), f)) |
93 { | 93 { |
94 gchar *buf; | 94 gchar *buf; |
95 if (s_buf[0]=='#') | 95 if (s_buf[0]=='#') |
96 { | 96 { |
97 if (strncasecmp(s_buf, GQVIEW_COLLECTION_MARKER, strlen(GQVIEW_COLLECTION_MARKER)) == 0) | 97 if (strncasecmp(s_buf, GQ_COLLECTION_MARKER, strlen(GQ_COLLECTION_MARKER)) == 0) |
98 { | 98 { |
99 /* Looks like an official collection, allow unchecked input. | 99 /* Looks like an official collection, allow unchecked input. |
100 * All this does is allow adding files that may not exist, | 100 * All this does is allow adding files that may not exist, |
101 * which is needed for the collection manager to work. | 101 * which is needed for the collection manager to work. |
102 * Also unofficial files abort after too many invalid entries. | 102 * Also unofficial files abort after too many invalid entries. |
125 | 125 |
126 total++; | 126 total++; |
127 if (!valid && !official) | 127 if (!valid && !official) |
128 { | 128 { |
129 fail++; | 129 fail++; |
130 if (fail > GQVIEW_COLLECTION_FAIL_MIN && | 130 if (fail > GQ_COLLECTION_FAIL_MIN && |
131 fail * 100 / total > GQVIEW_COLLECTION_FAIL_PERCENT) | 131 fail * 100 / total > GQ_COLLECTION_FAIL_PERCENT) |
132 { | 132 { |
133 printf("Too many invalid filenames in unoffical collection file, closing: %s\n", path); | 133 printf("Too many invalid filenames in unoffical collection file, closing: %s\n", path); |
134 success = FALSE; | 134 success = FALSE; |
135 break; | 135 break; |
136 } | 136 } |
308 printf("failed to open collection (write) \"%s\"\n", tmp_path); | 308 printf("failed to open collection (write) \"%s\"\n", tmp_path); |
309 g_free(tmp_path); | 309 g_free(tmp_path); |
310 return FALSE; | 310 return FALSE; |
311 } | 311 } |
312 | 312 |
313 fprintf(f, "%s collection\n", GQVIEW_COLLECTION_MARKER); | 313 fprintf(f, "%s collection\n", GQ_COLLECTION_MARKER); |
314 fprintf(f, "#created with Geeqie version %s\n", VERSION); | 314 fprintf(f, "#created with Geeqie version %s\n", VERSION); |
315 | 315 |
316 collection_update_geometry(cd); | 316 collection_update_geometry(cd); |
317 if (cd->window_read) | 317 if (cd->window_read) |
318 { | 318 { |
673 { | 673 { |
674 GList *list = NULL; | 674 GList *list = NULL; |
675 GList *work; | 675 GList *work; |
676 gchar *base; | 676 gchar *base; |
677 | 677 |
678 base = g_strconcat(homedir(), "/", GQVIEW_RC_DIR_COLLECTIONS, NULL); | 678 base = g_strconcat(homedir(), "/", GQ_RC_DIR_COLLECTIONS, NULL); |
679 path_list(base, &list, NULL); | 679 path_list(base, &list, NULL); |
680 g_free(base); | 680 g_free(base); |
681 | 681 |
682 work = collection_manager_entry_list; | 682 work = collection_manager_entry_list; |
683 while (work && list) | 683 while (work && list) |