[gthumb: 34/57] [webalbums] fixed file sorting
- From: Paolo Bacchilega <paobac src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gthumb: 34/57] [webalbums] fixed file sorting
- Date: Sun, 20 Jun 2010 16:24:36 +0000 (UTC)
commit 9bfd4fc7919f08ae7be6ac8f877a27669f102728
Author: Paolo Bacchilega <paobac src gnome org>
Date: Wed Jun 16 21:50:54 2010 +0200
[webalbums] fixed file sorting
extensions/webalbums/gth-web-exporter.c | 19 +++++++++++++++----
1 files changed, 15 insertions(+), 4 deletions(-)
---
diff --git a/extensions/webalbums/gth-web-exporter.c b/extensions/webalbums/gth-web-exporter.c
index 02c2f58..757f6cb 100644
--- a/extensions/webalbums/gth-web-exporter.c
+++ b/extensions/webalbums/gth-web-exporter.c
@@ -2471,16 +2471,27 @@ image_loader_ready_cb (GthImageLoader *iloader,
}
+static int
+image_data_cmp (gconstpointer a,
+ gconstpointer b,
+ gpointer user_data)
+{
+ GthWebExporter *self = user_data;
+ ImageData *idata_a = (ImageData *) a;
+ ImageData *idata_b = (ImageData *) b;
+
+ return self->priv->sort_type->cmp_func (idata_a->file_data, idata_b->file_data);
+}
+
+
static void
load_current_file (GthWebExporter *self)
{
GthFileData *file_data;
if (self->priv->current_file == NULL) {
- /* FIXME
- if (self->priv->sort_type != NULL)
- self->priv->file_list = g_list_sort (self->priv->file_list, (GCompareFunc) self->priv->sort_type->cmp_func);
- */
+ if ((self->priv->sort_type != NULL) && (self->priv->sort_type->cmp_func != NULL))
+ self->priv->file_list = g_list_sort_with_data (self->priv->file_list, image_data_cmp, self);
if (self->priv->sort_inverse)
self->priv->file_list = g_list_reverse (self->priv->file_list);
save_html_files (self);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]