Codebase list gnome-builder / d294f66
buildconfig: fix environment duplication Christian Hergert 5 years ago
1 changed file(s) with 5 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
615615 g_autofree gchar *new_config_id = NULL;
616616 g_autofree gchar *new_name = NULL;
617617 IdeConfigurationManager *manager;
618 IdeEnvironment *env;
618619 const gchar *config_id;
619620 const gchar *name;
620621 IdeContext *context;
639640 name = ide_configuration_get_display_name (config);
640641 /* translators: %s is replaced with the name of the configuration */
641642 new_name = g_strdup_printf (_("%s (Copy)"), name);
643
644 env = ide_configuration_get_environment (config);
642645
643646 new_config = g_object_new (IDE_TYPE_BUILDCONFIG_CONFIGURATION,
644647 "id", new_config_id,
645648 "context", context,
646649 "display-name", new_name,
647650 NULL);
651
652 ide_environment_copy_into (env, ide_configuration_get_environment (new_config), TRUE);
648653
649654 pspecs = g_object_class_list_properties (G_OBJECT_GET_CLASS (new_config), &n_pspecs);
650655