From dcb06fd442b02760546c6b45ba024527f9ec022d Mon Sep 17 00:00:00 2001 From: Abderrahim Kitouni Date: Wed, 21 Dec 2011 18:28:18 +0100 Subject: [PATCH] libanjuta, am-project, project-manager, language-support-vala: rename property to default_value --- libanjuta/anjuta-project.c | 18 +++++++++--------- libanjuta/anjuta-project.h | 4 ++-- plugins/am-project/am-project.c | 2 +- plugins/am-project/am-properties.c | 12 ++++++------ plugins/am-project/am-writer.c | 6 +++--- plugins/am-project/projectparser.c | 2 +- plugins/language-support-vala/libanjuta-3.0.vapi | 4 ++-- plugins/language-support-vala/plugin.vala | 4 ++-- plugins/project-manager/dialogs.c | 4 ++-- 9 files changed, 28 insertions(+), 28 deletions(-) diff --git a/libanjuta/anjuta-project.c b/libanjuta/anjuta-project.c index e9708a4c9..b63ca5311 100644 --- a/libanjuta/anjuta-project.c +++ b/libanjuta/anjuta-project.c @@ -127,7 +127,7 @@ anjuta_project_property_get_type (void) * @type: Property value type * @flags: Property flags * @description: (transfer none): Property description - * @property: (transfer full): Default property value + * @default_value: (transfer full): Default property value * @user_data: (allow-none) (transfer full): Optional user data * * Returns: (transfer full): @@ -138,7 +138,7 @@ anjuta_project_property_info_new (const gchar *id, AnjutaProjectValueType type, AnjutaProjectPropertyFlags flags, const gchar *description, - AnjutaProjectProperty *property, + AnjutaProjectProperty *default_value, gpointer user_data) { AnjutaProjectPropertyInfo *info = g_slice_new0(AnjutaProjectPropertyInfo); @@ -148,10 +148,10 @@ anjuta_project_property_info_new (const gchar *id, info->type = type; info->flags = flags; info->description = g_strdup (description); - info->property = property; + info->default_value = default_value; info->user_data = user_data; - info->property->info = info; + info->default_value->info = info; return info; } @@ -161,7 +161,7 @@ anjuta_project_property_info_copy (AnjutaProjectPropertyInfo *info) { return anjuta_project_property_info_new (info->id, info->name, info->type, info->flags, info->description, - info->property, info->user_data); + info->default_value, info->user_data); } void @@ -170,7 +170,7 @@ anjuta_project_property_info_free (AnjutaProjectPropertyInfo *info) g_free (info->id); g_free (info->name); g_free (info->description); - anjuta_project_property_free (info->property); + anjuta_project_property_free (info->default_value); g_slice_free (AnjutaProjectPropertyInfo, info); } @@ -873,7 +873,7 @@ anjuta_project_node_get_property (AnjutaProjectNode *node, const gchar *id) GList *found; /* Get default property */ - prop = info->property; + prop = info->default_value; /* Find custom property */ found = g_list_find_custom (node->properties, info, find_property); @@ -901,7 +901,7 @@ anjuta_project_node_get_map_property (AnjutaProjectNode *node, const gchar *id, GList *found; /* Get default property */ - prop = info->property; + prop = info->default_value; /* Find property */ found = node->properties; @@ -983,7 +983,7 @@ AnjutaProjectProperty * anjuta_project_node_remove_property (AnjutaProjectNode *node, AnjutaProjectProperty *prop) { /* Search the exact property, useful for list property */ - if (prop != prop->info->property) + if (prop != prop->info->default_value) { node->properties = g_list_remove (node->properties, prop); prop->info = NULL; diff --git a/libanjuta/anjuta-project.h b/libanjuta/anjuta-project.h index c7a08d2fe..dab75b640 100644 --- a/libanjuta/anjuta-project.h +++ b/libanjuta/anjuta-project.h @@ -68,12 +68,12 @@ struct _AnjutaProjectPropertyInfo AnjutaProjectValueType type; AnjutaProjectPropertyFlags flags; gchar *description; - AnjutaProjectProperty *property; + AnjutaProjectProperty *default_value; gpointer user_data; }; GType anjuta_project_property_info_get_type (void); -AnjutaProjectPropertyInfo *anjuta_project_property_info_new (const gchar *id, const gchar *name, AnjutaProjectValueType type, AnjutaProjectPropertyFlags flags, const gchar *description, AnjutaProjectProperty *property, gpointer user_data); +AnjutaProjectPropertyInfo *anjuta_project_property_info_new (const gchar *id, const gchar *name, AnjutaProjectValueType type, AnjutaProjectPropertyFlags flags, const gchar *description, AnjutaProjectProperty *default_value, gpointer user_data); AnjutaProjectPropertyInfo * anjuta_project_property_info_copy (AnjutaProjectPropertyInfo *info); void anjuta_project_property_info_free (AnjutaProjectPropertyInfo *info); diff --git a/plugins/am-project/am-project.c b/plugins/am-project/am-project.c index c4229c685..e948bb342 100644 --- a/plugins/am-project/am-project.c +++ b/plugins/am-project/am-project.c @@ -683,7 +683,7 @@ amp_project_load_properties (AmpProject *project, AnjutaToken *macro, AnjutaToke AnjutaProjectProperty *new_prop; new_prop = anjuta_project_node_get_property (ANJUTA_PROJECT_NODE (project), info->base.id); - if ((new_prop != NULL) && (new_prop->info->property != new_prop)) + if ((new_prop != NULL) && (new_prop->info->default_value != new_prop)) { amp_property_free (new_prop); } diff --git a/plugins/am-project/am-properties.c b/plugins/am-project/am-properties.c index 68fb679a7..44a4213fb 100644 --- a/plugins/am-project/am-properties.c +++ b/plugins/am-project/am-properties.c @@ -1046,8 +1046,8 @@ amp_create_property_list (GList **list, AmpPropertyInfo *properties) info->link = link; *list = g_list_prepend (*list, info); link = info->flags & AM_PROPERTY_DISABLE_FOLLOWING ? (AnjutaProjectPropertyInfo *)info : NULL; - info->base.property = amp_property_new (NULL, 0, 0, info->value, NULL); - info->base.property->info = (AnjutaProjectPropertyInfo *)info; + info->base.default_value = amp_property_new (NULL, 0, 0, info->value, NULL); + info->base.default_value->info = (AnjutaProjectPropertyInfo *)info; } *list = g_list_reverse (*list); } @@ -1130,7 +1130,7 @@ amp_node_property_load (AnjutaProjectNode *node, gint token_type, gint position, AnjutaProjectProperty *new_prop; new_prop = anjuta_project_node_get_property (node, info->base.id); - if ((new_prop == NULL) || (new_prop == new_prop->info->property)) + if ((new_prop == NULL) || (new_prop == new_prop->info->default_value)) { new_prop = anjuta_project_node_insert_property (node, (AnjutaProjectPropertyInfo *)info, amp_property_new (NULL, 0, 0, NULL, token)); } @@ -1164,7 +1164,7 @@ amp_node_property_add (AnjutaProjectNode *node, AnjutaProjectProperty *new_prop) AnjutaProjectProperty *old_prop; old_prop = anjuta_project_node_get_map_property (node, info->base.id, new_prop->name); - if ((old_prop != NULL) && (old_prop->info->property != old_prop)) + if ((old_prop != NULL) && (old_prop->info->default_value != old_prop)) { anjuta_project_node_remove_property (node, old_prop); amp_property_free (old_prop); @@ -1199,7 +1199,7 @@ amp_node_property_add (AnjutaProjectNode *node, AnjutaProjectProperty *new_prop) break; } - if (g_strcmp0 (new_prop->value, info->base.property->value) != 0) + if (g_strcmp0 (new_prop->value, info->base.default_value->value) != 0) { anjuta_project_node_insert_property (node, (AnjutaProjectPropertyInfo *)info, new_prop); set = TRUE; @@ -1249,7 +1249,7 @@ amp_node_map_property_set (AnjutaProjectNode *node, const gchar *id, const gchar AnjutaProjectProperty *new_prop; new_prop = anjuta_project_node_get_map_property (node, id, name); - if ((new_prop != NULL) && (new_prop->info->property != new_prop)) + if ((new_prop != NULL) && (new_prop->info->default_value != new_prop)) { /* Property already exist, replace value */ g_free (new_prop->value); diff --git a/plugins/am-project/am-writer.c b/plugins/am-project/am-writer.c index aada56ed3..26b5ff12f 100644 --- a/plugins/am-project/am-writer.c +++ b/plugins/am-project/am-writer.c @@ -1339,7 +1339,7 @@ amp_property_rename_target (AmpProject *project, AnjutaProjectNode *node) } prop = (AmpProperty *)anjuta_project_node_get_property (node, info->base.id); - if ((prop == (AmpProperty *)info->base.property) || (g_strcmp0 (prop->base.value, info->base.property->value) == 0)) + if ((prop == (AmpProperty *)info->base.default_value) || (g_strcmp0 (prop->base.value, info->base.default_value->value) == 0)) { /* Default value, add only string properties */ if (info->base.type == ANJUTA_PROJECT_PROPERTY_STRING) @@ -1367,7 +1367,7 @@ amp_property_rename_target (AmpProject *project, AnjutaProjectNode *node) g_string_append_c (new_name, '_'); break; case ANJUTA_PROJECT_PROPERTY_BOOLEAN: - if ((prop->base.value != NULL) && (g_strcmp0 (prop->base.value, info->base.property->value) != 0)) + if ((prop->base.value != NULL) && (g_strcmp0 (prop->base.value, info->base.default_value->value) != 0)) { g_string_append (new_name, info->suffix); } @@ -1613,7 +1613,7 @@ gboolean amp_project_update_am_property (AmpProject *project, AnjutaProjectNode } if ((property->value == NULL) || - (g_strcmp0 (property->info->property->value, property->value) == 0)) + (g_strcmp0 (property->info->default_value->value, property->value) == 0)) { /* Remove property */ if (((AmpPropertyInfo *)property->info)->token_type == AM_TOKEN__PROGRAMS) diff --git a/plugins/am-project/projectparser.c b/plugins/am-project/projectparser.c index 52c8fb842..e0af3f98d 100644 --- a/plugins/am-project/projectparser.c +++ b/plugins/am-project/projectparser.c @@ -91,7 +91,7 @@ list_property (IAnjutaProject *project, AnjutaProjectNode *parent, gint indent) info = prop->info; /* Default property */ - if (info->property == prop) continue; + if (info->default_value == prop) continue; switch (info->type) { diff --git a/plugins/language-support-vala/libanjuta-3.0.vapi b/plugins/language-support-vala/libanjuta-3.0.vapi index 773de998a..1fceb76c2 100644 --- a/plugins/language-support-vala/libanjuta-3.0.vapi +++ b/plugins/language-support-vala/libanjuta-3.0.vapi @@ -494,15 +494,15 @@ namespace Anjuta { [CCode (cheader_filename = "libanjuta/libanjuta.h", copy_function = "g_boxed_copy", free_function = "g_boxed_free", type_id = "anjuta_project_property_info_get_type ()")] [Compact] public class ProjectPropertyInfo { + public weak Anjuta.ProjectProperty default_value; public weak string description; public Anjuta.ProjectPropertyFlags flags; public weak string id; public weak string name; - public weak Anjuta.ProjectProperty property; public Anjuta.ProjectValueType type; public void* user_data; [CCode (has_construct_function = false)] - public ProjectPropertyInfo (string id, string name, Anjuta.ProjectValueType type, Anjuta.ProjectPropertyFlags flags, string description, owned Anjuta.ProjectProperty property, owned void* user_data); + public ProjectPropertyInfo (string id, string name, Anjuta.ProjectValueType type, Anjuta.ProjectPropertyFlags flags, string description, owned Anjuta.ProjectProperty default_value, owned void* user_data); public Anjuta.ProjectPropertyInfo copy (); public void free (); } diff --git a/plugins/language-support-vala/plugin.vala b/plugins/language-support-vala/plugin.vala index e061f4004..d91314163 100644 --- a/plugins/language-support-vala/plugin.vala +++ b/plugins/language-support-vala/plugin.vala @@ -169,13 +169,13 @@ public class ValaPlugin : Plugin { string[] flags = {}; unowned Anjuta.ProjectProperty prop = current_target.get_property ("VALAFLAGS"); - if (prop != null && prop != prop.info.property) { + if (prop != null && prop != prop.info.default_value) { GLib.Shell.parse_argv (prop.value, out flags); } else { /* Fall back to AM_VALAFLAGS */ var current_group = current_target.parent_type (Anjuta.ProjectNodeType.GROUP); prop = current_group.get_property ("VALAFLAGS"); - if (prop != null && prop != prop.info.property) + if (prop != null && prop != prop.info.default_value) GLib.Shell.parse_argv (prop.value, out flags); } diff --git a/plugins/project-manager/dialogs.c b/plugins/project-manager/dialogs.c index f251c4de7..e23af61f2 100644 --- a/plugins/project-manager/dialogs.c +++ b/plugins/project-manager/dialogs.c @@ -681,7 +681,7 @@ update_properties (PropertiesTable *table) GtkWidget *entry; prop = anjuta_project_node_get_property (table->node, info->id); - if (prop != prop->info->property) + if (prop != prop->info->default_value) { /* This property has been set, display it in the main part */ entry = add_entry (table->project->project, table->node, prop, table->main, &main_pos); @@ -689,7 +689,7 @@ update_properties (PropertiesTable *table) else { /* This property has not been set, hide it by default */ - entry = add_entry (table->project->project, table->node, info->property, table->extra, &extra_pos); + entry = add_entry (table->project->project, table->node, info->default_value, table->extra, &extra_pos); single = TRUE; } -- 2.11.4.GIT