plugins/perl/perl.c

changeset 12984
efb5a11f13b2
parent 12890
7152afb4df01
child 12988
2a53945982f5
--- a/plugins/perl/perl.c	Sun Jan 22 05:11:13 2006 +0000
+++ b/plugins/perl/perl.c	Sun Jan 22 05:17:38 2006 +0000
@@ -299,6 +299,8 @@
 			/* We know this one exists. */
 			key = hv_fetch(plugin_info, "name", strlen("name"), 0);
 			info->name = g_strdup(SvPV(*key, len));
+			/* Set id here in case we don't find one later. */
+			info->id = g_strdup(SvPV(*key, len));
 
 			if ((key = hv_fetch(plugin_info, "GTK_UI",
 			                    strlen("GTK_UI"), 0)))
@@ -324,11 +326,10 @@
 			                    strlen("version"), 0)))
 				info->version = g_strdup(SvPV(*key, len));
 
-			if ((key = hv_fetch(plugin_info, "load",
-			                    strlen("load"), 0)))
-				gps->load_sub = g_strdup_printf("%s::%s",
-				                                gps->package,
-				                                SvPV(*key, len));
+			/* We know this one exists. */
+			key = hv_fetch(plugin_info, "load", strlen("load"), 0);
+			gps->load_sub = g_strdup_printf("%s::%s", gps->package,
+			                                SvPV(*key, len));
 
 			if ((key = hv_fetch(plugin_info, "unload",
 			                    strlen("unload"), 0)))
@@ -336,6 +337,13 @@
 				                                  gps->package,
 				                                  SvPV(*key, len));
 
+			if ((key = hv_fetch(plugin_info, "id",
+			                    strlen("id"), 0))) {
+				g_free(info->id);
+				info->id = g_strdup_printf("perl-%s",
+				                           SvPV(*key, len));
+			}
+
 		/********************************************************/
 		/* Only one of the next two options should be present   */
 		/*                                                      */

mercurial