[anjuta] am-project: Avoid a crash when adding a second group at an upper level
- From: Sebastien Granjoux <sgranjoux src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [anjuta] am-project: Avoid a crash when adding a second group at an upper level
- Date: Fri, 16 Mar 2012 21:52:40 +0000 (UTC)
commit 9151fa35887141d198675abebbe87cee3288154b
Author: SÃbastien Granjoux <seb sfo free fr>
Date: Fri Mar 16 21:59:58 2012 +0100
am-project: Avoid a crash when adding a second group at an upper level
After adding the first group, the parent of the group is reloaded but was missing some token informations which cause a crash if a sibling of the parent is added.
plugins/am-project/am-project.c | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/plugins/am-project/am-project.c b/plugins/am-project/am-project.c
index 131b03e..52d5bb0 100644
--- a/plugins/am-project/am-project.c
+++ b/plugins/am-project/am-project.c
@@ -1624,6 +1624,14 @@ amp_project_duplicate_node (AnjutaProjectNode *old_node)
// the value will be overwritten with the new node empty value.
amp_package_node_add_token (AMP_PACKAGE_NODE (new_node), amp_package_node_get_token (AMP_PACKAGE_NODE (old_node)));
}
+ if (anjuta_project_node_get_node_type (old_node) == ANJUTA_PROJECT_GROUP)
+ {
+
+ amp_group_node_add_token (AMP_GROUP_NODE (new_node), amp_group_node_get_first_token (AMP_GROUP_NODE (old_node), AM_GROUP_TOKEN_CONFIGURE), AM_GROUP_TOKEN_CONFIGURE);
+ amp_group_node_add_token (AMP_GROUP_NODE (new_node), amp_group_node_get_first_token (AMP_GROUP_NODE (old_node), AM_GROUP_TOKEN_SUBDIRS), AM_GROUP_TOKEN_SUBDIRS);
+ amp_group_node_add_token (AMP_GROUP_NODE (new_node), amp_group_node_get_first_token (AMP_GROUP_NODE (old_node), AM_GROUP_TOKEN_DIST_SUBDIRS), AM_GROUP_TOKEN_DIST_SUBDIRS);
+
+ }
if (anjuta_project_node_parent (old_node) == NULL)
{
// FIXME: It would be better to write a duplicate function to avoid this code
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]