|
41 | 41 |
|
42 | 42 | #ifdef USE_GTKSPELL |
43 | 43 | #include <gtkspell/gtkspell.h> |
44 | | -/* forward compatibility with GtkSpell3 */ |
45 | | -#if GTK_CHECK_VERSION(3, 0, 0) |
46 | | -#define GtkSpell GtkSpellChecker |
47 | | -#define gtkspell_set_language gtk_spell_checker_set_language |
48 | | -static GtkSpell *gtkspell_new_attach(GtkTextView *view, const gchar *lang, GError **error) |
49 | | -{ |
50 | | - GtkSpellChecker *speller = gtk_spell_checker_new(); |
51 | | - |
52 | | - if (! lang || gtk_spell_checker_set_language(speller, lang, error)) |
53 | | - gtk_spell_checker_attach(speller, view); |
54 | | - else |
55 | | - { |
56 | | - g_object_unref(g_object_ref_sink(speller)); |
57 | | - speller = NULL; |
58 | | - } |
59 | | - |
60 | | - return speller; |
61 | | -} |
62 | | -#endif |
63 | 44 | #endif |
64 | 45 |
|
65 | 46 | GeanyData *geany_data; |
@@ -1773,7 +1754,7 @@ vccommit_activated(G_GNUC_UNUSED GtkMenuItem * menuitem, G_GNUC_UNUSED gpointer |
1773 | 1754 | gint height; |
1774 | 1755 |
|
1775 | 1756 | #ifdef USE_GTKSPELL |
1776 | | - GtkSpell *speller = NULL; |
| 1757 | + GtkSpellChecker *speller = NULL; |
1777 | 1758 | GError *spellcheck_error = NULL; |
1778 | 1759 | #endif |
1779 | 1760 |
|
@@ -1833,13 +1814,22 @@ vccommit_activated(G_GNUC_UNUSED GtkMenuItem * menuitem, G_GNUC_UNUSED gpointer |
1833 | 1814 | gtk_paned_set_position(GTK_PANED(vpaned2), height * 50 / 100); |
1834 | 1815 |
|
1835 | 1816 | #ifdef USE_GTKSPELL |
1836 | | - speller = gtkspell_new_attach(GTK_TEXT_VIEW(messageView), EMPTY(lang) ? NULL : lang, &spellcheck_error); |
1837 | | - if (speller == NULL && spellcheck_error != NULL) |
| 1817 | + speller = gtk_spell_checker_new(); |
| 1818 | + |
| 1819 | + if (EMPTY(lang) || gtk_spell_checker_set_language(speller, lang, &spellcheck_error)) |
| 1820 | + gtk_spell_checker_attach(speller, GTK_TEXT_VIEW(messageView)); |
| 1821 | + else |
1838 | 1822 | { |
1839 | | - ui_set_statusbar(TRUE, _("Error initializing GeanyVC spell checking: %s. Check your configuration."), |
1840 | | - spellcheck_error->message); |
1841 | | - g_error_free(spellcheck_error); |
1842 | | - spellcheck_error = NULL; |
| 1823 | + if (spellcheck_error != NULL) |
| 1824 | + { |
| 1825 | + ui_set_statusbar(TRUE, _("Error initializing GeanyVC spell checking: %s. Check your configuration."), |
| 1826 | + spellcheck_error->message); |
| 1827 | + g_error_free(spellcheck_error); |
| 1828 | + spellcheck_error = NULL; |
| 1829 | + } |
| 1830 | + |
| 1831 | + g_object_unref(g_object_ref_sink(speller)); |
| 1832 | + speller = NULL; |
1843 | 1833 | } |
1844 | 1834 | #endif |
1845 | 1835 |
|
|
0 commit comments