[anjuta/newproject] pm: Fix a bug when displaying new target dialog
- From: Sebastien Granjoux <sgranjoux src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [anjuta/newproject] pm: Fix a bug when displaying new target dialog
- Date: Sun, 14 Nov 2010 14:15:57 +0000 (UTC)
commit ebe54f3851673a4c54ce8882fa98460fc4100976
Author: Sébastien Granjoux <seb sfo free fr>
Date: Sun Nov 14 16:52:54 2010 +0100
pm: Fix a bug when displaying new target dialog
libanjuta/interfaces/libanjuta.idl | 2 +-
plugins/am-project/am-project.c | 4 ++--
plugins/am-project/am-project.h | 2 +-
plugins/am-project/projectparser.c | 5 ++---
plugins/project-manager/dialogs.c | 10 ++++------
plugins/project-manager/project.c | 4 ++--
plugins/project-manager/project.h | 2 +-
7 files changed, 13 insertions(+), 16 deletions(-)
---
diff --git a/libanjuta/interfaces/libanjuta.idl b/libanjuta/interfaces/libanjuta.idl
index d7812e5..e03f9c0 100644
--- a/libanjuta/interfaces/libanjuta.idl
+++ b/libanjuta/interfaces/libanjuta.idl
@@ -3257,7 +3257,7 @@ interface IAnjutaProject
* Return value: (element-type Anjuta.ProjectNodeInfo) (transfer none): TRUE if the property has been successfully removed
* else FALSE
*/
- List<AnjutaProjectNodeInformation *> get_node_info();
+ const List<AnjutaProjectNodeInformation *> get_node_info();
}
/**
diff --git a/plugins/am-project/am-project.c b/plugins/am-project/am-project.c
index aab60aa..04782d6 100644
--- a/plugins/am-project/am-project.c
+++ b/plugins/am-project/am-project.c
@@ -1918,7 +1918,7 @@ amp_project_remove_source (AmpProject *project,
amp_source_free (source);
}
-GList *
+const GList *
amp_project_get_node_info (AmpProject *project, GError **error)
{
static GList *info_list = NULL;
@@ -2650,7 +2650,7 @@ iproject_get_root (IAnjutaProject *obj, GError **err)
return AMP_PROJECT (obj)->root;
}
-static GList*
+static const GList*
iproject_get_node_info (IAnjutaProject *obj, GError **err)
{
return amp_project_get_node_info (AMP_PROJECT (obj), err);
diff --git a/plugins/am-project/am-project.h b/plugins/am-project/am-project.h
index d2d7b52..601ed3f 100644
--- a/plugins/am-project/am-project.h
+++ b/plugins/am-project/am-project.h
@@ -117,7 +117,7 @@ AnjutaAmSourceNode* amp_project_add_sibling_source (AmpProject *project, Anjuta
void amp_project_remove_source (AmpProject *project, AnjutaAmSourceNode *source, GError **error);
AnjutaProjectNodeInfo *amp_project_get_type_info (AmpProject *project, AnjutaProjectNodeType type);
-GList *amp_project_get_node_info (AmpProject *project, GError **error);
+const GList *amp_project_get_node_info (AmpProject *project, GError **error);
GList *amp_project_get_config_modules (AmpProject *project, GError **error);
GList *amp_project_get_config_packages (AmpProject *project, const gchar* module, GError **error);
diff --git a/plugins/am-project/projectparser.c b/plugins/am-project/projectparser.c
index 7ea0c64..f6ae097 100644
--- a/plugins/am-project/projectparser.c
+++ b/plugins/am-project/projectparser.c
@@ -338,8 +338,8 @@ static AnjutaProjectNodeType
get_target_type (IAnjutaProject *project, const char *id)
{
AnjutaProjectNodeType type;
- GList *list;
- GList *item;
+ const GList *list;
+ const GList *item;
guint num = atoi (id);
list = ianjuta_project_get_node_info (project, NULL);
@@ -358,7 +358,6 @@ get_target_type (IAnjutaProject *project, const char *id)
num--;
}
}
- g_list_free (list);
return type;
}
diff --git a/plugins/project-manager/dialogs.c b/plugins/project-manager/dialogs.c
index 29822a9..03099bc 100644
--- a/plugins/project-manager/dialogs.c
+++ b/plugins/project-manager/dialogs.c
@@ -512,7 +512,7 @@ create_properties_table (IAnjutaProject *project, AnjutaProjectNode *node)
gint main_pos;
gint extra_pos;
gchar *path;
- GList *item;
+ const GList *item;
AnjutaProjectNodeType type;
AnjutaProjectNodeInfo* node_info;
gboolean single;
@@ -1080,8 +1080,8 @@ build_types_store (AnjutaPmProject *project)
{
GtkListStore *store;
GtkTreeIter iter;
- GList *types;
- GList *node;
+ const GList *types;
+ const GList *node;
types = anjuta_pm_project_get_node_info (project);
store = gtk_list_store_new (TARGET_TYPE_N_COLUMNS,
@@ -1089,7 +1089,7 @@ build_types_store (AnjutaPmProject *project)
G_TYPE_STRING,
GDK_TYPE_PIXBUF);
- for (node = g_list_first (types); node != NULL; node = g_list_next (node)) {
+ for (node = types; node != NULL; node = g_list_next (node)) {
GdkPixbuf *pixbuf;
const gchar *name;
AnjutaProjectNodeType type;
@@ -1116,8 +1116,6 @@ build_types_store (AnjutaPmProject *project)
}
}
- g_list_free (types);
-
return store;
}
diff --git a/plugins/project-manager/project.c b/plugins/project-manager/project.c
index 06913dd..ca9d748 100644
--- a/plugins/project-manager/project.c
+++ b/plugins/project-manager/project.c
@@ -262,7 +262,7 @@ anjuta_pm_project_get_capabilities (AnjutaPmProject *project)
if (project->project != NULL)
{
- GList *item;
+ const GList *item;
for (item = anjuta_pm_project_get_node_info (project); item != NULL; item = g_list_next (item))
{
@@ -294,7 +294,7 @@ anjuta_pm_project_get_capabilities (AnjutaPmProject *project)
return caps;
}
-GList *
+const GList *
anjuta_pm_project_get_node_info (AnjutaPmProject *project)
{
g_return_val_if_fail (project->project != NULL, NULL);
diff --git a/plugins/project-manager/project.h b/plugins/project-manager/project.h
index f86e674..fb86e62 100644
--- a/plugins/project-manager/project.h
+++ b/plugins/project-manager/project.h
@@ -80,7 +80,7 @@ gboolean anjuta_pm_project_unload (AnjutaPmProject *project, GError **error);
gboolean anjuta_pm_project_refresh (AnjutaPmProject *project, GError **error);
gint anjuta_pm_project_get_capabilities (AnjutaPmProject *project);
-GList *anjuta_pm_project_get_node_info (AnjutaPmProject *project);
+const GList *anjuta_pm_project_get_node_info (AnjutaPmProject *project);
GList *anjuta_pm_project_get_packages (AnjutaPmProject *project);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]