[gedit/wip/spell-checking] spell-plugin: detach the view from the auto-spell



commit d8b01285e138f8d3e38390e08bfd8078cbaf3b5d
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Sun Jul 19 15:08:38 2015 +0200

    spell-plugin: detach the view from the auto-spell

 plugins/spell/gedit-spell-plugin.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)
---
diff --git a/plugins/spell/gedit-spell-plugin.c b/plugins/spell/gedit-spell-plugin.c
index 49e2c31..2298898 100644
--- a/plugins/spell/gedit-spell-plugin.c
+++ b/plugins/spell/gedit-spell-plugin.c
@@ -160,6 +160,12 @@ view_data_free (ViewData *data)
                g_object_unref (data->doc);
        }
 
+       if (data->auto_spell != NULL && data->view != NULL)
+       {
+               gedit_automatic_spell_checker_detach_view (data->auto_spell,
+                                                          GTK_TEXT_VIEW (data->view));
+       }
+
        g_clear_object (&data->plugin);
        g_clear_object (&data->view);
        g_clear_object (&data->auto_spell);
@@ -958,6 +964,12 @@ set_auto_spell (ViewData *data,
 {
        if (!active)
        {
+               if (data->auto_spell != NULL && data->view != NULL)
+               {
+                       gedit_automatic_spell_checker_detach_view (data->auto_spell,
+                                                                  GTK_TEXT_VIEW (data->view));
+               }
+
                g_clear_object (&data->auto_spell);
        }
        else if (data->auto_spell == NULL)


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