summaryrefslogtreecommitdiff
path: root/src/terminal-window.c
diff options
context:
space:
mode:
authorPablo Barciela <[email protected]>2019-12-26 17:38:17 +0100
committerZenWalker <[email protected]>2020-01-05 13:46:38 +0100
commit2aeda2e5225f48021d5b287552e15617a33b690e (patch)
treec7fc56ffd71fbc2c3e473348ecc4975f9a9f39bc /src/terminal-window.c
parent5cd597b04049206226fbfd4e5bb8016113c82952 (diff)
downloadmate-terminal-2aeda2e5225f48021d5b287552e15617a33b690e.tar.bz2
mate-terminal-2aeda2e5225f48021d5b287552e15617a33b690e.tar.xz
terminal-window: avoid to make new GSettings in every new window
use GSettings app instead
Diffstat (limited to 'src/terminal-window.c')
-rw-r--r--src/terminal-window.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/terminal-window.c b/src/terminal-window.c
index 1c56eae..1e2e478 100644
--- a/src/terminal-window.c
+++ b/src/terminal-window.c
@@ -52,8 +52,6 @@ struct _TerminalWindowPrivate
GtkUIManager *ui_manager;
guint ui_id;
- GSettings *global_settings;
-
GtkActionGroup *profiles_action_group;
guint profiles_ui_id;
@@ -2210,8 +2208,6 @@ terminal_window_init (TerminalWindow *window)
GtkStyleContext *context;
- priv->global_settings = g_settings_new (CONF_GLOBAL_SCHEMA);
-
context = gtk_widget_get_style_context (GTK_WIDGET (window));
gtk_style_context_add_class (context, "mate-terminal");
@@ -2230,9 +2226,9 @@ terminal_window_init (TerminalWindow *window)
gtk_notebook_set_show_tabs (GTK_NOTEBOOK (priv->notebook), FALSE);
gtk_notebook_set_group_name (GTK_NOTEBOOK (priv->notebook), I_("mate-terminal-window"));
g_signal_connect (priv->notebook, "button-press-event",
- G_CALLBACK (notebook_button_press_cb), priv->global_settings);
+ G_CALLBACK (notebook_button_press_cb), settings_global);
g_signal_connect (window, "key-press-event",
- G_CALLBACK (window_key_press_cb), priv->global_settings);
+ G_CALLBACK (window_key_press_cb), settings_global);
g_signal_connect (priv->notebook, "popup-menu",
G_CALLBACK (notebook_popup_menu_cb), window);
g_signal_connect_after (priv->notebook, "switch-page",
@@ -2417,7 +2413,6 @@ terminal_window_finalize (GObject *object)
TerminalWindowPrivate *priv = window->priv;
g_object_unref (priv->ui_manager);
- g_object_unref (priv->global_settings);
if (priv->confirm_close_dialog)
gtk_dialog_response (GTK_DIALOG (priv->confirm_close_dialog),
@@ -3585,7 +3580,7 @@ confirm_close_window_or_tab (TerminalWindow *window,
GTK_RESPONSE_DELETE_EVENT);
}
- do_confirm = g_settings_get_boolean (priv->global_settings, "confirm-window-close");
+ do_confirm = g_settings_get_boolean (settings_global, "confirm-window-close");
if (!do_confirm)
return FALSE;