[gnome-text-editor] app: add action to clear history



commit 5498a74a0ce99a2235a624d1621ff352e9ca3257
Author: Christian Hergert <chergert redhat com>
Date:   Fri Jan 28 12:34:07 2022 -0800

    app: add action to clear history

 src/editor-application-actions.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)
---
diff --git a/src/editor-application-actions.c b/src/editor-application-actions.c
index ee5a19a..13faa26 100644
--- a/src/editor-application-actions.c
+++ b/src/editor-application-actions.c
@@ -322,6 +322,18 @@ editor_application_actions_remove_recent_cb (GSimpleAction *action,
   _editor_session_forget (EDITOR_SESSION_DEFAULT, file, draft_id);
 }
 
+static void
+editor_application_actions_clear_history (GSimpleAction *action,
+                                          GVariant      *param,
+                                          gpointer       user_data)
+{
+  EditorApplication *self = user_data;
+
+  g_assert (EDITOR_IS_APPLICATION (self));
+
+  _editor_session_clear_history (self->session);
+}
+
 void
 _editor_application_actions_init (EditorApplication *self)
 {
@@ -331,6 +343,7 @@ _editor_application_actions_init (EditorApplication *self)
     { "help", editor_application_actions_help_cb },
     { "quit", editor_application_actions_quit },
     { "remove-recent", editor_application_actions_remove_recent_cb, "(ss)" },
+    { "clear-history", editor_application_actions_clear_history },
   };
   g_autoptr(GPropertyAction) style_scheme = NULL;
 


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