[gnome-builder] libide/gui: add vfunc for workspaces to save session state



commit d95afa0ff847ea9fb51fd89e0029cbb190162985
Author: Christian Hergert <chergert redhat com>
Date:   Thu Sep 15 01:19:55 2022 -0700

    libide/gui: add vfunc for workspaces to save session state

 src/libide/gui/ide-workspace-private.h | 1 -
 src/libide/gui/ide-workspace.c         | 3 +++
 src/libide/gui/ide-workspace.h         | 3 +++
 3 files changed, 6 insertions(+), 1 deletion(-)
---
diff --git a/src/libide/gui/ide-workspace-private.h b/src/libide/gui/ide-workspace-private.h
index 5d75ebb6d..6d69c41ff 100644
--- a/src/libide/gui/ide-workspace-private.h
+++ b/src/libide/gui/ide-workspace-private.h
@@ -22,7 +22,6 @@
 
 #include "ide-grid.h"
 #include "ide-panel-position.h"
-#include "ide-session.h"
 #include "ide-workspace.h"
 
 G_BEGIN_DECLS
diff --git a/src/libide/gui/ide-workspace.c b/src/libide/gui/ide-workspace.c
index d0c0f08f7..95d911be1 100644
--- a/src/libide/gui/ide-workspace.c
+++ b/src/libide/gui/ide-workspace.c
@@ -1701,6 +1701,9 @@ _ide_workspace_save_session (IdeWorkspace *self,
   g_return_if_fail (IDE_IS_WORKSPACE (self));
   g_return_if_fail (IDE_IS_SESSION (session));
 
+  if (IDE_WORKSPACE_GET_CLASS (self)->save_session)
+    IDE_WORKSPACE_GET_CLASS (self)->save_session (self, session);
+
   ide_extension_set_adapter_foreach (priv->addins,
                                      ide_workspace_addin_save_session_cb,
                                      session);
diff --git a/src/libide/gui/ide-workspace.h b/src/libide/gui/ide-workspace.h
index 724fd9071..033136d61 100644
--- a/src/libide/gui/ide-workspace.h
+++ b/src/libide/gui/ide-workspace.h
@@ -34,6 +34,7 @@
 #include "ide-page.h"
 #include "ide-pane.h"
 #include "ide-panel-position.h"
+#include "ide-session.h"
 
 G_BEGIN_DECLS
 
@@ -93,6 +94,8 @@ struct _IdeWorkspaceClass
                                           int                  *width,
                                           int                  *height);
   gboolean      (*can_search)            (IdeWorkspace         *self);
+  void          (*save_session)          (IdeWorkspace         *self,
+                                          IdeSession           *session);
 };
 
 IDE_AVAILABLE_IN_ALL


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