[anjuta] project-manager: Fix several warnings



commit c105339d0266054765b6041b6deb34b3c5ace6a1
Author: SÃbastien Granjoux <seb sfo free fr>
Date:   Thu Jan 31 09:44:59 2013 +0100

    project-manager: Fix several warnings

 plugins/project-manager/dialogs.c      |   23 +++++++-----
 plugins/project-manager/plugin.c       |   62 +++++--------------------------
 plugins/project-manager/project-view.c |    6 +---
 plugins/project-manager/tree-data.c    |    3 +-
 4 files changed, 26 insertions(+), 68 deletions(-)
---
diff --git a/plugins/project-manager/dialogs.c b/plugins/project-manager/dialogs.c
index 9ed4811..ba3f485 100644
--- a/plugins/project-manager/dialogs.c
+++ b/plugins/project-manager/dialogs.c
@@ -566,7 +566,7 @@ pm_project_resize_properties_dialog (PropertiesTable *table)
 {
 	gint border_width, maximum_width, maximum_height;
 	GtkRequisition dialog, head, viewport, scrolledwindow_minimum, vscrollbar_minimum;
-	GtkWidget *vscrollbar = gtk_scrolled_window_get_vscrollbar (table->scrolledwindow);
+	GtkWidget *vscrollbar = gtk_scrolled_window_get_vscrollbar (GTK_SCROLLED_WINDOW (table->scrolledwindow));
 
 	gtk_widget_get_preferred_size (table->dialog, NULL, &dialog);
 	gtk_widget_get_preferred_size (table->head, NULL, &head);
@@ -655,9 +655,10 @@ on_change_project_backend (GtkButton *button,
 
 		if (backend != NULL)
 		{
-			const gchar *name;
+			gchar *name;
 			anjuta_plugin_description_get_locale_string (backend, "Anjuta Plugin", "Name", &name);
 			gtk_button_set_label (button, name);
+			g_free (name);
 			table->new_backend = backend;
 		}
 	}
@@ -738,10 +739,11 @@ update_properties (PropertiesTable *table)
 		backend = anjuta_pm_project_get_backend (table->project);
 		if (backend)
 		{
-			const gchar *name;
+			gchar *name;
 			
 			anjuta_plugin_description_get_locale_string (backend, "Anjuta Plugin", "Name", &name);
-			add_button (_("Backend:"), name, on_change_project_backend, table, table->head, &head_pos);
+			add_button (_("Backend:"), name, G_CALLBACK (on_change_project_backend), table, table->head, &head_pos);
+			g_free (name);
 		}
 	}
 
@@ -1175,7 +1177,7 @@ anjuta_pm_project_new_group (ProjectManagerPlugin *plugin, GtkWindow *parent, Gt
 				name = gtk_editable_get_chars (
 						GTK_EDITABLE (group_name_entry), 0, -1);
 
-				group = gbf_project_view_find_selected_state (GBF_PROJECT_VIEW (groups_view),
+				group = gbf_project_view_find_selected_state (GTK_TREE_VIEW (groups_view),
 				                                              ANJUTA_PROJECT_CAN_ADD_GROUP);
 				if (group)
 				{
@@ -1804,10 +1806,13 @@ static void
 on_new_library(GtkButton *button, gpointer user_data)
 {
 	ProjectManagerPlugin *plugin = ANJUTA_PLUGIN_PROJECT_MANAGER (user_data);
-	anjuta_pm_project_new_package (plugin,
-	                               get_plugin_parent_window (plugin),
-	                               NULL,
-	                               NULL);
+	GList *packages;
+	
+	packages = anjuta_pm_project_new_package (plugin,
+	                                          get_plugin_parent_window (plugin),
+	                                          NULL,
+	                                          NULL);
+	g_list_free (packages);
 }
 
 GList*
diff --git a/plugins/project-manager/plugin.c b/plugins/project-manager/plugin.c
index c5502c9..d497df0 100644
--- a/plugins/project-manager/plugin.c
+++ b/plugins/project-manager/plugin.c
@@ -460,38 +460,6 @@ change_project_backend (ProjectManagerPlugin *plugin, AnjutaPluginDescription *b
 /* GUI callbacks
  *---------------------------------------------------------------------------*/
 
-static gboolean
-on_refresh_idle (gpointer user_data)
-{
-	ProjectManagerPlugin *plugin;
-	AnjutaStatus *status;
-	GError *err = NULL;
-
-	plugin = ANJUTA_PLUGIN_PROJECT_MANAGER (user_data);
-
-	status = anjuta_shell_get_status (ANJUTA_PLUGIN (plugin)->shell, NULL);
-	anjuta_status_push (status, _("Refreshing symbol treeâ"));
-	anjuta_status_busy_push (status);
-
-	anjuta_pm_project_refresh (plugin->project, &err);
-	if (err)
-	{
-		anjuta_util_dialog_error (get_plugin_parent_window (plugin),
-								  _("Failed to refresh project: %s"),
-								  err->message);
-		g_error_free (err);
-	}
-	anjuta_status_busy_pop (status);
-	anjuta_status_pop (status);
-	return FALSE;
-}
-
-static void
-on_refresh (GtkAction *action, ProjectManagerPlugin *plugin)
-{
-	g_idle_add (on_refresh_idle, plugin);
-}
-
 static void
 on_properties (GtkAction *action, ProjectManagerPlugin *plugin)
 {
@@ -634,6 +602,7 @@ on_popup_new_package (GtkAction *action, ProjectManagerPlugin *plugin)
 	packages = anjuta_pm_project_new_package (plugin,
 										   get_plugin_parent_window (plugin),
 										   &selected_module, NULL);
+	g_list_free (packages);
 	update_operation_end (plugin, TRUE);
 }
 
@@ -657,14 +626,14 @@ static void
 on_popup_new_group (GtkAction *action, ProjectManagerPlugin *plugin)
 {
 	GtkTreeIter selected_group;
-	AnjutaProjectNode *new_group;
 
 	update_operation_begin (plugin);
 	gbf_project_view_get_first_selected (plugin->view, &selected_group);
 
-	new_group = anjuta_pm_project_new_group (plugin,
-										   get_plugin_parent_window (plugin),
-										   &selected_group, NULL);
+	anjuta_pm_project_new_group (plugin,
+	                             get_plugin_parent_window (plugin),
+	                             &selected_group, NULL);
+	
 	update_operation_end (plugin, TRUE);
 }
 
@@ -672,15 +641,14 @@ static void
 on_popup_new_target (GtkAction *action, ProjectManagerPlugin *plugin)
 {
 	GtkTreeIter selected_group;
-	AnjutaProjectNode *new_target;
 
 	update_operation_begin (plugin);
 	gbf_project_view_get_first_selected (plugin->view, &selected_group);
 
-	new_target = anjuta_pm_project_new_target (plugin,
-											 get_plugin_parent_window (plugin),
-											 &selected_group, NULL);
-
+	anjuta_pm_project_new_target (plugin,
+	                              get_plugin_parent_window (plugin),
+	                              &selected_group, NULL);
+	
 	update_operation_end (plugin, TRUE);
 }
 
@@ -1948,16 +1916,6 @@ get_node_from_file (const AnjutaProjectNode *root, GFile *file)
 	return node;
 }
 
-static AnjutaProjectNodeType
-get_element_type (ProjectManagerPlugin *plugin, GFile *element)
-{
-	AnjutaProjectNode *node;
-
-	node = gbf_project_view_get_node_from_file (plugin->view, ANJUTA_PROJECT_UNKNOWN,  element);
-
-	return node == NULL ? ANJUTA_PROJECT_UNKNOWN : anjuta_project_node_get_node_type (node);
-}
-
 static GList*
 iproject_manager_get_children (IAnjutaProjectManager *project_manager,
 							   GFile *parent,
@@ -2148,7 +2106,7 @@ iproject_manager_get_selected (IAnjutaProjectManager *project_manager,
 
 	node = gbf_project_view_find_selected (plugin->view,
 										   ANJUTA_PROJECT_GROUP);
-	if (node && anjuta_project_node_get_node_type (node) == GBF_TREE_NODE_GROUP)
+	if (node && anjuta_project_node_get_node_type (node) == ANJUTA_PROJECT_GROUP)
 	{
 		return g_object_ref (anjuta_project_node_get_file (node));
 	}
diff --git a/plugins/project-manager/project-view.c b/plugins/project-manager/project-view.c
index 8823482..6b4889a 100644
--- a/plugins/project-manager/project-view.c
+++ b/plugins/project-manager/project-view.c
@@ -374,10 +374,6 @@ dispose (GObject *object)
 static void
 destroy (GtkWidget *object)
 {
-	GbfProjectView *tree;
-
-	tree = GBF_PROJECT_VIEW (object);
-
 	if (GTK_WIDGET_CLASS (gbf_project_view_parent_class)->destroy)
 		(* GTK_WIDGET_CLASS (gbf_project_view_parent_class)->destroy) (object);
 }
@@ -719,7 +715,7 @@ gbf_project_view_find_selected_state (GtkTreeView *view,
 	g_return_val_if_fail (view != NULL, NULL);
 	g_return_val_if_fail (GBF_IS_PROJECT_VIEW (view), NULL);
 
-	data = gbf_project_view_get_first_selected (view, NULL);
+	data = gbf_project_view_get_first_selected (GBF_PROJECT_VIEW (view), NULL);
 	if (data != NULL)
 	{
 
diff --git a/plugins/project-manager/tree-data.c b/plugins/project-manager/tree-data.c
index 06d875e..d7769aa 100644
--- a/plugins/project-manager/tree-data.c
+++ b/plugins/project-manager/tree-data.c
@@ -151,7 +151,7 @@ gbf_tree_data_equal_file (GbfTreeData *data,  GbfTreeNodeType type, GFile *file)
 
 		if (node != NULL)
 		{
-			if ((type == ANJUTA_PROJECT_UNKNOWN) || (type == data->type))
+			if ((type == GBF_TREE_NODE_UNKNOWN) || (type == data->type))
 			{
 				GFile* node_file = anjuta_project_node_get_file (node);
 				if (node_file && g_file_equal (node_file, file))
@@ -256,7 +256,6 @@ GbfTreeData *
 gbf_tree_data_new_group (AnjutaProjectNode *group)
 {
 	GbfTreeData *data = g_slice_new0 (GbfTreeData);
-	GFileInfo *ginfo;
 
 	data->type = anjuta_project_node_parent(group) == NULL ? GBF_TREE_NODE_ROOT : GBF_TREE_NODE_GROUP;
 	data->node = group;



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