[latexila] Adapt code for GspellLanguage API changes



commit 92e6b33fe0731009268292e201dd009a3f28fbf0
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Fri Nov 27 18:35:48 2015 +0100

    Adapt code for GspellLanguage API changes

 configure.ac                |    2 +-
 src/document_view.vala      |   12 ++++++------
 src/preferences_dialog.vala |    8 ++++----
 3 files changed, 11 insertions(+), 11 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index d49692f..0bd496d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -28,7 +28,7 @@ LT_INIT
 GLIB_REQUIRED_VERSION="2.40"
 GTK_REQUIRED_VERSION="3.19.3"
 GTKSOURCEVIEW_REQUIRED_VERSION="3.18"
-GSPELL_REQUIRED_VERSION="0.2"
+GSPELL_REQUIRED_VERSION="0.2.2"
 VALA_REQUIRED_VERSION="0.26"
 GEE_REQUIRED_VERSION="0.10"
 
diff --git a/src/document_view.vala b/src/document_view.vala
index 9f0e7b6..cb5c037 100644
--- a/src/document_view.vala
+++ b/src/document_view.vala
@@ -251,14 +251,14 @@ public class DocumentView : Gtk.SourceView
     {
         Document doc = get_buffer () as Document;
 
-        string? lang_key = doc.get_metadata (METADATA_ATTRIBUTE_SPELL_LANGUAGE);
-        if (lang_key == null)
-            lang_key = _editor_settings.get_string ("spell-checking-language");
+        string? lang_code = doc.get_metadata (METADATA_ATTRIBUTE_SPELL_LANGUAGE);
+        if (lang_code == null)
+            lang_code = _editor_settings.get_string ("spell-checking-language");
 
-        if (lang_key[0] == '\0')
+        if (lang_code[0] == '\0')
             return null;
 
-        return Gspell.Language.from_key (lang_key);
+        return Gspell.Language.lookup (lang_code);
     }
 
     public void setup_inline_spell_checker ()
@@ -320,7 +320,7 @@ public class DocumentView : Gtk.SourceView
 
         unowned Gspell.Language? lang = _spell_checker.get_language ();
         if (lang != null)
-            doc.set_metadata (METADATA_ATTRIBUTE_SPELL_LANGUAGE, lang.to_key ());
+            doc.set_metadata (METADATA_ATTRIBUTE_SPELL_LANGUAGE, lang.get_code ());
         else
             doc.set_metadata (METADATA_ATTRIBUTE_SPELL_LANGUAGE, null);
     }
diff --git a/src/preferences_dialog.vala b/src/preferences_dialog.vala
index 8a2f0f1..3f1aaf9 100644
--- a/src/preferences_dialog.vala
+++ b/src/preferences_dialog.vala
@@ -309,7 +309,7 @@ public class PreferencesDialog : Dialog
             if (selected_lang != null)
             {
                 editor_settings.set_string ("spell-checking-language",
-                    selected_lang.to_key ());
+                    selected_lang.get_code ());
             }
             else
                 editor_settings.set_string ("spell-checking-language", "");
@@ -331,9 +331,9 @@ public class PreferencesDialog : Dialog
         Gspell.LanguageChooserButton spell_language_button)
     {
         unowned Gspell.Language? lang = null;
-        string lang_key = editor_settings.get_string ("spell-checking-language");
-        if (lang_key[0] != '\0')
-            lang = Gspell.Language.from_key (lang_key);
+        string lang_code = editor_settings.get_string ("spell-checking-language");
+        if (lang_code[0] != '\0')
+            lang = Gspell.Language.lookup (lang_code);
 
         Gspell.Checker checker = new Gspell.Checker (lang);
         spell_language_button.set_language (checker.get_language ());


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]