$OpenBSD: patch-src_main_window_tools_vala,v 1.1 2016/01/18 12:50:52 ajacoutot Exp $

From 6c0c5f4f3616236cc9e1ee1cb8546635558331e4 Mon Sep 17 00:00:00 2001
From: Sebastien Wilmet <swilmet@gnome.org>
Date: Thu, 7 Jan 2016 15:47:39 +0100
Subject: DocumentView: rename set_*spell*_metadata() functions

From 306cc4fb6f0c9fa668758494aecc5ad41063280f Mon Sep 17 00:00:00 2001
From: Sebastien Wilmet <swilmet@gnome.org>
Date: Thu, 7 Jan 2016 14:12:38 +0100
Subject: spell: use GspellInlineCheckerText

--- src/main_window_tools.vala.orig	Fri Nov 27 18:31:52 2015
+++ src/main_window_tools.vala	Mon Jan 18 13:43:32 2016
@@ -64,7 +64,6 @@ public class MainWindowTools
 
         _editor_settings.changed["highlight-misspelled-words"].connect (() =>
         {
-            // Ensure that the active_view is updated first.
             if (_main_window.active_view != null)
                 _main_window.active_view.setup_inline_spell_checker ();
 
@@ -80,8 +79,9 @@ public class MainWindowTools
         ToggleAction spell_checking_action =
             _action_group.get_action ("ToolsInlineSpellChecker") as ToggleAction;
 
-        spell_checking_action.active =
-            _main_window.active_view.highlight_misspelled_words;
+        Gspell.InlineCheckerText inline_checker =
+            Gspell.text_view_get_inline_checker (_main_window.active_view as TextView);
+        spell_checking_action.active = inline_checker.enabled;
     }
 
     /* Sensitivity */
@@ -116,7 +116,7 @@ public class MainWindowTools
         // If the spell checker is used, save the language since it's probably
         // correct. If it isn't correct, the language will be changed and the
         // metadata will also be saved.
-        view.set_spell_language_metadata ();
+        view.save_spell_language_metadata ();
     }
 
     public void on_set_language (Gtk.Action action)
@@ -125,7 +125,7 @@ public class MainWindowTools
         return_if_fail (view != null);
 
         view.launch_spell_language_chooser_dialog ();
-        view.set_spell_language_metadata ();
+        view.save_spell_language_metadata ();
     }
 
     public void on_inline_spell_checker (Gtk.Action action)
@@ -135,17 +135,20 @@ public class MainWindowTools
 
         bool activate = (action as ToggleAction).active;
 
+        Gspell.InlineCheckerText inline_checker =
+            Gspell.text_view_get_inline_checker (view as TextView);
+
         // Save metadata only if property changes, because this function is
         // also called when update_inline_spell_checker_action_state() is
         // called.
-        if (view.highlight_misspelled_words != activate)
+        if (inline_checker.enabled != activate)
         {
-            view.highlight_misspelled_words = activate;
+            inline_checker.enabled = activate;
 
             update_inline_spell_checker_action_state ();
 
-            view.set_inline_spell_metadata ();
-            view.set_spell_language_metadata ();
+            view.save_inline_spell_metadata ();
+            view.save_spell_language_metadata ();
         }
     }
 }
