[gthumb/gthumb-3-4] file store: added some debug functions



commit 46ba34c8a969559f3d464398c43b1e1adffc4c09
Author: Paolo Bacchilega <paobac src gnome org>
Date:   Sat Sep 17 18:37:49 2016 +0200

    file store: added some debug functions

 gthumb/gth-file-store.c |   24 ++++++++++++++++++++++++
 1 files changed, 24 insertions(+), 0 deletions(-)
---
diff --git a/gthumb/gth-file-store.c b/gthumb/gth-file-store.c
index b84c94f..50beb2a 100644
--- a/gthumb/gth-file-store.c
+++ b/gthumb/gth-file-store.c
@@ -197,6 +197,30 @@ _gth_file_store_free_rows (GthFileStore *file_store)
 }
 
 
+#ifdef DEBUG_FILE_STORE
+
+static void
+_print_rows (GthFileRow **rows, int n, char *info)
+{
+       int i;
+
+       g_print ("%s\n", info);
+       for (i = 0; i < n; i++) {
+               GthFileRow *row = rows[i];
+               g_print ("(%d) [%d] %s\n", i, row->pos, g_file_get_uri (row->file_data->file));
+       }
+}
+
+
+static void
+_gth_file_store_print (GthFileStore *file_store, char *info)
+{
+       _print_rows (file_store->priv->rows, file_store->priv->num_rows, info);
+}
+
+#endif
+
+
 static void
 gth_file_store_finalize (GObject *object)
 {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]