# HG changeset patch
# Node ID dfad7c2fb095ee1af1d66df0d09ecae883985250
# Parent  dd2d26e6c6f9c2bd2e62509e03f424a972f87300
diff --git a/protocols/demo/purpledemocontacts.c b/protocols/demo/purpledemocontacts.c
--- a/protocols/demo/purpledemocontacts.c
+++ b/protocols/demo/purpledemocontacts.c
@@ -33,7 +33,8 @@ purple_demo_contacts_load_contact_icon(P
 	GError *error = NULL;
 	char *path = NULL;
 
-	path = g_strdup_printf("/im/pidgin/purple/demo/buddy_icons/%s.png", name);
+	path = g_strdup_printf("/im/pidgin/libpurple/protocols/demo/buddy_icons/%s.png",
+	                       name);
 	avatar = purple_avatar_new_from_resource(path, &error);
 
 	if(error != NULL) {
@@ -318,8 +319,13 @@ purple_demo_contacts_load(PurpleAccount 
 
 	/* get a stream to the contacts.json resource */
 	istream = g_resource_open_stream(purple_demo_get_resource(),
-	                                 "/im/pidgin/purple/demo/contacts.json",
-	                                 G_RESOURCE_LOOKUP_FLAGS_NONE, NULL);
+	                                 "/im/pidgin/libpurple/protocols/demo/contacts.json",
+	                                 G_RESOURCE_LOOKUP_FLAGS_NONE, &error);
+	if(!G_IS_INPUT_STREAM(istream)) {
+		g_critical("%s", error->message);
+		g_clear_error(&error);
+		return;
+	}
 
 	/* create our parser */
 	parser = json_parser_new();
diff --git a/protocols/demo/purpledemoprotocol.c b/protocols/demo/purpledemoprotocol.c
--- a/protocols/demo/purpledemoprotocol.c
+++ b/protocols/demo/purpledemoprotocol.c
@@ -96,7 +96,7 @@ purple_demo_protocol_new(void) {
 		"description", "A protocol plugin with static data to be used in "
 		               "screen shots.",
 		"icon-name", "im-purple-demo",
-		"icon-resource-path", "/im/pidgin/purple/demo/icons",
+		"icon-resource-path", "/im/pidgin/libpurple/protocols/demo/icons",
 		"options", OPT_PROTO_NO_PASSWORD,
 		NULL);
 }
diff --git a/protocols/demo/purpledemoprotocolactions.c b/protocols/demo/purpledemoprotocolactions.c
--- a/protocols/demo/purpledemoprotocolactions.c
+++ b/protocols/demo/purpledemoprotocolactions.c
@@ -290,6 +290,7 @@ purple_demo_protocol_request_fields_acti
 	GBytes *icon = NULL;
 	gconstpointer icon_data = NULL;
 	gsize icon_len = 0;
+	GError *error = NULL;
 
 	if(!g_variant_is_of_type(parameter, G_VARIANT_TYPE_STRING)) {
 		g_critical("Demo failure action parameter is of incorrect type %s",
@@ -400,15 +401,22 @@ purple_demo_protocol_request_fields_acti
 	g_object_bind_property(boolfield, "value", field, "sensitive", 0);
 	purple_request_group_add_field(group, field);
 
-	icon = g_resource_lookup_data(purple_demo_get_resource(),
-	                              "/im/pidgin/purple/demo/icons/scalable/apps/im-purple-demo.svg",
-	                              G_RESOURCE_LOOKUP_FLAGS_NONE, NULL);
-	icon_data = g_bytes_get_data(icon, &icon_len);
-	field = purple_request_field_image_new("image", _("An image"),
-	                                       icon_data, icon_len);
-	g_object_bind_property(boolfield, "value", field, "sensitive", 0);
-	purple_request_group_add_field(group, field);
-	g_bytes_unref(icon);
+	icon = g_resource_lookup_data(
+		purple_demo_get_resource(),
+	    "/im/pidgin/libpurple/protocols/demo/icons/scalable/apps/im-purple-demo.svg",
+	    G_RESOURCE_LOOKUP_FLAGS_NONE,
+		&error);
+	if(icon != NULL) {
+		icon_data = g_bytes_get_data(icon, &icon_len);
+		field = purple_request_field_image_new("image", _("An image"),
+		                                       icon_data, icon_len);
+		g_object_bind_property(boolfield, "value", field, "sensitive", 0);
+		purple_request_group_add_field(group, field);
+		g_bytes_unref(icon);
+	} else {
+		g_warning("Failed to load test image: %s", error->message);
+		g_clear_error(&error);
+	}
 
 	field = purple_request_field_account_new("account", _("An account"),
 	                                         account);
diff --git a/protocols/demo/resources/purpledemo.gresource.xml b/protocols/demo/resources/purpledemo.gresource.xml
--- a/protocols/demo/resources/purpledemo.gresource.xml
+++ b/protocols/demo/resources/purpledemo.gresource.xml
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <gresources>
-  <gresource prefix="/im/pidgin/purple/demo">
+  <gresource prefix="/im/pidgin/libpurple/protocols/demo">
     <file compressed="true" preprocess="json-stripblanks">contacts.json</file>
     <file>icons/128x128/badges/demo-badge-crazy-patch-writer.png</file>
     <file>icons/128x128/badges/demo-badge-developer.png</file>
diff --git a/protocols/ircv3/purpleircv3protocol.c b/protocols/ircv3/purpleircv3protocol.c
--- a/protocols/ircv3/purpleircv3protocol.c
+++ b/protocols/ircv3/purpleircv3protocol.c
@@ -253,7 +253,7 @@ purple_ircv3_protocol_new(void) {
 		"name", "IRCv3",
 		"description", _("Version 3 of Internet Relay Chat (IRC)."),
 		"icon-name", PURPLE_IRCV3_ICON_NAME,
-		"icon-resource-path", "/im/pidgin/libpurple/ircv3/icons",
+		"icon-resource-path", "/im/pidgin/libpurple/protocols/ircv3/icons",
 		"options", OPT_PROTO_CHAT_TOPIC | OPT_PROTO_PASSWORD_OPTIONAL |
 		           OPT_PROTO_SLASH_COMMANDS_NATIVE,
 		NULL);
diff --git a/protocols/ircv3/resources/ircv3.gresource.xml b/protocols/ircv3/resources/ircv3.gresource.xml
--- a/protocols/ircv3/resources/ircv3.gresource.xml
+++ b/protocols/ircv3/resources/ircv3.gresource.xml
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <gresources>
-  <gresource prefix="/im/pidgin/libpurple/ircv3">
+  <gresource prefix="/im/pidgin/libpurple/protocols/ircv3">
     <file>icons/16x16/apps/im-ircv3.png</file>
     <file>icons/22x22/apps/im-ircv3.png</file>
     <file>icons/48x48/apps/im-ircv3.png</file>
