[Github-comments] [geany-plugins] [GeanyVC] use compatible gtkspell on building for gtk3 (#342)
Colomban Wendling
notifications at xxxxx
Sat Feb 13 19:15:58 UTC 2016
If we wanted a simpler/less intrusive port, we could just do
```diff
diff --git a/geanyvc/src/geanyvc.c b/geanyvc/src/geanyvc.c
index a95a991..488f1f2 100644
--- a/geanyvc/src/geanyvc.c
+++ b/geanyvc/src/geanyvc.c
@@ -39,6 +39,25 @@
#ifdef USE_GTKSPELL
#include <gtkspell/gtkspell.h>
+/* forward compatibility with GtkSpell3 */
+# if GTK_CHECK_VERSION(3, 0, 0)
+# define GtkSpell GtkSpellChecker
+# define gtkspell_set_language gtk_spell_checker_set_language
+static GtkSpell *gtkspell_new_attach(GtkTextView *view, const gchar *lang, GError **error)
+{
+ GtkSpellChecker *speller = gtk_spell_checker_new();
+
+ if (! lang || gtk_spell_checker_set_language(speller, lang, error))
+ gtk_spell_checker_attach(speller, view);
+ else
+ {
+ g_object_unref(speller);
+ speller = NULL;
+ }
+
+ return speller;
+}
+# endif
#endif
GeanyData *geany_data;
```
in the code, and just keep the build system changes from this PR, which are just fine.
---
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany-plugins/pull/342#issuecomment-183728796
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.geany.org/pipermail/github-comments/attachments/20160213/1c09b7a8/attachment.html>
More information about the Github-comments
mailing list