403
469
* anjuta_profile_add_plugin:
404
470
* @profile: a #AnjutaProfile object.
405
* @plugin: a #AnjutaPluginDescription.
471
* @plugin: a #AnjutaPluginHandle.
407
473
* Add one plugin into the profile plugin list.
410
476
anjuta_profile_add_plugin (AnjutaProfile *profile,
411
AnjutaPluginDescription *plugin)
477
AnjutaPluginHandle *plugin)
413
479
AnjutaProfilePriv *priv;
414
480
g_return_if_fail (ANJUTA_IS_PROFILE (profile));
415
481
g_return_if_fail (plugin != NULL);
416
482
priv = ANJUTA_PROFILE (profile)->priv;
417
if (priv->plugins == NULL || g_list_find (priv->plugins, plugin) == NULL)
483
if (g_hash_table_lookup (priv->plugins_to_load, plugin) == NULL)
419
priv->plugins = g_list_prepend (priv->plugins, plugin);
485
g_hash_table_add (priv->plugins_to_load, plugin);
420
486
g_signal_emit_by_name (profile, "plugin-added", plugin);
421
g_signal_emit_by_name (profile, "changed", priv->plugins);
487
g_signal_emit_by_name (profile, "changed");
426
492
* anjuta_profile_remove_plugin:
427
493
* @profile: a #AnjutaProfile object.
428
* @plugin: a #AnjutaPluginDescription.
494
* @plugin: a #AnjutaPluginHandle.
430
496
* Remove one plugin from the profile plugin list.
433
499
anjuta_profile_remove_plugin (AnjutaProfile *profile,
434
AnjutaPluginDescription *plugin)
500
AnjutaPluginHandle *plugin)
436
502
AnjutaProfilePriv *priv;
437
503
g_return_if_fail (ANJUTA_IS_PROFILE (profile));
438
504
g_return_if_fail (plugin != NULL);
439
505
priv = ANJUTA_PROFILE (profile)->priv;
440
if (priv->plugins && g_list_find (priv->plugins, plugin) != NULL)
506
if (g_hash_table_remove (priv->plugins_to_load, plugin))
442
priv->plugins = g_list_remove (priv->plugins, plugin);
508
g_hash_table_remove (priv->plugins_to_exclude_from_sync, plugin);
443
509
g_signal_emit_by_name (profile, "plugin-removed", plugin);
444
g_signal_emit_by_name (profile, "changed", priv->plugins);
510
g_signal_emit_by_name (profile, "changed");
449
515
* anjuta_profile_has_plugin:
450
516
* @profile: a #AnjutaProfile object
451
* @plugin: a #AnjutaPluginDescription
517
* @plugin: a #AnjutaPluginHandle
453
519
* Check if a plugin is included in the profile plugin list.
455
* Return value: TRUE if the plugin is included in the list.
521
* Return value: %TRUE if the plugin is included in the list.
458
524
anjuta_profile_has_plugin (AnjutaProfile *profile,
459
AnjutaPluginDescription *plugin)
525
AnjutaPluginHandle *plugin)
461
527
AnjutaProfilePriv *priv;
462
528
g_return_val_if_fail (ANJUTA_IS_PROFILE (profile), FALSE);
463
529
g_return_val_if_fail (plugin != NULL, FALSE);
464
530
priv = ANJUTA_PROFILE (profile)->priv;
465
return (priv->plugins != NULL &&
466
g_list_find (priv->plugins, plugin) != NULL);
470
* anjuta_profile_get_plugins:
471
* @profile: a #AnjutaProfile object.
473
* Get the profile current plugins list.
475
* Return value: the plugins list.
478
anjuta_profile_get_plugins (AnjutaProfile *profile)
480
AnjutaProfilePriv *priv;
481
g_return_val_if_fail (ANJUTA_IS_PROFILE (profile), FALSE);
482
priv = ANJUTA_PROFILE (profile)->priv;
483
return priv->plugins;
532
return g_hash_table_lookup (priv->plugins_to_load, plugin) != NULL;
536
anjuta_profile_configure_plugins (AnjutaProfile *profile,
540
AnjutaProfilePriv *priv;
544
g_return_val_if_fail (ANJUTA_IS_PROFILE (profile), FALSE);
546
priv = ANJUTA_PROFILE (profile)->priv;
547
for (config = config_list, item = handles_list; item != NULL; item = g_list_next (item), config = g_list_next (config))
552
for (plugin = g_list_first ((GList *)item->data); plugin != NULL; plugin = g_list_next (plugin))
554
AnjutaPluginHandle *handle = ANJUTA_PLUGIN_HANDLE (plugin->data);
555
AnjutaPluginDescription *desc;
557
desc = anjuta_plugin_handle_get_description (handle);
558
for (set = g_list_first ((GList *)config->data); set != NULL; set = g_list_next (set))
560
gchar *group = (gchar *)set->data;
561
gchar *key = group + strlen (group) + 1;
562
gchar *value = key + strlen (key) + 1;
564
anjuta_plugin_description_override (desc, group, key, value);
565
priv->configuration = g_list_prepend (priv->configuration, group);
566
priv->configuration = g_list_prepend (priv->configuration, handle);
569
for (set = g_list_first ((GList *)config->data); set != NULL; set = g_list_delete_link (set, set))
571
priv->config_keys = g_list_prepend (priv->config_keys, set->data);
574
g_list_free (config_list);
581
anjuta_profile_unconfigure_plugins (AnjutaProfile *profile)
583
AnjutaProfilePriv *priv;
586
g_return_val_if_fail (ANJUTA_IS_PROFILE (profile), FALSE);
588
priv = ANJUTA_PROFILE (profile)->priv;
589
for (item = g_list_first (priv->configuration); item != NULL; item = g_list_delete_link (item, item))
591
AnjutaPluginHandle *handle = ANJUTA_PLUGIN_HANDLE (item->data);
592
AnjutaPluginDescription *desc;
596
item = g_list_delete_link (item, item);
597
group = (gchar *)(item->data);
598
key = group + strlen (group) + 1;
600
desc = anjuta_plugin_handle_get_description (handle);
601
anjuta_plugin_description_remove (desc, group, key);
603
priv->configuration = NULL;
604
g_list_free_full (priv->config_keys, (GDestroyNotify)g_free);
605
priv->config_keys = NULL;
487
611
anjuta_profile_select_plugins (AnjutaProfile *profile,
490
614
GList *selected_plugins = NULL;
491
GList *node = descs_list;
615
GList *node = handles_list;
492
616
AnjutaProfilePriv *priv;
494
618
priv = profile->priv;
543
681
xmlNodePtr xml_root;
545
683
xml_root = xmlDocGetRootElement(xml_doc);
548
686
xmlStrEqual(xml_root->name, (const xmlChar *)"anjuta"))
553
for (xml_node = xml_root->xmlChildrenNode; xml_node; xml_node = xml_node->next)
555
GList *groups = NULL;
556
GList *attribs = NULL;
557
GList *values = NULL;
558
xmlChar *name, *url, *mandatory_text;
559
xmlNodePtr xml_require_node;
562
if (!xml_node->name ||
563
!xmlStrEqual (xml_node->name, (const xmlChar*)"plugin"))
568
name = xmlGetProp (xml_node, (const xmlChar*)"name");
569
url = xmlGetProp (xml_node, (const xmlChar*)"url");
571
/* Ensure that both name is given */
574
g_warning ("XML error: Plugin name should be present in plugin tag");
579
url = xmlCharStrdup ("http://anjuta.org/plugins/");
581
/* Check if the plugin is mandatory */
582
mandatory_text = xmlGetProp (xml_node, (const xmlChar*)"mandatory");
583
mandatory = mandatory_text && (xmlStrcasecmp (mandatory_text, (const xmlChar *)"yes") == 0);
584
xmlFree(mandatory_text);
586
/* For all plugin attribute conditions */
587
for (xml_require_node = xml_node->xmlChildrenNode;
589
xml_require_node = xml_require_node->next)
595
if (!xml_require_node->name ||
596
!xmlStrEqual (xml_require_node->name,
597
(const xmlChar*)"require"))
601
group = xmlGetProp (xml_require_node,
602
(const xmlChar *)"group");
603
attrib = xmlGetProp(xml_require_node,
604
(const xmlChar *)"attribute");
605
value = xmlGetProp(xml_require_node,
606
(const xmlChar *)"value");
608
if (group && attrib && value)
610
groups = g_list_prepend (groups, group);
611
attribs = g_list_prepend (attribs, attrib);
612
values = g_list_prepend (values, value);
616
if (group) xmlFree (group);
617
if (attrib) xmlFree (attrib);
618
if (value) xmlFree (value);
620
g_warning ("XML parse error: group, attribute and value should be defined in require");
627
if (g_list_length (groups) == 0)
630
g_warning ("XML Error: No attributes to match given");
637
anjuta_plugin_manager_list_query (profile->priv->plugin_manager,
643
descs_list = g_list_prepend (descs_list, plugin_descs);
647
not_found_names = g_list_prepend (not_found_names, g_strdup ((const gchar *)name));
648
not_found_urls = g_list_prepend (not_found_urls, g_strdup ((const gchar *)url));
652
g_list_foreach (groups, (GFunc)xmlFree, NULL);
653
g_list_foreach (attribs, (GFunc)xmlFree, NULL);
654
g_list_foreach (values, (GFunc)xmlFree, NULL);
655
g_list_free (groups);
656
g_list_free (attribs);
657
g_list_free (values);
662
690
xmlFreeDoc(xml_doc);
692
set_parse_error (error, file);
698
parse_set (xmlNodePtr xml_node, GFile *file, GError **error)
700
GList *config = NULL;
701
gboolean parse_error = FALSE;
702
xmlNodePtr xml_require_node;
704
/* Read attribute conditions */
705
for (xml_require_node = xml_node->xmlChildrenNode;
707
xml_require_node = xml_require_node->next)
713
if (!xml_require_node->name ||
714
!xmlStrEqual (xml_require_node->name,
715
(const xmlChar*)"set"))
719
group = xmlGetProp (xml_require_node,
720
(const xmlChar *)"group");
721
attrib = xmlGetProp(xml_require_node,
722
(const xmlChar *)"attribute");
723
value = xmlGetProp(xml_require_node,
724
(const xmlChar *)"value");
726
if (group && attrib && value)
730
str = g_string_new ((const gchar *)group);
731
g_string_append_c (str, '\0');
732
g_string_append (str, (const gchar *)attrib);
733
g_string_append_c (str, '\0');
734
g_string_append (str, (const gchar *)value);
736
config = g_list_prepend (config, g_string_free (str, FALSE));
741
g_warning ("XML parse error: group, attribute and value should be defined in set");
743
if (group) xmlFree (group);
744
if (attrib) xmlFree (attrib);
745
if (value) xmlFree (value);
746
if (parse_error) break;
751
set_parse_error (error, file);
754
return g_list_reverse (config);
759
parse_requires (xmlNodePtr xml_node, AnjutaPluginManager *plugin_manager, GFile *file, GError **error)
761
GList *plugin_handles = NULL;
762
GList *groups = NULL;
763
GList *attribs = NULL;
764
GList *values = NULL;
765
gboolean parse_error = FALSE;
766
xmlNodePtr xml_require_node;
768
/* Read attribute conditions */
769
for (xml_require_node = xml_node->xmlChildrenNode;
771
xml_require_node = xml_require_node->next)
777
if (!xml_require_node->name ||
778
!xmlStrEqual (xml_require_node->name,
779
(const xmlChar*)"require"))
783
group = xmlGetProp (xml_require_node,
784
(const xmlChar *)"group");
785
attrib = xmlGetProp(xml_require_node,
786
(const xmlChar *)"attribute");
787
value = xmlGetProp(xml_require_node,
788
(const xmlChar *)"value");
790
if (group && attrib && value)
792
groups = g_list_prepend (groups, group);
793
attribs = g_list_prepend (attribs, attrib);
794
values = g_list_prepend (values, value);
798
if (group) xmlFree (group);
799
if (attrib) xmlFree (attrib);
800
if (value) xmlFree (value);
802
g_warning ("XML parse error: group, attribute and value should be defined in require");
667
/* Error during parsing */
668
gchar *uri = g_file_get_uri (file);
670
g_set_error (error, ANJUTA_PROFILE_ERROR,
671
ANJUTA_PROFILE_ERROR_URI_READ_FAILED,
672
_("Failed to read '%s': XML parse error. "
673
"Invalid or corrupted Anjuta plugins profile."),
809
set_parse_error (error, file);
813
if (g_list_length (groups) == 0)
816
g_warning ("XML Error: No attributes to match given");
821
anjuta_plugin_manager_list_query (plugin_manager,
827
g_list_free_full (groups, (GDestroyNotify)xmlFree);
828
g_list_free_full (attribs, (GDestroyNotify)xmlFree);
829
g_list_free_full (values, (GDestroyNotify)xmlFree);
832
return plugin_handles;
837
parse_filter (GList **set_list, xmlNodePtr xml_root, AnjutaPluginManager *plugin_manager, GFile *file, GError **error)
840
GError *parse_error = NULL;
841
GList *handles_list = NULL;
843
for (xml_node = xml_root->xmlChildrenNode; xml_node; xml_node = xml_node->next)
845
GList *plugin_handles = NULL;
848
if (!xml_node->name ||
849
!xmlStrEqual (xml_node->name, (const xmlChar*)"filter"))
854
/* Get all plugins fullfiling filter requirements */
855
plugin_handles = parse_requires (xml_node, plugin_manager, file, &parse_error);
856
if (parse_error != NULL)
858
g_propagate_error (error, parse_error);
861
handles_list = g_list_prepend (handles_list, plugin_handles);
863
set = parse_set (xml_node, file, &parse_error);
864
if (parse_error != NULL)
866
g_propagate_error (error, parse_error);
869
*set_list = g_list_prepend (*set_list, set);
875
/* Read plugins, return a list of plugin list */
877
parse_plugins (GList **set_list, xmlNodePtr xml_root, AnjutaPluginManager *plugin_manager, GFile *file, GError **error)
880
GError *parse_error = NULL;
881
GList *handles_list = NULL;
882
GList *not_found_names = NULL;
883
GList *not_found_urls = NULL;
885
/* Read plugin list */
886
for (xml_node = xml_root->xmlChildrenNode; xml_node; xml_node = xml_node->next)
888
xmlChar *name, *url, *mandatory_text;
890
GList *plugin_handles = NULL;
892
if (!xml_node->name ||
893
!xmlStrEqual (xml_node->name, (const xmlChar*)"plugin"))
898
name = xmlGetProp (xml_node, (const xmlChar*)"name");
899
url = xmlGetProp (xml_node, (const xmlChar*)"url");
677
g_list_foreach (descs_list, (GFunc)g_list_free, NULL);
678
g_list_free (descs_list);
901
/* Ensure that both name is given */
904
g_warning ("XML error: Plugin name should be present in plugin tag");
905
set_parse_error (&parse_error, file);
909
url = xmlCharStrdup ("http://anjuta.org/plugins/");
911
/* Check if the plugin is mandatory */
912
mandatory_text = xmlGetProp (xml_node, (const xmlChar*)"mandatory");
913
mandatory = mandatory_text && (xmlStrcasecmp (mandatory_text, (const xmlChar *)"yes") == 0);
914
xmlFree(mandatory_text);
916
plugin_handles = parse_requires (xml_node, plugin_manager, file, &parse_error);
917
if (parse_error != NULL) break;
920
GList *set = parse_set (xml_node, file, &parse_error);
921
if (parse_error != NULL) break;
923
handles_list = g_list_prepend (handles_list, plugin_handles);
924
*set_list = g_list_prepend (*set_list, set);
928
not_found_names = g_list_prepend (not_found_names, g_strdup ((const gchar *)name));
929
not_found_urls = g_list_prepend (not_found_urls, g_strdup ((const gchar *)url));
933
if (parse_error != NULL)
935
g_propagate_error (error, parse_error);
936
g_list_free_full (handles_list, (GDestroyNotify)g_list_free);
681
939
else if (not_found_names)
703
960
node_url = g_list_next (node_url);
705
962
g_set_error (error, ANJUTA_PROFILE_ERROR,
706
ANJUTA_PROFILE_ERROR_URI_READ_FAILED,
707
_("Failed to read '%s': Following mandatory plugins are missing:\n%s"),
963
ANJUTA_PROFILE_ERROR_PLUGIN_MISSING,
964
_("Failed to read '%s': Following mandatory plugins are missing"),
710
966
g_string_free (mesg, TRUE);
968
g_list_foreach (not_found_names, (GFunc)g_free, NULL);
969
g_list_free (not_found_names);
970
g_list_foreach (not_found_urls, (GFunc)g_free, NULL);
971
g_list_free (not_found_urls);
973
g_list_free_full (handles_list, (GDestroyNotify)g_list_free);
981
anjuta_profile_read_xml (AnjutaProfile *profile,
984
AnjutaProfilePriv *priv;
985
AnjutaProfileXml *xml;
987
GError *parse_error = NULL;
989
GHashTable *disable_hash;
990
gboolean filter = FALSE;
992
/* Check if there are new XML files */
993
priv = profile->priv;
994
if (priv->xml == NULL) return TRUE;
996
/* Read all xml file */
997
for (xml = priv->xml; xml != NULL; xml = xml->next)
999
xml->doc = load_profile_from_xml (xml->file, &parse_error);
1000
if (parse_error != NULL)
1002
g_propagate_error (error, parse_error);
1008
/* Get all plugins to load */
1009
for (xml = priv->xml; xml != NULL; xml = xml->next)
1011
GList *handles_list;
1013
GList *set_list = NULL;
712
g_list_foreach (descs_list, (GFunc)g_list_free, NULL);
713
g_list_free (descs_list);
716
g_list_foreach (not_found_names, (GFunc)g_free, NULL);
717
g_list_free (not_found_names);
718
g_list_foreach (not_found_urls, (GFunc)g_free, NULL);
719
g_list_free (not_found_urls);
1015
/* Parse plugin in xml file */
1016
xml_root = xmlDocGetRootElement(xml->doc);
1017
handles_list = parse_plugins (&set_list, xml_root, priv->plugin_manager, xml->file, &parse_error);
1018
if (parse_error != NULL) break;
1020
anjuta_profile_configure_plugins (profile, handles_list, set_list);
1022
plugin_list = anjuta_profile_select_plugins (profile, handles_list);
1023
g_list_foreach (handles_list, (GFunc)g_list_free, NULL);
1024
g_list_free (handles_list);
1025
for (; plugin_list != NULL; plugin_list = g_list_delete_link (plugin_list, plugin_list))
1027
g_hash_table_add (priv->plugins_to_load, plugin_list->data);
1028
if (xml->exclude_from_sync) g_hash_table_add (priv->plugins_to_exclude_from_sync, plugin_list->data);
1032
/* Get all disable plugins */
1033
if (priv->plugins_to_disable == NULL)
1035
disable_list = anjuta_plugin_manager_list_query (priv->plugin_manager, NULL, NULL, NULL);
1039
disable_list = priv->plugins_to_disable;
1041
disable_hash = g_hash_table_new (g_direct_hash, g_direct_equal);
1042
for (; disable_list != NULL; disable_list = g_list_delete_link (disable_list, disable_list))
1044
g_hash_table_add (disable_hash, disable_list->data);
1046
for (xml = priv->xml; xml != NULL; xml = xml->next)
1048
GList *handles_list;
1050
GList *set_list = NULL;
1052
/* Parse filter in xml file */
1053
xml_root = xmlDocGetRootElement(xml->doc);
1054
handles_list = parse_filter (&set_list, xml_root, priv->plugin_manager, xml->file, &parse_error);
1055
if (parse_error != NULL) break;
1057
anjuta_profile_configure_plugins (profile, handles_list, set_list);
1059
filter = filter || (handles_list != NULL);
1060
for (plugin_list = g_list_first (handles_list); plugin_list != NULL; plugin_list = g_list_next (plugin_list))
1063
for (node = g_list_first ((GList *)plugin_list->data); node != NULL; node = g_list_next (node))
1065
g_hash_table_remove (disable_hash, node->data);
1068
g_list_foreach (handles_list, (GFunc)g_list_free, NULL);
1069
g_list_free (handles_list);
1073
/* Filter some plugins */
1074
priv->plugins_to_disable = g_hash_table_get_keys (disable_hash);
1075
anjuta_plugin_manager_set_disable_plugins (priv->plugin_manager, priv->plugins_to_disable, TRUE);
1079
/* No filter, keep all plugins */
1080
priv->plugins_to_disable = NULL;
1082
g_hash_table_destroy (disable_hash);
1083
if (parse_error != NULL) return FALSE;
1086
/* Remove xml object */
1087
while (priv->xml != NULL)
1089
AnjutaProfileXml *next;
1091
next = priv->xml->next;
1092
g_object_unref (priv->xml->file);
1093
xmlFreeDoc(priv->xml->doc);
1098
if (parse_error != NULL) g_propagate_error (error, parse_error);
1100
return parse_error == NULL;
1106
*---------------------------------------------------------------------------*/
725
1109
* anjuta_profile_add_plugins_from_xml:
726
1110
* @profile: a #AnjutaProfile object.
727
1111
* @profile_xml_file: xml file containing plugin list.
728
* @exclude_from_sync: TRUE if these plugins shouldn't be saved in user session.
1112
* @exclude_from_sync: %TRUE if these plugins shouldn't be saved in user session.
729
1113
* @error: error propagation and reporting.
731
1115
* Add all plugins inscribed in the xml file into the profile plugin list.
733
* Return value: TRUE on success, FALSE otherwise.
1117
* Return value: %TRUE on success, %FALSE otherwise.
736
1120
anjuta_profile_add_plugins_from_xml (AnjutaProfile *profile,
1288
* anjuta_profile_load:
1289
* @profile: a #AnjutaProfile object.
1290
* @error: error propagation and reporting.
1294
* Return value: TRUE on success, FALSE otherwise.
1297
anjuta_profile_load (AnjutaProfile *profile, GError **error)
1299
AnjutaProfilePriv *priv;
1300
GList *active_plugins, *node;
1301
GHashTable *active_hash;
1303
/* Read XML file if needed */
1304
if (!anjuta_profile_read_xml (profile, error)) return FALSE;
1305
priv = profile->priv;
1307
/* Deactivate plugins that are already active, but are not requested to be
1309
active_plugins = anjuta_plugin_manager_get_active_plugins (priv->plugin_manager);
1310
for (node = active_plugins; node != NULL; node = g_list_next (node))
1312
AnjutaPluginHandle *handle = (AnjutaPluginHandle *)node->data;
1314
if (anjuta_plugin_handle_get_can_unload (handle) &&
1315
!g_hash_table_lookup (priv->plugins_to_load, handle))
1317
anjuta_plugin_manager_unload_plugin_by_handle (priv->plugin_manager,
1322
/* Prepare active plugins hash */
1323
active_hash = g_hash_table_new (g_direct_hash, g_direct_equal);
1324
for (node = active_plugins; node != NULL; node = g_list_next (node))
1326
g_hash_table_add (active_hash, node->data);
1328
g_list_free (active_plugins);
1330
/* Prepare the plugins to activate */
1331
active_plugins = g_hash_table_get_keys (priv->plugins_to_load);
1332
for (node = active_plugins; node != NULL;)
1334
AnjutaPluginHandle *handle = (AnjutaPluginHandle *)node->data;
1335
GList *next = g_list_next (node);
1337
if (g_hash_table_lookup (active_hash, handle) != NULL)
1339
active_plugins = g_list_delete_link (active_plugins, node);
1343
g_hash_table_destroy (active_hash);
1345
/* For system profile, marks its plugin to keep them activated */
1346
if (strcmp (priv->name, ANJUTA_SYSTEM_PROFILE_NAME) == 0)
1348
for (node = g_list_first (active_plugins); node != NULL; node = g_list_next (node))
1350
anjuta_plugin_handle_set_can_unload (ANJUTA_PLUGIN_HANDLE (node->data), FALSE);
1354
/* Now activate the plugins */
1355
if (active_plugins != NULL)
1357
anjuta_plugin_manager_activate_plugins (priv->plugin_manager,
1359
g_list_free (active_plugins);
1362
/* Enable profile synchronization */
1363
g_signal_connect (priv->plugin_manager, "plugin-activated",
1364
G_CALLBACK (on_plugin_activated), profile);
1365
g_signal_connect (priv->plugin_manager, "plugin-deactivated",
1366
G_CALLBACK (on_plugin_deactivated), profile);
1368
g_signal_emit_by_name (profile, "scoped");
1375
* anjuta_profile_load:
1376
* @profile: a #AnjutaProfile object.
1377
* @error: error propagation and reporting.
1379
* Unload the profile
1381
* Return value: TRUE on success, FALSE otherwise.
1384
anjuta_profile_unload (AnjutaProfile *profile, GError **error)
1386
AnjutaProfilePriv *priv;
1388
/* Disable profile synchronization while the profile is being activated */
1389
priv = profile->priv;
1390
g_signal_handlers_disconnect_by_func (priv->plugin_manager,
1391
G_CALLBACK (on_plugin_activated),
1393
g_signal_handlers_disconnect_by_func (priv->plugin_manager,
1394
G_CALLBACK (on_plugin_deactivated),
1397
/* Do not unload system profile */
1398
if (strcmp (priv->name, ANJUTA_SYSTEM_PROFILE_NAME) == 0) return TRUE;
1400
/* Remove profile configuration */
1401
anjuta_profile_unconfigure_plugins (profile);
1403
/* Re-enable disabled plugins */
1404
anjuta_plugin_manager_set_disable_plugins (priv->plugin_manager, priv->plugins_to_disable, FALSE);
1406
/* Emit pre-change for the last profile */
1409
g_signal_emit_by_name (profile, "descoped");