Skip to content

Commit

Permalink
drop the clear function
Browse files Browse the repository at this point in the history
* gundo/gundo-sequence.c,
* gundo/gundo-sequence.h: drop the unused clear function
  • Loading branch information
Sven Herzberg committed Feb 25, 2009
1 parent dc2136e commit cb5bf87
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 38 deletions.
34 changes: 0 additions & 34 deletions gundo/gundo-sequence.c
Expand Up @@ -182,40 +182,6 @@ gundo_sequence_new (void)
}


/**
* gundo_sequence_clear:
* @seq: A #GundoSequence
*
* Free all actions in the undo sequence.
*/
void
gundo_sequence_clear(GundoSequence *seq) {
gboolean could_undo, could_redo;

g_return_if_fail(seq->group == NULL);

could_undo = gundo_history_can_undo(GUNDO_HISTORY(seq));
could_redo = gundo_history_can_redo(GUNDO_HISTORY(seq));

free_actions( seq->actions->len, (UndoAction*)seq->actions->data );
g_array_set_size( seq->actions, 0 );

seq->next_redo = 0;
if(seq->group) {
g_object_unref(G_OBJECT(seq->group));
seq->group = NULL;
}

if(could_undo) {
// now we definitely can't undo
g_object_notify(G_OBJECT(seq), "can-undo");
}
if(could_redo) {
// now we definitely can't redo
g_object_notify(G_OBJECT(seq), "can-redo");
}
}

static void
sequence_changed (GundoHistory* history)
{
Expand Down
7 changes: 3 additions & 4 deletions gundo/gundo-sequence.h
Expand Up @@ -43,10 +43,9 @@ typedef struct _GundoActionType GundoActionType;

GType gundo_sequence_get_type (void);
GundoSequence *gundo_sequence_new (void);
void gundo_sequence_clear (GundoSequence *seq );
void gundo_sequence_add_action (GundoSequence *seq,
const GundoActionType *type,
gpointer data );
void gundo_sequence_add_action (GundoSequence *seq,
const GundoActionType *type,
gpointer data);
void gundo_sequence_start_group(GundoSequence *seq );
void gundo_sequence_end_group (GundoSequence *seq );
void gundo_sequence_abort_group(GundoSequence *seq );
Expand Down

0 comments on commit cb5bf87

Please sign in to comment.