[Xfce4-commits] [apps/mousepad] 12/45: Remove uneeded code for view-auto-indent

noreply at xfce.org noreply at xfce.org
Fri Jul 11 13:03:17 CEST 2014


This is an automated email from the git hooks/post-receive script.

mbrush pushed a commit to branch master
in repository apps/mousepad.

commit aa8a283d29b33907da969d1f4ff65cd8ad364d9e
Author: Matthew Brush <mbrush at codebrainz.ca>
Date:   Sun Jul 6 17:21:53 2014 -0700

    Remove uneeded code for view-auto-indent
---
 mousepad/mousepad-document.c |    4 +---
 mousepad/mousepad-view.c     |   22 +---------------------
 mousepad/mousepad-view.h     |    5 -----
 mousepad/mousepad-window.c   |   17 +++++------------
 4 files changed, 7 insertions(+), 41 deletions(-)

diff --git a/mousepad/mousepad-document.c b/mousepad/mousepad-document.c
index a25d413..6da62fa 100644
--- a/mousepad/mousepad-document.c
+++ b/mousepad/mousepad-document.c
@@ -176,7 +176,7 @@ static void
 mousepad_document_init (MousepadDocument *document)
 {
   GtkTargetList        *target_list;
-  gboolean              word_wrap, auto_indent, insert_spaces;
+  gboolean              word_wrap, insert_spaces;
   gchar                *font_name, *color_scheme;
   gint                  tab_size;
   GtkSourceStyleScheme *scheme = NULL;
@@ -218,7 +218,6 @@ mousepad_document_init (MousepadDocument *document)
 
   /* read all the default settings */
   word_wrap = mousepad_settings_get_boolean ("view-word-wrap");
-  auto_indent = mousepad_settings_get_boolean ("view-auto-indent");
   font_name = mousepad_settings_get_string ("view-font-name");
   tab_size = mousepad_settings_get_int ("view-tab-size");
   insert_spaces = mousepad_settings_get_boolean ("view-insert-spaces");
@@ -227,7 +226,6 @@ mousepad_document_init (MousepadDocument *document)
   /* set all the settings */
   mousepad_document_set_word_wrap (document, word_wrap);
   mousepad_document_set_font (document, font_name);
-  mousepad_view_set_auto_indent (document->textview, auto_indent);
   mousepad_view_set_tab_size (document->textview, tab_size);
   mousepad_view_set_insert_spaces (document->textview, insert_spaces);
 
diff --git a/mousepad/mousepad-view.c b/mousepad/mousepad-view.c
index 2b6edcc..6597219 100644
--- a/mousepad/mousepad-view.c
+++ b/mousepad/mousepad-view.c
@@ -158,6 +158,7 @@ mousepad_view_init (MousepadView *view)
 
   /* bind Gsettings */
   mousepad_settings_bind ("view-line-numbers", view, "show-line-numbers", G_SETTINGS_BIND_DEFAULT);
+  mousepad_settings_bind ("view-auto-indent", view, "auto-indent", G_SETTINGS_BIND_DEFAULT);
 }
 
 
@@ -2281,17 +2282,6 @@ mousepad_view_indent (MousepadView *view,
 
 
 void
-mousepad_view_set_auto_indent (MousepadView *view,
-                               gboolean      auto_indent)
-{
-  mousepad_return_if_fail (MOUSEPAD_IS_VIEW (view));
-
-  gtk_source_view_set_auto_indent (GTK_SOURCE_VIEW (view), auto_indent);
-}
-
-
-
-void
 mousepad_view_set_tab_size (MousepadView *view,
                              gint          tab_size)
 {
@@ -2353,16 +2343,6 @@ mousepad_view_get_selection_length (MousepadView *view,
 
 
 
-gboolean
-mousepad_view_get_auto_indent (MousepadView *view)
-{
-  mousepad_return_val_if_fail (MOUSEPAD_IS_VIEW (view), FALSE);
-
-  return gtk_source_view_get_auto_indent (GTK_SOURCE_VIEW (view));
-}
-
-
-
 gint
 mousepad_view_get_tab_size (MousepadView *view)
 {
diff --git a/mousepad/mousepad-view.h b/mousepad/mousepad-view.h
index 0c6f4e4..aff9422 100644
--- a/mousepad/mousepad-view.h
+++ b/mousepad/mousepad-view.h
@@ -92,9 +92,6 @@ void            mousepad_view_duplicate                 (MousepadView      *view
 void            mousepad_view_indent                    (MousepadView      *view,
                                                          gint               type);
 
-void            mousepad_view_set_auto_indent           (MousepadView      *view,
-                                                         gboolean           auto_indent);
-
 void            mousepad_view_set_tab_size              (MousepadView      *view,
                                                          gint               tab_size);
 
@@ -106,8 +103,6 @@ gint            mousepad_view_get_selection_length      (MousepadView      *view
 
 gboolean        mousepad_view_get_line_numbers          (MousepadView      *view);
 
-gboolean        mousepad_view_get_auto_indent           (MousepadView      *view);
-
 gint            mousepad_view_get_tab_size              (MousepadView      *view);
 
 gboolean        mousepad_view_get_insert_spaces         (MousepadView      *view);
diff --git a/mousepad/mousepad-window.c b/mousepad/mousepad-window.c
index d5dcbed..d3fd22b 100644
--- a/mousepad/mousepad-window.c
+++ b/mousepad/mousepad-window.c
@@ -2255,7 +2255,7 @@ mousepad_window_update_actions (MousepadWindow *window)
       action = gtk_action_group_get_action (window->action_group, "line-numbers");
       gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action), active);
 
-      active = mousepad_view_get_auto_indent (document->textview);
+      active = mousepad_settings_get_boolean ("view-auto-indent");
       action = gtk_action_group_get_action (window->action_group, "auto-indent");
       gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action), active);
 
@@ -4779,18 +4779,11 @@ mousepad_window_action_auto_indent (GtkToggleAction *action,
   mousepad_return_if_fail (MOUSEPAD_IS_WINDOW (window));
   mousepad_return_if_fail (MOUSEPAD_IS_DOCUMENT (window->active));
 
-  /* leave when menu updates are locked */
-  if (lock_menu_updates == 0)
-    {
-      /* get the current state */
-      active = gtk_toggle_action_get_active (action);
-
-      /* save as the last auto indent mode */
-      mousepad_settings_set_boolean ("view-auto-indent", active);
+  /* get the current state */
+  active = gtk_toggle_action_get_active (action);
 
-      /* update the active document */
-      mousepad_view_set_auto_indent (window->active->textview, active);
-    }
+  /* save as the last auto indent mode */
+  mousepad_settings_set_boolean ("view-auto-indent", active);
 }
 
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list