[gnome-builder] libide/gui: keep original shortcuts model around for reuse
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] libide/gui: keep original shortcuts model around for reuse
- Date: Tue, 30 Aug 2022 00:05:47 +0000 (UTC)
commit 99997479e52ec0ef4416e27ba8ab97afe4e34d72
Author: Christian Hergert <chergert redhat com>
Date: Mon Aug 29 16:56:41 2022 -0700
libide/gui: keep original shortcuts model around for reuse
This is useful so we don't have to dive into the non-filtered subclass
when generating shortcut windows.
src/libide/gui/ide-workspace.c | 5 +++++
1 file changed, 5 insertions(+)
---
diff --git a/src/libide/gui/ide-workspace.c b/src/libide/gui/ide-workspace.c
index 911d46e9e..7478d15ab 100644
--- a/src/libide/gui/ide-workspace.c
+++ b/src/libide/gui/ide-workspace.c
@@ -72,6 +72,7 @@ typedef struct
/* GListModel of GtkShortcut w/ capture/bubble filters */
GtkFilterListModel *shortcut_model_bubble;
GtkFilterListModel *shortcut_model_capture;
+ GListModel *shortcuts;
/* A MRU that is updated as pages are focused. It allows us to move through
* the pages in the order they've been most-recently focused.
@@ -563,6 +564,8 @@ ide_workspace_dispose (GObject *object)
/* Unload shortcut models */
g_clear_object (&priv->shortcut_model_bubble);
g_clear_object (&priv->shortcut_model_capture);
+ g_clear_object (&priv->shortcuts);
+
/* Remove the workspace from the workbench MRU/etc */
group = gtk_window_get_group (GTK_WINDOW (self));
if (IDE_IS_WORKBENCH (group))
@@ -1430,6 +1433,8 @@ _ide_workspace_set_shortcut_model (IdeWorkspace *self,
g_return_if_fail (IDE_IS_WORKSPACE (self));
g_return_if_fail (G_IS_LIST_MODEL (model));
+ g_set_object (&priv->shortcuts, model);
+
if (bubble_filter == NULL)
bubble_filter = gtk_custom_filter_new (shortcut_phase_filter, GINT_TO_POINTER (GTK_PHASE_BUBBLE), NULL);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]