[anjuta/newproject] Rename IAnjutaProject signals
- From: Sebastien Granjoux <sgranjoux src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [anjuta/newproject] Rename IAnjutaProject signals
- Date: Sun, 24 Oct 2010 21:01:36 +0000 (UTC)
commit 13f141f664bedd94e98fa021fece501162adbdb4
Author: Sébastien Granjoux <seb sfo free fr>
Date: Sun Oct 24 22:51:58 2010 +0200
Rename IAnjutaProject signals
libanjuta/interfaces/libanjuta.idl | 32 ++++++++++++++++++--------------
plugins/am-project/am-node.c | 2 +-
plugins/am-project/am-project.c | 13 +++++++------
plugins/project-manager/project.c | 6 +++---
4 files changed, 29 insertions(+), 24 deletions(-)
---
diff --git a/libanjuta/interfaces/libanjuta.idl b/libanjuta/interfaces/libanjuta.idl
index 59f3a80..20e610f 100644
--- a/libanjuta/interfaces/libanjuta.idl
+++ b/libanjuta/interfaces/libanjuta.idl
@@ -3097,42 +3097,46 @@ interface IAnjutaProject
/* Signals */
/**
- * IAnjutaProject::node_updated:
+ * IAnjutaProject::file-changed:
* @obj: Self
- * @node: Updated node.
+ * @node: Node to be reloaded.
*
- * This signal is emitted when the project is changed on the disk.
+ * This signal is emitted when the project is changed on the disk. The
+ * corresponding node has to be reloaded.
*/
- void ::node_updated (gpointer node);
+ void ::file_changed (gpointer node);
/**
- * IAnjutaProject::node_modified:
+ * IAnjutaProject::node-changed:
* @obj: Self
- * @node: Modfied node.
- * @error: Error while modifying node
+ * @node: Changed node.
+ * @error: Error while changing node
*
- * This signal is emitted when a node is modified (by a function of this
- * interface) and return an eventual error.
+ * This signal is emitted when a node is changed by a function of this
+ * interface. The error argument is not NULL if the change was not
+ * possible. The corresponding node need to be saved.
*/
- void ::node_modified (gpointer node, GError *error);
+ void ::node_changed (gpointer node, GError *error);
/**
- * IAnjutaProject::node_saved:
+ * IAnjutaProject::node-saved:
* @obj: Self
* @node: Saved node.
* @error: Error while saving node
*
- * This signal is emitted when a node is saved and return an eventual error
+ * This signal is emitted when a node is saved. It returns an error if the
+ * save operation fail.
*/
void ::node_saved (gpointer node, GError *error);
/**
- * IAnjutaProject::node_loaded:
+ * IAnjutaProject::node-loaded:
* @obj: Self
* @node: Loaded node.
* @error: Error while loading node
*
- * This signal is emitted when a node is loaded and return an eventual error
+ * This signal is emitted when a node is loaded. It returns an error if the
+ * load operation fail.
*/
void ::node_loaded (gpointer node, GError *error);
diff --git a/plugins/am-project/am-node.c b/plugins/am-project/am-node.c
index cba3b3b..c8ee78d 100644
--- a/plugins/am-project/am-node.c
+++ b/plugins/am-project/am-node.c
@@ -491,7 +491,7 @@ on_group_monitor_changed (GFileMonitor *monitor,
* original one is reloaded. */
if (!(anjuta_project_node_get_full_type (ANJUTA_PROJECT_NODE (node)) & ANJUTA_PROJECT_PROXY))
{
- g_signal_emit_by_name (G_OBJECT (node->project), "node-updated", data);
+ g_signal_emit_by_name (G_OBJECT (node->project), "file-changed", data);
}
else
{
diff --git a/plugins/am-project/am-project.c b/plugins/am-project/am-project.c
index baf2d6b..ed821ed 100644
--- a/plugins/am-project/am-project.c
+++ b/plugins/am-project/am-project.c
@@ -551,7 +551,7 @@ monitor_cb (GFileMonitor *monitor,
/* monitor will be removed here... is this safe? */
//amp_project_reload (project, NULL);
g_message ("project updated");
- g_signal_emit_by_name (G_OBJECT (project), "node-updated");
+ g_signal_emit_by_name (G_OBJECT (project), "file-changed");
break;
default:
break;
@@ -979,6 +979,7 @@ project_load_target (AmpProject *project, AnjutaToken *name, AnjutaTokenType tok
/* Copy all sources */
while ((child = anjuta_project_node_first_child (ANJUTA_PROJECT_NODE (orphan))) != NULL)
{
+ /* Add a reference on the child to avoid freeing it */
anjuta_project_node_remove (child);
anjuta_project_node_append (target, child);
}
@@ -2356,7 +2357,7 @@ iproject_add_node_before (IAnjutaProject *obj, AnjutaProjectNode *parent, Anjuta
anjuta_project_node_insert_before (parent, sibling, node);
break;
}
- g_signal_emit_by_name (obj, "node-modified", node, NULL);
+ g_signal_emit_by_name (obj, "node-changed", node, NULL);
return node;
}
@@ -2395,7 +2396,7 @@ iproject_add_node_after (IAnjutaProject *obj, AnjutaProjectNode *parent, AnjutaP
anjuta_project_node_insert_after (parent, sibling, node);
break;
}
- g_signal_emit_by_name (obj, "node-modified", node, NULL);
+ g_signal_emit_by_name (obj, "node-changed", node, NULL);
return node;
}
@@ -2421,7 +2422,7 @@ iproject_remove_node (IAnjutaProject *obj, AnjutaProjectNode *node, GError **err
default:
break;
}
- g_signal_emit_by_name (obj, "node-modified", node, NULL);
+ g_signal_emit_by_name (obj, "node-changed", node, NULL);
return TRUE;
}
@@ -2444,7 +2445,7 @@ iproject_set_property (IAnjutaProject *obj, AnjutaProjectNode *node, AnjutaProje
{
amp_project_update_am_property (AMP_PROJECT (obj), node, new_prop);
}
- g_signal_emit_by_name (obj, "node-modified", node, NULL);
+ g_signal_emit_by_name (obj, "node-changed", node, NULL);
return new_prop;
}
@@ -2456,7 +2457,7 @@ iproject_remove_property (IAnjutaProject *obj, AnjutaProjectNode *node, AnjutaPr
old_prop = anjuta_project_node_remove_property (node, property);
amp_property_free (old_prop);
- g_signal_emit_by_name (obj, "node-modified", node, NULL);
+ g_signal_emit_by_name (obj, "node-changed", node, NULL);
return TRUE;
}
diff --git a/plugins/project-manager/project.c b/plugins/project-manager/project.c
index fb55277..516caf1 100644
--- a/plugins/project-manager/project.c
+++ b/plugins/project-manager/project.c
@@ -114,7 +114,7 @@ pm_command_load_complete (AnjutaPmProject *project, AnjutaProjectNode *node, GEr
}
static void
-on_node_updated (IAnjutaProject *sender, AnjutaProjectNode *node, AnjutaPmProject *project)
+on_file_changed (IAnjutaProject *sender, AnjutaProjectNode *node, AnjutaPmProject *project)
{
ianjuta_project_load_node (project->project, node, NULL);
}
@@ -214,8 +214,8 @@ anjuta_pm_project_load (AnjutaPmProject *project, GFile *file, GError **error)
}
g_signal_connect (G_OBJECT (project->project),
- "node-updated",
- G_CALLBACK (on_node_updated),
+ "file-changed",
+ G_CALLBACK (on_file_changed),
project);
g_signal_connect (G_OBJECT (project->project),
"node-loaded",
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]