[anjuta] language-support-cpp-java: Avoid adding multiple provider instances to the same editor
- From: Johannes Schmid <jhs src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [anjuta] language-support-cpp-java: Avoid adding multiple provider instances to the same editor
- Date: Wed, 2 Dec 2009 09:44:24 +0000 (UTC)
commit 802c5a59548f6417e8a2dd63be28410ccbe80e24
Author: Johannes Schmid <jhs gnome org>
Date: Wed Dec 2 10:44:12 2009 +0100
language-support-cpp-java: Avoid adding multiple provider instances to the same editor
.../language-support-cpp-java/cpp-java-assist.c | 2 ++
plugins/language-support-cpp-java/plugin.c | 4 +++-
plugins/sourceview/sourceview.c | 4 +++-
3 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/plugins/language-support-cpp-java/cpp-java-assist.c b/plugins/language-support-cpp-java/cpp-java-assist.c
index a165747..e196820 100644
--- a/plugins/language-support-cpp-java/cpp-java-assist.c
+++ b/plugins/language-support-cpp-java/cpp-java-assist.c
@@ -839,6 +839,8 @@ static void
cpp_java_assist_uninstall (CppJavaAssist *assist)
{
g_return_if_fail (assist->priv->iassist != NULL);
+
+ DEBUG_PRINT ("uninstall called");
g_signal_handlers_disconnect_by_func (assist->priv->iassist, G_CALLBACK (on_editor_char_added), assist);
diff --git a/plugins/language-support-cpp-java/plugin.c b/plugins/language-support-cpp-java/plugin.c
index c2e6206..295ac91 100644
--- a/plugins/language-support-cpp-java/plugin.c
+++ b/plugins/language-support-cpp-java/plugin.c
@@ -1631,6 +1631,7 @@ install_support (CppJavaPlugin *lang_plugin)
IAnjutaSymbolManager,
NULL),
lang_plugin->prefs);
+ lang_plugin->assist = assist;
}
lang_plugin->support_installed = TRUE;
@@ -1660,8 +1661,9 @@ uninstall_support (CppJavaPlugin *lang_plugin)
}
if (lang_plugin->assist)
- {
+ {
g_object_unref (lang_plugin->assist);
+ lang_plugin->assist = NULL;
}
lang_plugin->support_installed = FALSE;
diff --git a/plugins/sourceview/sourceview.c b/plugins/sourceview/sourceview.c
index 0b02f49..378d246 100644
--- a/plugins/sourceview/sourceview.c
+++ b/plugins/sourceview/sourceview.c
@@ -2067,6 +2067,7 @@ iassist_add(IAnjutaEditorAssist* iassist,
gtk_source_completion_add_provider(completion,
GTK_SOURCE_COMPLETION_PROVIDER(sourceview_provider_new(sv, provider)),
NULL);
+ DEBUG_PRINT("Adding provider: %s", ianjuta_provider_get_name(provider, NULL));
}
static void
@@ -2076,7 +2077,7 @@ iassist_remove(IAnjutaEditorAssist* iassist,
{
Sourceview* sv = ANJUTA_SOURCEVIEW(iassist);
GtkSourceCompletion* completion = gtk_source_view_get_completion(GTK_SOURCE_VIEW(sv->priv->view));
- GList* node;
+ GList* node;
for (node = gtk_source_completion_get_providers(completion); node != NULL; node = g_list_next(node))
{
SourceviewProvider* prov;
@@ -2085,6 +2086,7 @@ iassist_remove(IAnjutaEditorAssist* iassist,
prov = SOURCEVIEW_PROVIDER(node->data);
if (prov->iprov == provider)
{
+ DEBUG_PRINT("Removing provider: %s", ianjuta_provider_get_name(provider, NULL));
gtk_source_completion_remove_provider(completion,
GTK_SOURCE_COMPLETION_PROVIDER(prov),
NULL);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]