Commit a39f0049 authored by Sebastien Granjoux's avatar Sebastien Granjoux

libanjuta, am, pm: Fix lots of warnings

parent 9d117084
......@@ -629,8 +629,8 @@ anjuta_project_node_get_native_properties (AnjutaProjectNode *node)
return NODE_DATA (node)->native_properties;
}
static
find_property (gpointer item, gpointer data)
static gint
find_property (gconstpointer item, gconstpointer data)
{
AnjutaProjectProperty *prop_a = (AnjutaProjectProperty *)item;
AnjutaProjectProperty *prop_b = (AnjutaProjectProperty *)data;
......@@ -733,7 +733,7 @@ anjuta_project_property_free (AnjutaProjectProperty *prop)
}
GType
anjuta_project_property_get_type ()
anjuta_project_property_get_type (void)
{
static GType type_id = 0;
......@@ -774,7 +774,7 @@ anjuta_project_group_get_node_from_file (const AnjutaProjectNode *root, GFile *d
{
AnjutaProjectNode *node;
node = anjuta_project_node_traverse (root, G_PRE_ORDER, anjuta_project_group_compare, directory);
node = anjuta_project_node_traverse ((AnjutaProjectNode *)root, G_PRE_ORDER, anjuta_project_group_compare, directory);
return node;
}
......@@ -811,7 +811,7 @@ anjuta_project_target_get_node_from_name (const AnjutaProjectNode *parent, const
{
AnjutaProjectNode *node;
node = anjuta_project_node_traverse (parent, G_PRE_ORDER, anjuta_project_target_compare, name);
node = anjuta_project_node_traverse ((AnjutaProjectNode *)parent, G_PRE_ORDER, anjuta_project_target_compare, (gpointer)name);
return node;
}
......@@ -837,7 +837,7 @@ anjuta_project_source_get_node_from_file (const AnjutaProjectNode *parent, GFile
AnjutaProjectNode *node;
node = anjuta_project_node_traverse (parent, G_PRE_ORDER, anjuta_project_source_compare, file);
node = anjuta_project_node_traverse ((AnjutaProjectNode *)parent, G_PRE_ORDER, anjuta_project_source_compare, (gpointer)file);
return node;
}
......@@ -909,6 +909,8 @@ anjuta_project_node_info_new (AnjutaProjectNodeType type,
info->type = type;
info->name = g_strdup (name);
info->mime_type = g_strdup (mime_type);
return info;
}
AnjutaProjectNodeInfo *
......@@ -1014,8 +1016,6 @@ anjuta_project_node_get_gobject_property (GObject *object,
GValue *value,
GParamSpec *pspec)
{
AnjutaProjectNode *node = ANJUTA_PROJECT_NODE(object);
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
}
......@@ -1025,8 +1025,7 @@ anjuta_project_node_set_gobject_property (GObject *object,
const GValue *value,
GParamSpec *pspec)
{
AnjutaProjectNode *node = ANJUTA_PROJECT_NODE(object);
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
}
static void
......@@ -1112,166 +1111,3 @@ anjuta_project_node_class_init (AnjutaProjectNodeClass *klass)
G_PARAM_READWRITE));
}
/* Proxy node object
*---------------------------------------------------------------------------*/
#define ANJUTA_TYPE_PROJECT_PROXY_NODE (anjuta_project_proxy_node_get_type ())
#define ANJUTA_PROJECT_PROXY_NODE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ANJUTA_TYPE_PROJECT_PROXY_NODE, AnjutaProjectProxyNode))
typedef struct _AnjutaProjectProxyNode AnjutaProjectProxyNode;
GType anjuta_project_proxy_node_get_type (void) G_GNUC_CONST;
struct _AnjutaProjectProxyNode{
AnjutaProjectNode base;
AnjutaProjectNode *node;
guint reference;
};
AnjutaProjectNode *
anjuta_project_proxy_new (AnjutaProjectNode *node)
{
AnjutaProjectProxyNode *proxy;
GList *item;
/* If the node is already a proxy get original node */
node = anjuta_project_proxy_get_node (node);
/* Create proxy node */
proxy = g_object_new (ANJUTA_TYPE_PROJECT_PROXY_NODE, NULL);
proxy->reference = 1;
proxy->node = node;
proxy->base.type = node->type | ANJUTA_PROJECT_PROXY;
proxy->base.file = node->file != NULL ? g_object_ref (node->file) : NULL;
proxy->base.name = g_strdup (node->name);
/* Shallow copy of all properties */
proxy->base.custom_properties = g_list_copy (node->custom_properties);
for (item = g_list_first (proxy->base.custom_properties); item != NULL; item = g_list_next (item))
{
AnjutaProjectProperty *prop = (AnjutaProjectProperty *)item->data;
AnjutaProjectProperty *new_prop;
new_prop = anjuta_project_property_copy (prop);
item->data = new_prop;
}
return ANJUTA_PROJECT_NODE (proxy);
}
AnjutaProjectNode *
anjuta_project_proxy_unref (AnjutaProjectNode *node)
{
g_object_unref (G_OBJECT (node));
return node;
}
/* GObjet implementation
*---------------------------------------------------------------------------*/
typedef struct _AnjutaProjectProxyNodeClass AnjutaProjectProxyNodeClass;
struct _AnjutaProjectProxyNodeClass {
AnjutaProjectNodeClass parent_class;
};
G_DEFINE_TYPE (AnjutaProjectProxyNode, anjuta_project_proxy_node, ANJUTA_TYPE_PROJECT_NODE);
static void
anjuta_project_proxy_node_init (AnjutaProjectProxyNode *node)
{
}
static void
anjuta_project_proxy_node_finalize (GObject *object)
{
AnjutaProjectProxyNode *proxy = ANJUTA_PROJECT_PROXY_NODE (object);
G_OBJECT_CLASS (anjuta_project_proxy_node_parent_class)->finalize (object);
}
static void
anjuta_project_proxy_node_class_init (AnjutaProjectProxyNodeClass *klass)
{
GObjectClass* object_class = G_OBJECT_CLASS (klass);
object_class->finalize = anjuta_project_proxy_node_finalize;
}
/* Proxy node functions
*---------------------------------------------------------------------------*/
static void
reparent_children (AnjutaProjectNode *node, gpointer data)
{
node->parent = ANJUTA_PROJECT_NODE (data);
}
AnjutaProjectNode *
anjuta_project_proxy_exchange (AnjutaProjectNode *proxy, AnjutaProjectNode *node)
{
GTypeQuery node_type_info;
GTypeQuery base_type_info;
guint extra_size;
AnjutaProjectNode *other;
/* Swap specific data */
g_type_query (G_TYPE_FROM_INSTANCE (node), &node_type_info);
g_type_query (ANJUTA_TYPE_PROJECT_NODE, &base_type_info);
extra_size = node_type_info.instance_size - base_type_info.instance_size;
if (extra_size > 0)
{
gchar *data;
data = g_new (gchar , extra_size);
memcpy (data, ((gchar *)node) + base_type_info.instance_size, extra_size);
memcpy (((gchar *)node) + base_type_info.instance_size, ((gchar *)proxy) + base_type_info.instance_size, extra_size);
memcpy (((gchar *)proxy) + base_type_info.instance_size, data, extra_size);
g_free (data);
}
/* Exchange link */
other = proxy->children;
proxy->children = node->children;
node->children = other;
anjuta_project_node_children_foreach (proxy, reparent_children, proxy);
anjuta_project_node_children_foreach (node, reparent_children, node);
/* Delete node temporary properties */
g_list_foreach (node->custom_properties, anjuta_project_property_free, NULL);
node->custom_properties = proxy->custom_properties;
proxy->custom_properties = NULL;
return proxy;
}
AnjutaProjectNode *
anjuta_project_proxy_get_node (AnjutaProjectNode *node)
{
g_return_val_if_fail (node != NULL, FALSE);
if (ANJUTA_PROJECT_NODE (node)->type & ANJUTA_PROJECT_PROXY)
{
return ANJUTA_PROJECT_PROXY_NODE (node)->node;
}
else
{
return node;
}
}
gboolean
anjuta_project_node_is_proxy (AnjutaProjectNode *node)
{
g_return_val_if_fail (node != NULL, FALSE);
return NODE_DATA (node)->type & ANJUTA_PROJECT_PROXY ? TRUE : FALSE;
}
......@@ -231,7 +231,7 @@ AnjutaProjectProperty *anjuta_project_node_remove_property (AnjutaProjectNode *n
AnjutaProjectProperty *anjuta_project_property_new (const gchar *name, AnjutaProjectValueType type, const gchar *value, AnjutaProjectProperty *native);
AnjutaProjectProperty * anjuta_project_property_copy (AnjutaProjectProperty *prop);
void anjuta_project_property_free (AnjutaProjectProperty *prop);
GType anjuta_project_property_get_type ();
GType anjuta_project_property_get_type (void);
//const gchar *anjuta_project_node_get_property_value (AnjutaProjectNode *node, AnjutaProjectProperty prop);
......@@ -251,20 +251,11 @@ GFile *anjuta_project_source_get_file (const AnjutaProjectNode *source);
AnjutaProjectNodeInfo *anjuta_project_node_info_new (AnjutaProjectNodeType type, const gchar *name, const gchar *mime_type);
AnjutaProjectNodeInfo *anjuta_project_node_info_copy (AnjutaProjectNodeInfo *info);
void anjuta_project_node_info_free (AnjutaProjectNodeInfo *info);
GType anjuta_project_node_info_get_type ();
GType anjuta_project_node_info_get_type (void);
const gchar *anjuta_project_node_info_name (const AnjutaProjectNodeInfo *info);
const gchar *anjuta_project_node_info_mime (const AnjutaProjectNodeInfo *info);
AnjutaProjectNodeType anjuta_project_node_info_type (const AnjutaProjectNodeInfo *info);
AnjutaProjectNode *anjuta_project_proxy_new (AnjutaProjectNode *node);
AnjutaProjectNode *anjuta_project_proxy_unref (AnjutaProjectNode *node);
AnjutaProjectNode *anjuta_project_proxy_exchange (AnjutaProjectNode *proxy, AnjutaProjectNode *node);
AnjutaProjectNode *anjuta_project_proxy_get_node (AnjutaProjectNode *proxy);
gboolean anjuta_project_node_is_proxy (AnjutaProjectNode *node);
G_END_DECLS
#endif
......@@ -231,7 +231,6 @@ remove_raw_token (AnjutaToken *token, gpointer user_data)
static AnjutaToken *
anjuta_token_file_remove_token (AnjutaTokenFile *file, AnjutaToken *token)
{
AnjutaToken *last;
AnjutaToken *next = NULL;
if (token != NULL) next = anjuta_token_foreach_post_order (token, remove_raw_token, file);
......
......@@ -46,20 +46,22 @@ struct _AnjutaTokenStyle
/* Private functions
*---------------------------------------------------------------------------*/
void free_separator (AnjutaTokenStyleSeparator *sep, gpointer user_data)
static void
free_separator (AnjutaTokenStyleSeparator *sep, gpointer user_data)
{
g_free (sep->value);
g_slice_free (AnjutaTokenStyleSeparator, sep);
}
void free_separator_list (guint key, GList *value, gpointer user_data)
static void
free_separator_list (guint key, GList *value, gpointer user_data)
{
/* Free list elements */
g_list_foreach (value, (GFunc)free_separator, NULL);
g_list_free (value);
}
AnjutaTokenStyleSeparator*
static AnjutaTokenStyleSeparator*
anjuta_token_style_insert_separator (AnjutaTokenStyle *style, guint key, const gchar *value)
{
GList *list;
......@@ -137,7 +139,7 @@ anjuta_token_style_insert_separator (AnjutaTokenStyle *style, guint key, const g
}
}
AnjutaTokenStyleSeparator*
static AnjutaTokenStyleSeparator*
anjuta_token_style_insert_separator_between (AnjutaTokenStyle *style, gint next, gint prev, const gchar *value)
{
return anjuta_token_style_insert_separator (style, ((guint)prev & 0xFFFF) | (((guint)next & 0xFFFF) << 16), value);
......
......@@ -134,33 +134,6 @@ struct _AnjutaToken
/* Private functions
*---------------------------------------------------------------------------*/
static AnjutaToken *
anjuta_token_next2 (AnjutaToken *token)
{
AnjutaToken *last = token;
AnjutaToken *next;
while (last != NULL)
{
next = last->next;
if (next == NULL)
{
last = last->parent;
if (last != NULL)
{
for (; last->last != NULL; last = last->last);
}
}
else
{
for (; next->children != NULL; next = next->children);
break;
}
}
return next;
}
static AnjutaToken *
anjuta_token_next_child (AnjutaToken *child, AnjutaToken **last)
{
......@@ -208,26 +181,6 @@ anjuta_token_next_after_children (AnjutaToken *token)
}
static AnjutaToken *
anjuta_token_next_item_after_children (AnjutaToken *parent)
{
AnjutaToken *token;
AnjutaToken *last;
for (last = parent; last->last != NULL; last = last->last);
for (token = last; token->parent != NULL; token = token->parent)
{
if (token->parent == parent)
{
return anjuta_token_next_after_children (parent);
}
}
return anjuta_token_next_after_children (last);
}
AnjutaToken *
anjuta_token_copy (AnjutaToken *token)
{
AnjutaToken *copy = NULL;
......@@ -583,12 +536,6 @@ anjuta_token_list (AnjutaToken *token)
return token->group;
}
AnjutaToken *
anjuta_token_parent_group (AnjutaToken *token)
{
return token->group;
}
/* Item move functions
*---------------------------------------------------------------------------*/
......
......@@ -265,11 +265,10 @@ amp_module_create_token (AmpProject *project, AnjutaAmModuleNode *module, GErro
AnjutaToken *token;
AnjutaToken *prev;
AnjutaProjectNode *sibling;
gchar *relative_name;
/* Get root node */
root = ANJUTA_AM_ROOT_NODE (anjuta_project_node_parent (ANJUTA_PROJECT_NODE (module)));
if ((root == NULL) || (anjuta_project_node_get_node_type (root) != ANJUTA_PROJECT_ROOT)) return FALSE;
if ((root == NULL) || (anjuta_project_node_get_node_type (ANJUTA_PROJECT_NODE (root)) != ANJUTA_PROJECT_ROOT)) return FALSE;
/* Add in configure.ac */
......@@ -340,17 +339,16 @@ amp_package_create_token (AmpProject *project, AnjutaAmPackageNode *package, GE
gboolean after;
AnjutaToken *token;
AnjutaToken *prev;
AnjutaProjectNode *sibling;
AnjutaToken *args;
/* Get parent module */
module = ANJUTA_AM_MODULE_NODE (anjuta_project_node_parent (ANJUTA_PROJECT_NODE (package)));
if ((module == NULL) || (anjuta_project_node_get_node_type (module) != ANJUTA_PROJECT_MODULE)) return FALSE;
if ((module == NULL) || (anjuta_project_node_get_node_type (ANJUTA_PROJECT_NODE (module)) != ANJUTA_PROJECT_MODULE)) return FALSE;
/* Get root node */
root = ANJUTA_AM_ROOT_NODE (anjuta_project_node_parent (ANJUTA_PROJECT_NODE (module)));
if ((root == NULL) || (anjuta_project_node_get_node_type (root) != ANJUTA_PROJECT_ROOT)) return FALSE;
if ((root == NULL) || (anjuta_project_node_get_node_type (ANJUTA_PROJECT_NODE (root)) != ANJUTA_PROJECT_ROOT)) return FALSE;
/* Add in configure.ac */
......
......@@ -171,18 +171,6 @@ tagged_token_list_free (GList *list)
/* Variable object
*---------------------------------------------------------------------------*/
static const gchar *
amp_variable_get_name (AmpVariable *variable)
{
return variable->name;
}
static gchar *
amp_variable_evaluate (AmpVariable *variable)
{
return anjuta_token_evaluate (variable->value);
}
AmpVariable*
amp_variable_new (gchar *name, AnjutaTokenType assign, AnjutaToken *value)
{
......@@ -212,7 +200,7 @@ amp_variable_free (AmpVariable *variable)
/* Root objects
*---------------------------------------------------------------------------*/
AnjutaProjectNode*
AnjutaAmRootNode*
amp_root_new (GFile *file, GError **error)
{
AnjutaAmRootNode *root = NULL;
......@@ -228,7 +216,7 @@ amp_root_new (GFile *file, GError **error)
ANJUTA_PROJECT_CAN_SAVE;
return ANJUTA_PROJECT_NODE (root);
return root;
}
void
......@@ -249,10 +237,8 @@ amp_root_clear (AnjutaAmRootNode *node)
}
AnjutaTokenFile*
amp_root_set_configure (AnjutaProjectNode *node, GFile *configure)
amp_root_set_configure (AnjutaAmRootNode *root, GFile *configure)
{
AnjutaAmRootNode *root = ANJUTA_AM_ROOT_NODE (node);
if (root->configure_file != NULL) anjuta_token_file_free (root->configure_file);
root->configure_file = anjuta_token_file_new (configure);
......@@ -327,7 +313,7 @@ amp_module_get_token (AnjutaAmModuleNode *node)
return node->module;
}
AnjutaProjectNode*
AnjutaAmModuleNode*
amp_module_new (const gchar *name, GError **error)
{
AnjutaAmModuleNode *module = NULL;
......@@ -342,7 +328,7 @@ amp_module_new (const gchar *name, GError **error)
ANJUTA_PROJECT_CAN_REMOVE;
module->module = NULL;
return ANJUTA_PROJECT_NODE (module);
return module;
}
void
......@@ -392,7 +378,7 @@ anjuta_am_module_node_class_init (AnjutaAmModuleNodeClass *klass)
/* Package objects
*---------------------------------------------------------------------------*/
AnjutaProjectNode*
AnjutaAmPackageNode*
amp_package_new (const gchar *name, GError **error)
{
AnjutaAmPackageNode *node = NULL;
......@@ -406,7 +392,7 @@ amp_package_new (const gchar *name, GError **error)
node->base.state = ANJUTA_PROJECT_CAN_REMOVE;
node->version = NULL;
return ANJUTA_PROJECT_NODE (node);
return node;
}
void
......
......@@ -44,19 +44,19 @@ struct _AmpVariable {
AmpVariable* amp_variable_new (gchar *name, AnjutaTokenType assign, AnjutaToken *value);
AnjutaProjectNode* amp_root_new (GFile *file, GError **error);
AnjutaAmRootNode* amp_root_new (GFile *file, GError **error);
void amp_root_free (AnjutaAmRootNode *node);
void amp_root_clear (AnjutaAmRootNode *node);
AnjutaTokenFile* amp_root_set_configure (AnjutaProjectNode *node, GFile *configure);
AnjutaTokenFile* amp_root_set_configure (AnjutaAmRootNode *node, GFile *configure);
gboolean amp_root_update_configure (AnjutaAmRootNode *group, AnjutaToken *token);
AnjutaToken* amp_root_get_configure_token (AnjutaAmRootNode *root);
AnjutaProjectNode* amp_module_new (const gchar *name, GError **error);
AnjutaAmModuleNode* amp_module_new (const gchar *name, GError **error);
void amp_module_free (AnjutaAmModuleNode *node);
AnjutaToken *amp_module_get_token (AnjutaAmModuleNode *node);
void amp_module_add_token (AnjutaAmModuleNode *group, AnjutaToken *token);
AnjutaProjectNode* amp_package_new (const gchar *name, GError **error);
AnjutaAmPackageNode* amp_package_new (const gchar *name, GError **error);
void amp_package_free (AnjutaAmPackageNode *node);
void amp_package_set_version (AnjutaAmPackageNode *node, const gchar *compare, const gchar *version);
AnjutaToken *amp_package_get_token (AnjutaAmPackageNode *node);
......
......@@ -53,11 +53,6 @@ struct _AmpProject {
GList *properties;
AnjutaToken *ac_init;
AnjutaToken *args;
AnjutaAmGroupNode *root_node; /* tree containing project data;
* each GNode's data is a
* AmpNode, and the root of
* the tree is the root group. */
/* shortcut hash tables, mapping id -> GNode from the tree above */
GHashTable *groups;
......
This diff is collapsed.
......@@ -124,10 +124,6 @@ GList *amp_project_get_config_packages (AmpProject *project, const gchar* modul
GList *amp_project_get_target_types (AmpProject *project, GError **error);
AnjutaProjectProperty *amp_project_get_property_list (AmpProject *project);
//gchar* amp_project_get_property (AmpProject *project, AmpPropertyType type);
//gboolean amp_project_set_property (AmpProject *project, AmpPropertyType type, const gchar* value);
gchar * amp_project_get_node_id (AmpProject *project, const gchar *path);
AnjutaProjectNode *amp_node_parent (AnjutaProjectNode *node);
......
......@@ -45,6 +45,8 @@ void amp_am_scanner_set_am_variable (AmpAmScanner *scanner, AnjutaTokenType vari
void amp_am_scanner_include (AmpAmScanner *scanner, AnjutaToken *name);
void amp_am_scanner_update_variable (AmpAmScanner *scanner, AnjutaToken *variable);
void amp_project_set_am_variable (AmpProject* project, AnjutaAmGroupNode* group, AnjutaTokenType variable, AnjutaToken *name, AnjutaToken *list, GHashTable *orphan_properties);
void amp_am_yyerror (YYLTYPE *loc, AmpAmScanner *scanner, char const *s);
......
......@@ -298,7 +298,6 @@ void
amp_am_scanner_parse_variable (AmpAmScanner *scanner, AnjutaToken *variable)
{
AnjutaToken *value;
AnjutaToken *content;
anjuta_token_set_type (variable, ANJUTA_TOKEN_VARIABLE);
......@@ -358,13 +357,6 @@ amp_am_scanner_parse_token (AmpAmScanner *scanner, AnjutaToken *root, AnjutaToke
/* Constructor & Destructor
*---------------------------------------------------------------------------*/
static void
free_source_list (GList *source_list)
{
g_list_foreach (source_list, (GFunc)amp_source_free, NULL);
g_list_free (source_list);
}
AmpAmScanner *
amp_am_scanner_new (AmpProject *project, AnjutaAmGroupNode *group)
{
......
......@@ -36,6 +36,7 @@
#include <libanjuta/anjuta-utils.h>
#include <string.h>
#include <ctype.h>
/* Types
*---------------------------------------------------------------------------*/
......@@ -94,25 +95,6 @@ amp_project_write_config_list (AmpProject *project)
return token;
}
static AnjutaToken *
amp_project_write_subdirs_list (AnjutaAmGroupNode *project)
{
AnjutaToken *pos = NULL;
AnjutaToken *token;
static gint eol_type[] = {ANJUTA_TOKEN_EOL, ANJUTA_TOKEN_SPACE, ANJUTA_TOKEN_COMMENT, 0};
pos = anjuta_token_find_type (pos, ANJUTA_TOKEN_SEARCH_NOT, eol_type);
token = anjuta_token_insert_token_list (FALSE, pos,
AC_TOKEN_AC_CONFIG_FILES, "AC_CONFIG_FILES(",
ANJUTA_TOKEN_LIST, NULL,
ANJUTA_TOKEN_LAST, NULL,
RIGHT_PAREN, ")",
NULL);
return token;
}
static AnjutaToken *
amp_project_write_config_file (AmpProject *project, AnjutaToken *list, gboolean after, AnjutaToken *sibling, const gchar *filename)
{
......@@ -149,7 +131,7 @@ amp_project_write_config_file (AmpProject *project, AnjutaToken *list, gboolean
gboolean
amp_group_create_token (AmpProject *project, AnjutaAmGroupNode *group, GError **error)
{
AnjutaAmGroupNode *last;
AnjutaProjectNode *last;
GFile *directory;
GFile *makefile;
AnjutaToken *list;
......@@ -203,19 +185,19 @@ amp_group_create_token (AmpProject *project, AnjutaAmGroupNode *group, GError *
if (sibling == NULL)
{
/* Find a sibling before */
for (last = anjuta_project_node_prev_sibling (group); (last != NULL) && (anjuta_project_node_get_node_type (last) != ANJUTA_PROJECT_GROUP); last = anjuta_project_node_prev_sibling (last));
for (last = anjuta_project_node_prev_sibling (ANJUTA_PROJECT_NODE (group)); (last != NULL) && (anjuta_project_node_get_node_type (last) != ANJUTA_PROJECT_GROUP); last = anjuta_project_node_prev_sibling (last));
if (last != NULL)
{
sibling = last;
sibling = ANJUTA_AM_GROUP_NODE (last);
after = TRUE;
}
else
{
/* Find a sibling after */
for (last = anjuta_project_node_next_sibling (group); (last != NULL) && (anjuta_project_node_get_node_type (last) != ANJUTA_PROJECT_GROUP); last = anjuta_project_node_next_sibling (last));
for (last = anjuta_project_node_next_sibling (ANJUTA_PROJECT_NODE (group)); (last != NULL) && (anjuta_project_node_get_node_type (last) != ANJUTA_PROJECT_GROUP); last = anjuta_project_node_next_sibling (last));
if (last != NULL)
{
sibling = last;
sibling = ANJUTA_AM_GROUP_NODE (last);
after = FALSE;
}
}
......@@ -686,10 +668,10 @@ amp_source_create_token (AmpProject *project, AnjutaAmSourceNode *source, GErro
/* Get parent target */
target = ANJUTA_AM_TARGET_NODE (anjuta_project_node_parent (ANJUTA_PROJECT_NODE (source)));
if ((target == NULL) || (anjuta_project_node_get_node_type (target) != ANJUTA_PROJECT_TARGET)) return FALSE;
if ((target == NULL) || (anjuta_project_node_get_node_type (ANJUTA_PROJECT_NODE (target)) != ANJUTA_PROJECT_TARGET)) return FALSE;
group = ANJUTA_AM_GROUP_NODE (anjuta_project_node_parent (ANJUTA_PROJECT_NODE (target)));
relative_name = g_file_get_relative_path (anjuta_project_node_get_file (group), anjuta_project_node_get_file (source));
relative_name = g_file_get_relative_path (anjuta_project_node_get_file (ANJUTA_PROJECT_NODE (group)), anjuta_project_node_get_file (ANJUTA_PROJECT_NODE (source)));
/* Add in Makefile.am */
/* Find a sibling if possible */
......@@ -825,7 +807,6 @@ amp_source_delete_token (AmpProject *project, AnjutaAmSourceNode *source, GErro
static AnjutaToken*
amp_property_delete_token (AmpProject *project, AnjutaToken *token)
{
AnjutaToken *list = NULL;
gboolean updated = FALSE;
if (token != NULL)
......@@ -872,18 +853,18 @@ amp_project_write_property_list (AnjutaAmGroupNode *group, AnjutaProjectNode *no
gboolean amp_project_update_am_property (AmpProject *project, AnjutaProjectNode *node, AnjutaProjectProperty *property)
{
AnjutaAmGroupNode *group;
AnjutaProjectNode *group;
AnjutaToken *args;
/* Find group of the property */
if (anjuta_project_node_get_node_type (node) == ANJUTA_PROJECT_GROUP)
{
group = ANJUTA_AM_GROUP_NODE (node);
group = node;
}
else
{
group = ANJUTA_AM_GROUP_NODE (anjuta_project_node_parent (node));
group = anjuta_project_node_parent (node);
}
if ((property->value == NULL) || (*property->value == '\0'))
......@@ -920,7 +901,7 @@ gboolean amp_project_update_am_property (AmpProject *project, AnjutaProjectNode
canon_name = canonicalize_automake_variable (ANJUTA_AM_TARGET_NODE (node)->base.name);
prop_name = g_strconcat (canon_name, ((AmpProperty *)property->native)->suffix, NULL);
}
args = amp_project_write_property_list (group, node, prop_name);
args = amp_project_write_property_list (ANJUTA_AM_GROUP_NODE (group), node, prop_name);
((AmpProperty *)property)->token = args;
g_free (canon_name);
g_free (prop_name);
......@@ -1013,7 +994,7 @@ gboolean amp_project_update_am_property (AmpProject *project, AnjutaProjectNode
}
}
if (args != NULL) amp_group_update_makefile (group, args);
if (args != NULL) amp_group_update_makefile (ANJUTA_AM_GROUP_NODE (group), args);
return args != NULL ? TRUE : FALSE;
}
......@@ -92,17 +92,14 @@ on_file_changed (GFileMonitor *monitor,
GFileMonitorEvent event_type,
gpointer data)
{
if (!anjuta_project_node_is_proxy (ANJUTA_PROJECT_NODE (data)))
{
switch (event_type) {
case G_FILE_MONITOR_EVENT_CHANGED:
case G_FILE_MONITOR_EVENT_DELETED:
case G_FILE_MONITOR_EVENT_CREATED:
g_signal_emit_by_name (ANJUTA_DIR_GROUP_NODE (data)->emitter, "file-changed", data);
break;
default:
break;
}
switch (event_type) {
case G_FILE_MONITOR_EVENT_CHANGED:
case G_FILE_MONITOR_EVENT_DELETED:
case G_FILE_MONITOR_EVENT_CREATED:
g_signal_emit_by_name (ANJUTA_DIR_GROUP_NODE (data)->emitter, "file-changed", data);