[anjuta/system-db-refactor] language-support-cpp-java: Only load packages in C/C++ mode



commit 5f6d7df4679a77d755d17ba65371327f7a1b1605
Author: Johannes Schmid <jhs gnome org>
Date:   Mon Feb 7 17:23:10 2011 +0100

    language-support-cpp-java: Only load packages in C/C++ mode

 plugins/language-support-cpp-java/plugin.c |   17 ++++++++++-------
 1 files changed, 10 insertions(+), 7 deletions(-)
---
diff --git a/plugins/language-support-cpp-java/plugin.c b/plugins/language-support-cpp-java/plugin.c
index 33309d0..f71b47d 100644
--- a/plugins/language-support-cpp-java/plugin.c
+++ b/plugins/language-support-cpp-java/plugin.c
@@ -553,7 +553,8 @@ install_support (CppJavaPlugin *lang_plugin)
 	init_file_type (lang_plugin);
 
 	
-	if (!g_str_equal (lang_plugin->current_language, "Vala"))
+	if (g_str_equal (lang_plugin->current_language, "C" ) ||
+	    g_str_equal (lang_plugin->current_language, "C++"))
 	{
 		CppJavaAssist *assist;
 
@@ -576,10 +577,10 @@ install_support (CppJavaPlugin *lang_plugin)
 			                  "drop", G_CALLBACK (on_glade_drop),
 			                  lang_plugin);
 		}
-	}	
 
-	lang_plugin->packages = cpp_packages_new (ANJUTA_PLUGIN (lang_plugin));
-	cpp_packages_load (lang_plugin->packages);
+		lang_plugin->packages = cpp_packages_new (ANJUTA_PLUGIN (lang_plugin));
+		cpp_packages_load(lang_plugin->packages);
+	}
 	
 	lang_plugin->support_installed = TRUE;
 }
@@ -617,9 +618,11 @@ uninstall_support (CppJavaPlugin *lang_plugin)
 	                                      on_glade_drop_possible, lang_plugin);
 	g_signal_handlers_disconnect_by_func (lang_plugin->current_editor,
 	                                      on_glade_drop, lang_plugin);
-
-	g_object_unref (lang_plugin->packages);
-	lang_plugin->packages = NULL;
+	if (lang_plugin->packages)
+	{
+		g_object_unref (lang_plugin->packages);
+		lang_plugin->packages = NULL;
+	}
 	lang_plugin->support_installed = FALSE;
 }
 



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