*
* Return value must be freed with g_free()
*/
-gchar *collection_path(gchar *param)
+gchar *collection_path(const gchar *param)
{
gchar *path = NULL;
gchar *full_name = NULL;
*
*
*/
-gboolean is_collection(gchar *param)
+gboolean is_collection(const gchar *param)
{
gchar *name = NULL;
return FALSE;
}
+/**
+ * @brief Creates a text list of the image paths of the contents of a Collection
+ * @param[in] name The name of the collection, with or wihout extension
+ * @param[inout] contents A GString to which the image paths are appended
+ *
+ *
+ */
+void collection_contents(const gchar *name, GString **contents)
+{
+ gchar *path;
+ CollectionData *cd;
+ CollectInfo *ci;
+ GList *work;
+ FileData *fd;
+
+ if (is_collection(name))
+ {
+ path = collection_path(name);
+ cd = collection_new("");
+ collection_load(cd, path, COLLECTION_LOAD_APPEND);
+ work = cd->list;
+ while (work)
+ {
+ ci = work->data;
+ fd = ci->fd;
+ *contents = g_string_append(*contents, g_strdup(fd->path));
+ *contents = g_string_append(*contents, "\n");
+
+ work = work->next;
+ }
+ g_free(path);
+ collection_free(cd);
+ }
+}
+
/*
*-------------------------------------------------------------------
* please use these to actually add/remove stuff