[gedit] view: do not depend on GSettings in show_line_numbers_menu()
- From: Sébastien Wilmet <swilmet src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gedit] view: do not depend on GSettings in show_line_numbers_menu()
- Date: Wed, 24 Jun 2015 16:54:14 +0000 (UTC)
commit c8cbf12fa41f49ad815721328197c8702a2b29ec
Author: Sébastien Wilmet <swilmet gnome org>
Date: Wed Jun 24 18:50:06 2015 +0200
view: do not depend on GSettings in show_line_numbers_menu()
So that show_line_numbers_menu() is reusable. The GSettings use is at
one place.
show_line_numbers_menu() sets the GtkSourceView property. And the
GSettings binding is now bidirectional.
gedit/gedit-view.c | 10 ++++------
1 files changed, 4 insertions(+), 6 deletions(-)
---
diff --git a/gedit/gedit-view.c b/gedit/gedit-view.c
index 9ba45da..9ac9490 100644
--- a/gedit/gedit-view.c
+++ b/gedit/gedit-view.c
@@ -215,7 +215,7 @@ gedit_view_constructed (GObject *object)
GEDIT_SETTINGS_DISPLAY_LINE_NUMBERS,
view,
"show-line-numbers",
- G_SETTINGS_BIND_GET);
+ G_SETTINGS_BIND_DEFAULT);
g_settings_bind (priv->editor_settings,
GEDIT_SETTINGS_AUTO_INDENT,
@@ -521,11 +521,9 @@ show_line_numbers_menu (GeditView *view,
gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item),
gtk_source_view_get_show_line_numbers (GTK_SOURCE_VIEW (view)));
- g_settings_bind (view->priv->editor_settings,
- GEDIT_SETTINGS_DISPLAY_LINE_NUMBERS,
- item,
- "active",
- G_SETTINGS_BIND_SET);
+ g_object_bind_property (item, "active",
+ view, "show-line-numbers",
+ G_BINDING_DEFAULT);
gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]