[gtk/wip/otte/undo: 7/17] undostack: Add a simple function to print the undo stack
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/otte/undo: 7/17] undostack: Add a simple function to print the undo stack
- Date: Mon, 18 Feb 2019 17:12:59 +0000 (UTC)
commit 131583f54b2b569b3ca4362a59e44602bc41d8fb
Author: Benjamin Otte <otte redhat com>
Date: Sun Aug 16 03:10:23 2015 +0200
undostack: Add a simple function to print the undo stack
The function is unused.
gtk/gtkundostack.c | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
---
diff --git a/gtk/gtkundostack.c b/gtk/gtkundostack.c
index 7caa931ca0..b2b72debad 100644
--- a/gtk/gtkundostack.c
+++ b/gtk/gtkundostack.c
@@ -134,6 +134,26 @@ gtk_undo_stack_clear (GtkUndoStack *stack)
g_list_model_items_changed (G_LIST_MODEL (stack), 0, len, 0);
}
+static void G_GNUC_UNUSED
+gtk_undo_stack_dump (GtkUndoStack *stack)
+{
+ GtkUndoStackPrivate *priv = gtk_undo_stack_get_instance_private (stack);
+ GSequenceIter *iter;
+
+ g_print ("Undo Stack @ %p (%u items)\n", stack, g_sequence_get_length (priv->commands));
+
+ for (iter = g_sequence_get_begin_iter (priv->commands);
+ !g_sequence_iter_is_end (iter);
+ iter = g_sequence_iter_next (iter))
+ {
+ GtkUndoCommand *command = g_sequence_get (iter);
+ char *desc;
+
+ desc = gtk_undo_command_describe (command);
+ g_print (" %s\n", desc);
+ }
+}
+
static void
gtk_undo_stack_push_internal (GtkUndoStack *stack,
GtkUndoCommand *command,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]