summaryrefslogtreecommitdiff
path: root/community/gtranslator/gtkspell3-port.patch
blob: e12e3a9d6c8d262eb62fb93cb692b51312b5d538 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
From cf33d8761dbfc7f6c8b27c3146efcad81f8fbde9 Mon Sep 17 00:00:00 2001
From: Kalev Lember <kalevlember@gmail.com>
Date: Sun, 13 Jan 2013 13:19:40 +0000
Subject: Port to gtkspell3

https://bugzilla.gnome.org/show_bug.cgi?id=691655
---
diff --git a/configure.ac b/configure.ac
index c1ba5b6..3fe9c46 100644
--- a/configure.ac
+++ b/configure.ac
@@ -84,7 +84,7 @@ GDL_REQUIRED=3.6.0
 GDA_REQUIRED=4.2.3
 PEAS_REQUIRED=1.2.0
 GDICT_OPTIONAL=0.11.0
-GTKSPELL_OPTIONAL=2.99.99
+GTKSPELL_OPTIONAL=3.0.0
 JSON_GLIB_OPTIONAL=0.12.0
 
 AC_ARG_WITH(gda,
@@ -174,14 +174,14 @@ dnl -------------------------------------------------------------------
 dnl Check for gtkspell >= 3.0 and use it if found
 dnl -------------------------------------------------------------------
 have_gtkspell=no
-AC_ARG_WITH(gtkspell3,
+AC_ARG_WITH(gtkspell,
             AS_HELP_STRING([--with-gtkspell],[Build with spell support]),,
             with_gtkspell=auto)
 
 if test x"$with_gtkspell" != "xno"
 then
         PKG_CHECK_MODULES([GTKSPELL], [
-                gtkspell-3.0 >= $GTKSPELL_OPTIONAL
+                gtkspell3-3.0 >= $GTKSPELL_OPTIONAL
         ], have_gtkspell=yes, have_gtkspell=no)
 
         if test x"$have_gtkspell" = "xyes"
@@ -339,7 +339,7 @@ if [ test x"$have_gtkspell" = "xyes" ]; then
 	echo "Building spell support: ................................YES"
 else
 	echo "Building spell support: ................................NO"
-		echo "        Requires gtkspell >= $GTKSPELL_OPTIONAL"
+		echo "        Requires gtkspell3 >= $GTKSPELL_OPTIONAL"
 fi
 
 echo "
diff --git a/src/gtr-view.c b/src/gtr-view.c
index 59f18e8..b9c4f6a 100644
--- a/src/gtr-view.c
+++ b/src/gtr-view.c
@@ -65,7 +65,7 @@ struct _GtrViewPrivate
   gchar *search_text;
 
 #ifdef HAVE_GTKSPELL
-  GtkSpell *spell;
+  GtkSpellChecker *spell;
 #endif
 };
 
@@ -75,11 +75,10 @@ gtr_attach_gtkspell (GtrView * view)
 {
   GError *error = NULL;
   gchar *errortext = NULL;
-  view->priv->spell = NULL;
 
-  view->priv->spell =
-    gtkspell_new_attach (GTK_TEXT_VIEW (view), NULL, &error);
-  if (view->priv->spell == NULL)
+  view->priv->spell = gtk_spell_checker_new ();
+  gtk_spell_checker_set_language (view->priv->spell, NULL, &error);
+  if (error)
     {
       g_warning (_("gtkspell error: %s\n"), error->message);
       errortext =
@@ -90,6 +89,11 @@ gtr_attach_gtkspell (GtrView * view)
       g_error_free (error);
       g_free (errortext);
     }
+  else
+    {
+      gtk_spell_checker_attach (view->priv->spell,
+                                GTK_TEXT_VIEW (view));
+    }
 }
 #endif
 
@@ -263,7 +267,7 @@ gtr_view_enable_spellcheck (GtrView * view, gboolean enable)
 #ifdef HAVE_GTKSPELL
       if (!view->priv->spell)
         return;
-      gtkspell_detach (view->priv->spell);
+      gtk_spell_checker_detach (view->priv->spell);
 #endif
     }
 }
--
cgit v0.9.1