[Xfce4-commits] <ristretto:ristretto-0.0> Add functions to set build in and custom sorting functions
Stephan Arts
noreply at xfce.org
Sun Oct 23 19:20:29 CEST 2011
Updating branch refs/heads/ristretto-0.0
to 17c51cbd73d37e838a046941386cb688abeaeb5b (commit)
from 173a23b410e0bb5737bb736c816a5d9d2b164d12 (commit)
commit 17c51cbd73d37e838a046941386cb688abeaeb5b
Author: Stephan Arts <stephan at xfce.org>
Date: Thu Sep 3 20:11:10 2009 +0200
Add functions to set build in and custom sorting functions
ChangeLog | 12 +++++++++---
src/image_list.c | 18 ++++++++++++++++++
src/image_list.h | 11 ++++++++++-
3 files changed, 37 insertions(+), 4 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index fe70b4d..f733d75 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
2009-09-03 Stephan Arts <stephan at xfce.org>
+ * src/image_list.c,
+ src/image_list.h: Add functions to set buildin and custom sorting
+ functions
+
+2009-09-03 Stephan Arts <stephan at xfce.org>
+
* src/main_window.c: Fix typo in default accelerator of Rotate-Left
* src/image_list.c: Add skeleton-code for sorting on exif-date
@@ -18,12 +24,12 @@
2009-08-30 Stephan Arts <stephan at xfce.org>
- * src/main_window.c: Place navigation-bar and thumbnailbar next to eachother.
+ * src/main_window.c: Place navigation-bar and thumbnailbar next to eachother
2009-08-30 Stephan Arts <stephan at xfce.org>
- * src/main_window.c: Improve UI-sensitivity, do not make navigation-buttons and
- slideshow buttons sensitive when only one image is opened.
+ * src/main_window.c: Improve UI-sensitivity, do not make navigation-buttons
+ and slideshow buttons sensitive when only one image is opened.
2009-08-30 Stephan Arts <stephan at xfce.org>
diff --git a/src/image_list.c b/src/image_list.c
index 689733e..d2128e8 100644
--- a/src/image_list.c
+++ b/src/image_list.c
@@ -471,10 +471,28 @@ rstto_image_list_get_compare_func (RsttoImageList *image_list)
return (GCompareFunc)image_list->priv->cb_rstto_image_list_compare_func;
}
+void
+rstto_image_list_set_compare_func (RsttoImageList *image_list, GCompareFunc func)
+{
+ image_list->priv->cb_rstto_image_list_compare_func = func;
+}
+
/***********************/
/* Compare Functions */
/***********************/
+void
+rstto_image_list_set_sort_by_name (RsttoImageList *image_list)
+{
+ image_list->priv->cb_rstto_image_list_compare_func = (GCompareFunc)cb_rstto_image_list_image_name_compare_func;
+}
+
+void
+rstto_image_list_set_sort_by_date (RsttoImageList *image_list)
+{
+ image_list->priv->cb_rstto_image_list_compare_func = (GCompareFunc)cb_rstto_image_list_exif_date_compare_func;
+}
+
/**
* cb_rstto_image_list_image_name_compare_func:
* @a:
diff --git a/src/image_list.h b/src/image_list.h
index 49ec8a2..901831b 100644
--- a/src/image_list.h
+++ b/src/image_list.h
@@ -98,6 +98,14 @@ RsttoImageList *rstto_image_list_new ();
gint rstto_image_list_get_n_images (RsttoImageList *image_list);
gboolean rstto_image_list_add_file (RsttoImageList *image_list, GFile *file, GError **);
+
+GCompareFunc rstto_image_list_get_compare_func (RsttoImageList *image_list);
+void rstto_image_list_set_compare_func (RsttoImageList *image_list, GCompareFunc func);
+
+/** Built-in Sorting Functions */
+void rstto_image_list_set_sort_by_name (RsttoImageList *image_list);
+void rstto_image_list_set_sort_by_date (RsttoImageList *image_list);
+
RsttoImageListIter *rstto_image_list_get_iter (RsttoImageList *image_list);
/** Iter functions */
@@ -113,7 +121,8 @@ void rstto_image_list_remove_image (RsttoImageList *image_list, RsttoImag
gboolean rstto_image_list_iter_find_image (RsttoImageListIter *iter, RsttoImage *image);
RsttoImageListIter *rstto_image_list_iter_clone (RsttoImageListIter *iter);
-GCompareFunc rstto_image_list_get_compare_func (RsttoImageList *image_list);
+
+
G_END_DECLS
More information about the Xfce4-commits
mailing list