Sun, 01 Sep 2013 01:40:21 +0530
Refactored the protocols to use the error argument of purple_protocols_{add/remove}
--- a/libpurple/protocols.h Sun Sep 01 00:58:23 2013 +0530 +++ b/libpurple/protocols.h Sun Sep 01 01:40:21 2013 +0530 @@ -152,7 +152,9 @@ } PurpleProtocolOptions; +#include "media.h" #include "protocol.h" +#include "status.h" #define PURPLE_TYPE_PROTOCOL_CHAT_ENTRY (purple_protocol_chat_entry_get_type()) @@ -581,7 +583,7 @@ * @param protocol The protocol to remove. * @param error Return location for a #GError or @c NULL. If provided, this * will be set to the reason if removing fails. - + * * @return TRUE if the protocol was removed, else FALSE. */ gboolean purple_protocols_remove(PurpleProtocol *protocol, GError **error);
--- a/libpurple/protocols/bonjour/bonjour.c Sun Sep 01 00:58:23 2013 +0530 +++ b/libpurple/protocols/bonjour/bonjour.c Sun Sep 01 01:40:21 2013 +0530 @@ -718,12 +718,9 @@ static gboolean plugin_load(PurplePlugin *plugin, GError **error) { - my_protocol = purple_protocols_add(BONJOUR_TYPE_PROTOCOL); - - if (!my_protocol) { - g_set_error(error, BONJOUR_DOMAIN, 0, _("Failed to add bonjour protocol")); + my_protocol = purple_protocols_add(BONJOUR_TYPE_PROTOCOL, error); + if (!my_protocol) return FALSE; - } return TRUE; } @@ -731,10 +728,8 @@ static gboolean plugin_unload(PurplePlugin *plugin, GError **error) { - if (!purple_protocols_remove(my_protocol)) { - g_set_error(error, BONJOUR_DOMAIN, 0, _("Failed to remove bonjour protocol")); + if (!purple_protocols_remove(my_protocol, error)) return FALSE; - } return TRUE; }
--- a/libpurple/protocols/bonjour/bonjour.h Sun Sep 01 00:58:23 2013 +0530 +++ b/libpurple/protocols/bonjour/bonjour.h Sun Sep 01 01:40:21 2013 +0530 @@ -38,7 +38,6 @@ #define BONJOUR_ID "prpl-bonjour" #define BONJOUR_NAME "Bonjour" -#define BONJOUR_DOMAIN (g_quark_from_static_string(BONJOUR_ID)) #define BONJOUR_STATUS_ID_OFFLINE "offline" #define BONJOUR_STATUS_ID_AVAILABLE "available"
--- a/libpurple/protocols/gg/gg.c Sun Sep 01 00:58:23 2013 +0530 +++ b/libpurple/protocols/gg/gg.c Sun Sep 01 01:40:21 2013 +0530 @@ -1521,12 +1521,9 @@ static gboolean plugin_load(PurplePlugin *plugin, GError **error) { - my_protocol = purple_protocols_add(GGP_TYPE_PROTOCOL); - - if (!my_protocol) { - g_set_error(error, GGP_DOMAIN, 0, _("Failed to add gg protocol")); + my_protocol = purple_protocols_add(GGP_TYPE_PROTOCOL, error); + if (!my_protocol) return FALSE; - } return TRUE; } @@ -1534,10 +1531,8 @@ static gboolean plugin_unload(PurplePlugin *plugin, GError **error) { - if (!purple_protocols_remove(my_protocol)) { - g_set_error(error, GGP_DOMAIN, 0, _("Failed to remove gg protocol")); + if (!purple_protocols_remove(my_protocol, error)) return FALSE; - } return TRUE; }
--- a/libpurple/protocols/gg/gg.h Sun Sep 01 00:58:23 2013 +0530 +++ b/libpurple/protocols/gg/gg.h Sun Sep 01 01:40:21 2013 +0530 @@ -42,7 +42,6 @@ #define GGP_ID "prpl-gg" #define GGP_NAME "Gadu-Gadu" -#define GGP_DOMAIN (g_quark_from_static_string(GGP_ID)) #define GGP_TYPE_PROTOCOL (ggp_protocol_get_type()) #define GGP_PROTOCOL(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GGP_TYPE_PROTOCOL, GaduGaduProtocol))
--- a/libpurple/protocols/irc/irc.c Sun Sep 01 00:58:23 2013 +0530 +++ b/libpurple/protocols/irc/irc.c Sun Sep 01 01:40:21 2013 +0530 @@ -1040,12 +1040,9 @@ static gboolean plugin_load(PurplePlugin *plugin, GError **error) { - _irc_protocol = purple_protocols_add(IRC_TYPE_PROTOCOL); - - if (!_irc_protocol) { - g_set_error(error, IRC_DOMAIN, 0, _("Failed to add irc protocol")); + _irc_protocol = purple_protocols_add(IRC_TYPE_PROTOCOL, error); + if (!_irc_protocol) return FALSE; - } return TRUE; } @@ -1053,10 +1050,8 @@ static gboolean plugin_unload(PurplePlugin *plugin, GError **error) { - if (!purple_protocols_remove(_irc_protocol)) { - g_set_error(error, IRC_DOMAIN, 0, _("Failed to remove irc protocol")); + if (!purple_protocols_remove(_irc_protocol, error)) return FALSE; - } return TRUE; }
--- a/libpurple/protocols/irc/irc.h Sun Sep 01 00:58:23 2013 +0530 +++ b/libpurple/protocols/irc/irc.h Sun Sep 01 01:40:21 2013 +0530 @@ -36,7 +36,6 @@ #define IRC_ID "prpl-irc" #define IRC_NAME "IRC" -#define IRC_DOMAIN (g_quark_from_static_string(IRC_ID)) #define IRC_TYPE_PROTOCOL (irc_protocol_get_type()) #define IRC_PROTOCOL(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), IRC_TYPE_PROTOCOL, IRCProtocol))
--- a/libpurple/protocols/jabber/libfacebook.c Sun Sep 01 00:58:23 2013 +0530 +++ b/libpurple/protocols/jabber/libfacebook.c Sun Sep 01 01:40:21 2013 +0530 @@ -222,11 +222,9 @@ static gboolean plugin_load(PurplePlugin *plugin, GError **error) { - my_protocol = purple_protocols_add(FACEBOOK_TYPE_PROTOCOL); - if (!my_protocol) { - g_set_error(error, FACEBOOK_DOMAIN, 0, _("Failed to add facebook protocol")); + my_protocol = purple_protocols_add(FACEBOOK_TYPE_PROTOCOL, error); + if (!my_protocol) return FALSE; - } purple_signal_connect(purple_get_core(), "uri-handler", my_protocol, PURPLE_CALLBACK(xmpp_uri_handler), NULL); @@ -239,10 +237,8 @@ plugin_unload(PurplePlugin *plugin, GError **error) { jabber_protocol_uninit(my_protocol); - if (!purple_protocols_remove(my_protocol)) { - g_set_error(error, FACEBOOK_DOMAIN, 0, _("Failed to remove facebook protocol")); + if (!purple_protocols_remove(my_protocol, error)) return FALSE; - } return TRUE; }
--- a/libpurple/protocols/jabber/libfacebook.h Sun Sep 01 00:58:23 2013 +0530 +++ b/libpurple/protocols/jabber/libfacebook.h Sun Sep 01 01:40:21 2013 +0530 @@ -26,7 +26,6 @@ #define FACEBOOK_ID "prpl-facebook-xmpp" #define FACEBOOK_NAME "Facebook (XMPP)" -#define FACEBOOK_DOMAIN (g_quark_from_static_string(FACEBOOK_ID)) #define FACEBOOK_TYPE_PROTOCOL (facebook_protocol_get_type()) #define FACEBOOK_PROTOCOL(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), FACEBOOK_TYPE_PROTOCOL, FacebookProtocol))
--- a/libpurple/protocols/jabber/libgtalk.c Sun Sep 01 00:58:23 2013 +0530 +++ b/libpurple/protocols/jabber/libgtalk.c Sun Sep 01 01:40:21 2013 +0530 @@ -215,11 +215,9 @@ static gboolean plugin_load(PurplePlugin *plugin, GError **error) { - my_protocol = purple_protocols_add(GTALK_TYPE_PROTOCOL); - if (!my_protocol) { - g_set_error(error, GTALK_DOMAIN, 0, _("Failed to add gtalk protocol")); + my_protocol = purple_protocols_add(GTALK_TYPE_PROTOCOL, error); + if (!my_protocol) return FALSE; - } purple_signal_connect(purple_get_core(), "uri-handler", my_protocol, PURPLE_CALLBACK(xmpp_uri_handler), NULL); @@ -232,10 +230,8 @@ plugin_unload(PurplePlugin *plugin, GError **error) { jabber_protocol_uninit(my_protocol); - if (!purple_protocols_remove(my_protocol)) { - g_set_error(error, GTALK_DOMAIN, 0, _("Failed to remove gtalk protocol")); + if (!purple_protocols_remove(my_protocol, error)) return FALSE; - } return TRUE; }
--- a/libpurple/protocols/jabber/libgtalk.h Sun Sep 01 00:58:23 2013 +0530 +++ b/libpurple/protocols/jabber/libgtalk.h Sun Sep 01 01:40:21 2013 +0530 @@ -26,7 +26,6 @@ #define GTALK_ID "prpl-gtalk" #define GTALK_NAME "Google Talk (XMPP)" -#define GTALK_DOMAIN (g_quark_from_static_string(GTALK_ID)) #define GTALK_TYPE_PROTOCOL (gtalk_protocol_get_type()) #define GTALK_PROTOCOL(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GTALK_TYPE_PROTOCOL, GTalkProtocol))
--- a/libpurple/protocols/jabber/libxmpp.c Sun Sep 01 00:58:23 2013 +0530 +++ b/libpurple/protocols/jabber/libxmpp.c Sun Sep 01 01:40:21 2013 +0530 @@ -198,11 +198,9 @@ static gboolean plugin_load(PurplePlugin *plugin, GError **error) { - my_protocol = purple_protocols_add(XMPP_TYPE_PROTOCOL); - if (!my_protocol) { - g_set_error(error, XMPP_DOMAIN, 0, _("Failed to add jabber protocol")); + my_protocol = purple_protocols_add(XMPP_TYPE_PROTOCOL, error); + if (!my_protocol) return FALSE; - } purple_signal_connect(purple_get_core(), "uri-handler", my_protocol, PURPLE_CALLBACK(xmpp_uri_handler), NULL); @@ -215,10 +213,8 @@ plugin_unload(PurplePlugin *plugin, GError **error) { jabber_protocol_uninit(my_protocol); - if (!purple_protocols_remove(my_protocol)) { - g_set_error(error, XMPP_DOMAIN, 0, _("Failed to remove jabber protocol")); + if (!purple_protocols_remove(my_protocol, error)) return FALSE; - } return TRUE; }
--- a/libpurple/protocols/jabber/libxmpp.h Sun Sep 01 00:58:23 2013 +0530 +++ b/libpurple/protocols/jabber/libxmpp.h Sun Sep 01 01:40:21 2013 +0530 @@ -24,8 +24,6 @@ #include "jabber.h" -#define XMPP_DOMAIN (g_quark_from_static_string(JABBER_ID)) - #define XMPP_TYPE_PROTOCOL (xmpp_protocol_get_type()) #define XMPP_PROTOCOL(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), XMPP_TYPE_PROTOCOL, XMPPProtocol)) #define XMPP_PROTOCOL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), XMPP_TYPE_PROTOCOL, XMPPProtocolClass))
--- a/libpurple/protocols/msn/msn.c Sun Sep 01 00:58:23 2013 +0530 +++ b/libpurple/protocols/msn/msn.c Sun Sep 01 01:40:21 2013 +0530 @@ -3007,11 +3007,9 @@ static gboolean plugin_load(PurplePlugin *plugin, GError **error) { - my_protocol = purple_protocols_add(MSN_TYPE_PROTOCOL); - if (!my_protocol) { - g_set_error(error, MSN_DOMAIN, 0, _("Failed to add msn protocol")); + my_protocol = purple_protocols_add(MSN_TYPE_PROTOCOL, error); + if (!my_protocol) return FALSE; - } purple_signal_connect(purple_get_core(), "uri-handler", my_protocol, PURPLE_CALLBACK(msn_uri_handler), NULL); @@ -3022,10 +3020,8 @@ static gboolean plugin_unload(PurplePlugin *plugin, GError **error) { - if (!purple_protocols_remove(my_protocol)) { - g_set_error(error, MSN_DOMAIN, 0, _("Failed to remove msn protocol")); + if (!purple_protocols_remove(my_protocol, error)) return FALSE; - } return TRUE; }
--- a/libpurple/protocols/mxit/mxit.c Sun Sep 01 00:58:23 2013 +0530 +++ b/libpurple/protocols/mxit/mxit.c Sun Sep 01 01:40:21 2013 +0530 @@ -854,12 +854,9 @@ static gboolean plugin_load( PurplePlugin *plugin, GError **error ) { - my_protocol = purple_protocols_add(MXIT_TYPE_PROTOCOL); - - if (!my_protocol) { - g_set_error(error, MXIT_PLUGIN_DOMAIN, 0, _("Failed to add mxit protocol")); + my_protocol = purple_protocols_add(MXIT_TYPE_PROTOCOL, error); + if (!my_protocol) return FALSE; - } return TRUE; } @@ -874,10 +871,8 @@ static gboolean plugin_unload( PurplePlugin *plugin, GError **error ) { - if (!purple_protocols_remove(my_protocol)) { - g_set_error(error, MXIT_PLUGIN_DOMAIN, 0, _("Failed to remove mxit protocol")); + if (!purple_protocols_remove(my_protocol, error)) return FALSE; - } return TRUE; }
--- a/libpurple/protocols/mxit/mxit.h Sun Sep 01 00:58:23 2013 +0530 +++ b/libpurple/protocols/mxit/mxit.h Sun Sep 01 01:40:21 2013 +0530 @@ -70,8 +70,6 @@ #define MXIT_PLUGIN_SUMMARY "MXit Protocol Plugin" #define MXIT_PLUGIN_DESC "MXit" -#define MXIT_PLUGIN_DOMAIN (g_quark_from_static_string(MXIT_PLUGIN_ID)) - #define MXIT_HTTP_USERAGENT "libpurple-"DISPLAY_VERSION
--- a/libpurple/protocols/myspace/myspace.c Sun Sep 01 00:58:23 2013 +0530 +++ b/libpurple/protocols/myspace/myspace.c Sun Sep 01 01:40:21 2013 +0530 @@ -3492,11 +3492,9 @@ return FALSE; #endif /* MSIM_SELF_TEST */ - my_protocol = purple_protocols_add(MSIM_TYPE_PROTOCOL); - if (!my_protocol) { - g_set_error(error, MSIM_DOMAIN, 0, _("Failed to add myspace protocol")); + my_protocol = purple_protocols_add(MSIM_TYPE_PROTOCOL, error); + if (!my_protocol) return FALSE; - } purple_signal_connect(purple_get_core(), "uri-handler", my_protocol, PURPLE_CALLBACK(msim_uri_handler), NULL); @@ -3510,10 +3508,8 @@ static gboolean plugin_unload(PurplePlugin *plugin, GError **error) { - if (!purple_protocols_remove(my_protocol)) { - g_set_error(error, MSIM_DOMAIN, 0, _("Failed to remove myspace protocol")); + if (!purple_protocols_remove(my_protocol, error)) return FALSE; - } return TRUE; }
--- a/libpurple/protocols/myspace/myspace.h Sun Sep 01 00:58:23 2013 +0530 +++ b/libpurple/protocols/myspace/myspace.h Sun Sep 01 01:40:21 2013 +0530 @@ -63,7 +63,6 @@ #define MSIM_ID "prpl-myspace" #define MSIM_NAME "MySpaceIM" -#define MSIM_DOMAIN (g_quark_from_static_string(MSIM_ID)) #define MSIM_TYPE_PROTOCOL (msim_protocol_get_type()) #define MSIM_PROTOCOL(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), MSIM_TYPE_PROTOCOL, MySpaceProtocol))
--- a/libpurple/protocols/novell/novell.c Sun Sep 01 00:58:23 2013 +0530 +++ b/libpurple/protocols/novell/novell.c Sun Sep 01 01:40:21 2013 +0530 @@ -3560,12 +3560,10 @@ static gboolean plugin_load(PurplePlugin *plugin, GError **error) { - my_protocol = purple_protocols_add(NOVELL_TYPE_PROTOCOL); - - if (!my_protocol) { - g_set_error(error, NOVELL_DOMAIN, 0, _("Failed to add novell protocol")); + my_protocol = purple_protocols_add(NOVELL_TYPE_PROTOCOL, error); + + if (!my_protocol) return FALSE; - } return TRUE; } @@ -3573,10 +3571,8 @@ static gboolean plugin_unload(PurplePlugin *plugin, GError **error) { - if (!purple_protocols_remove(my_protocol)) { - g_set_error(error, NOVELL_DOMAIN, 0, _("Failed to remove novell protocol")); + if (!purple_protocols_remove(my_protocol, error)) return FALSE; - } return TRUE; }
--- a/libpurple/protocols/novell/novell.h Sun Sep 01 00:58:23 2013 +0530 +++ b/libpurple/protocols/novell/novell.h Sun Sep 01 01:40:21 2013 +0530 @@ -26,7 +26,6 @@ #define NOVELL_ID "prpl-novell" #define NOVELL_NAME "GroupWise" -#define NOVELL_DOMAIN (g_quark_from_static_string(NOVELL_ID)) #define NOVELL_TYPE_PROTOCOL (novell_protocol_get_type()) #define NOVELL_PROTOCOL(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), NOVELL_TYPE_PROTOCOL, NovellProtocol))
--- a/libpurple/protocols/null/nullprotocol.c Sun Sep 01 00:58:23 2013 +0530 +++ b/libpurple/protocols/null/nullprotocol.c Sun Sep 01 01:40:21 2013 +0530 @@ -1189,12 +1189,9 @@ static gboolean plugin_load(PurplePlugin *plugin, GError **error) { - my_protocol = purple_protocols_add(NULL_TYPE_PROTOCOL); - - if (!my_protocol) { - g_set_error(error, NULL_DOMAIN, 0, _("Failed to add null protocol")); + my_protocol = purple_protocols_add(NULL_TYPE_PROTOCOL, error); + if (!my_protocol) return FALSE; - } return TRUE; } @@ -1202,10 +1199,8 @@ static gboolean plugin_unload(PurplePlugin *plugin, GError **error) { - if (!purple_protocols_remove(my_protocol)) { - g_set_error(error, NULL_DOMAIN, 0, _("Failed to remove null protocol")); + if (!purple_protocols_remove(my_protocol, error)) return FALSE; - } return TRUE; }
--- a/libpurple/protocols/null/nullprotocol.h Sun Sep 01 00:58:23 2013 +0530 +++ b/libpurple/protocols/null/nullprotocol.h Sun Sep 01 01:40:21 2013 +0530 @@ -26,7 +26,6 @@ #define NULL_ID "prpl-null" #define NULL_NAME "Null - Testing Plugin" -#define NULL_DOMAIN (g_quark_from_static_string(NULL_ID)) #define NULL_TYPE_PROTOCOL (null_protocol_get_type()) #define NULL_PROTOCOL(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), NULL_TYPE_PROTOCOL, NullProtocol))
--- a/libpurple/protocols/oscar/libaim.c Sun Sep 01 00:58:23 2013 +0530 +++ b/libpurple/protocols/oscar/libaim.c Sun Sep 01 01:40:21 2013 +0530 @@ -79,11 +79,9 @@ static gboolean plugin_load(PurplePlugin *plugin, GError **error) { - my_protocol = purple_protocols_add(AIM_TYPE_PROTOCOL); - if (!my_protocol) { - g_set_error(error, AIM_DOMAIN, 0, _("Failed to add aim protocol")); + my_protocol = purple_protocols_add(AIM_TYPE_PROTOCOL, error); + if (!my_protocol) return FALSE; - } purple_signal_connect(purple_get_core(), "uri-handler", my_protocol, PURPLE_CALLBACK(oscar_uri_handler), NULL); @@ -94,10 +92,8 @@ static gboolean plugin_unload(PurplePlugin *plugin, GError **error) { - if (!purple_protocols_remove(my_protocol)) { - g_set_error(error, AIM_DOMAIN, 0, _("Failed to remove aim protocol")); + if (!purple_protocols_remove(my_protocol, error)) return FALSE; - } return TRUE; }
--- a/libpurple/protocols/oscar/libaim.h Sun Sep 01 00:58:23 2013 +0530 +++ b/libpurple/protocols/oscar/libaim.h Sun Sep 01 01:40:21 2013 +0530 @@ -24,8 +24,6 @@ #include "oscar.h" -#define AIM_DOMAIN (g_quark_from_static_string(AIM_ID)) - #define AIM_TYPE_PROTOCOL (aim_protocol_get_type()) #define AIM_PROTOCOL(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), AIM_TYPE_PROTOCOL, AIMProtocol)) #define AIM_PROTOCOL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), AIM_TYPE_PROTOCOL, AIMProtocolClass))
--- a/libpurple/protocols/oscar/libicq.c Sun Sep 01 00:58:23 2013 +0530 +++ b/libpurple/protocols/oscar/libicq.c Sun Sep 01 01:40:21 2013 +0530 @@ -98,11 +98,9 @@ static gboolean plugin_load(PurplePlugin *plugin, GError **error) { - my_protocol = purple_protocols_add(ICQ_TYPE_PROTOCOL); - if (!my_protocol) { - g_set_error(error, ICQ_DOMAIN, 0, _("Failed to add icq protocol")); + my_protocol = purple_protocols_add(ICQ_TYPE_PROTOCOL, error); + if (!my_protocol) return FALSE; - } purple_signal_connect(purple_get_core(), "uri-handler", my_protocol, PURPLE_CALLBACK(oscar_uri_handler), NULL); @@ -113,10 +111,8 @@ static gboolean plugin_unload(PurplePlugin *plugin, GError **error) { - if (!purple_protocols_remove(my_protocol)) { - g_set_error(error, ICQ_DOMAIN, 0, _("Failed to remove icq protocol")); + if (!purple_protocols_remove(my_protocol, error)) return FALSE; - } return TRUE; }
--- a/libpurple/protocols/oscar/libicq.h Sun Sep 01 00:58:23 2013 +0530 +++ b/libpurple/protocols/oscar/libicq.h Sun Sep 01 01:40:21 2013 +0530 @@ -26,7 +26,6 @@ #define ICQ_ID "prpl-icq" #define ICQ_NAME "ICQ" -#define ICQ_DOMAIN (g_quark_from_static_string(ICQ_ID)) #define ICQ_TYPE_PROTOCOL (icq_protocol_get_type()) #define ICQ_PROTOCOL(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), ICQ_TYPE_PROTOCOL, ICQProtocol))
--- a/libpurple/protocols/sametime/sametime.c Sun Sep 01 00:58:23 2013 +0530 +++ b/libpurple/protocols/sametime/sametime.c Sun Sep 01 01:40:21 2013 +0530 @@ -79,8 +79,6 @@ #define PLUGIN_AUTHOR "Christopher (siege) O'Brien <siege@preoccupied.net>" #define PLUGIN_HOMEPAGE "http://meanwhile.sourceforge.net/" -#define PLUGIN_DOMAIN (g_quark_from_static_string(PLUGIN_ID)) - /* plugin preference names */ #define MW_PROTOCOL_OPT_BASE "/plugins/prpl/meanwhile" @@ -5760,12 +5758,9 @@ static gboolean plugin_load(PurplePlugin *plugin, GError **error) { - my_protocol = purple_protocols_add(MW_TYPE_PROTOCOL); - - if (!my_protocol) { - g_set_error(error, PLUGIN_DOMAIN, 0, _("Failed to add sametime protocol")); + my_protocol = purple_protocols_add(MW_TYPE_PROTOCOL, error); + if (!my_protocol) return FALSE; - } return TRUE; } @@ -5774,10 +5769,8 @@ static gboolean plugin_unload(PurplePlugin *plugin, GError **error) { - if (!purple_protocols_remove(my_protocol)) { - g_set_error(error, PLUGIN_DOMAIN, 0, _("Failed to remove sametime protocol")); + if (!purple_protocols_remove(my_protocol, error)) return FALSE; - } return TRUE; }
--- a/libpurple/protocols/silc/silc.c Sun Sep 01 00:58:23 2013 +0530 +++ b/libpurple/protocols/silc/silc.c Sun Sep 01 01:40:21 2013 +0530 @@ -2213,12 +2213,9 @@ static gboolean plugin_load(PurplePlugin *plugin, GError **error) { - my_protocol = purple_protocols_add(SILCPURPLE_TYPE_PROTOCOL); - - if (!my_protocol) { - g_set_error(error, SILCPURPLE_DOMAIN, 0, _("Failed to add silc protocol")); + my_protocol = purple_protocols_add(SILCPURPLE_TYPE_PROTOCOL, error); + if (!my_protocol) return FALSE; - } return TRUE; } @@ -2226,10 +2223,8 @@ static gboolean plugin_unload(PurplePlugin *plugin, GError **error) { - if (!purple_protocols_remove(my_protocol)) { - g_set_error(error, SILCPURPLE_DOMAIN, 0, _("Failed to remove silc protocol")); + if (!purple_protocols_remove(my_protocol, error)) return FALSE; - } return TRUE; }
--- a/libpurple/protocols/silc/silcpurple.h Sun Sep 01 00:58:23 2013 +0530 +++ b/libpurple/protocols/silc/silcpurple.h Sun Sep 01 01:40:21 2013 +0530 @@ -40,7 +40,6 @@ #define SILCPURPLE_ID "prpl-silc" #define SILCPURPLE_NAME "SILC" -#define SILCPURPLE_DOMAIN (g_quark_from_static_string(SILCPURPLE_ID)) #define SILCPURPLE_TYPE_PROTOCOL (silcpurple_protocol_get_type()) #define SILCPURPLE_PROTOCOL(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), SILCPURPLE_TYPE_PROTOCOL, SILCProtocol))
--- a/libpurple/protocols/simple/simple.c Sun Sep 01 00:58:23 2013 +0530 +++ b/libpurple/protocols/simple/simple.c Sun Sep 01 01:40:21 2013 +0530 @@ -2119,12 +2119,9 @@ static gboolean plugin_load(PurplePlugin *plugin, GError **error) { - my_protocol = purple_protocols_add(SIMPLE_TYPE_PROTOCOL); - - if (!my_protocol) { - g_set_error(error, SIMPLE_DOMAIN, 0, _("Failed to add simple protocol")); + my_protocol = purple_protocols_add(SIMPLE_TYPE_PROTOCOL, error); + if (!my_protocol) return FALSE; - } return TRUE; } @@ -2132,10 +2129,8 @@ static gboolean plugin_unload(PurplePlugin *plugin, GError **error) { - if (!purple_protocols_remove(my_protocol)) { - g_set_error(error, SIMPLE_DOMAIN, 0, _("Failed to remove simple protocol")); + if (!purple_protocols_remove(my_protocol, error)) return FALSE; - } return TRUE; }
--- a/libpurple/protocols/simple/simple.h Sun Sep 01 00:58:23 2013 +0530 +++ b/libpurple/protocols/simple/simple.h Sun Sep 01 01:40:21 2013 +0530 @@ -48,7 +48,6 @@ #define SIMPLE_ID "prpl-simple" #define SIMPLE_NAME "SIMPLE" -#define SIMPLE_DOMAIN (g_quark_from_static_string(SIMPLE_ID)) #define SIMPLE_TYPE_PROTOCOL (simple_protocol_get_type()) #define SIMPLE_PROTOCOL(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), SIMPLE_TYPE_PROTOCOL, SIMPLEProtocol))
--- a/libpurple/protocols/yahoo/libyahoo.c Sun Sep 01 00:58:23 2013 +0530 +++ b/libpurple/protocols/yahoo/libyahoo.c Sun Sep 01 01:40:21 2013 +0530 @@ -304,11 +304,9 @@ static gboolean plugin_load(PurplePlugin *plugin, GError **error) { - my_protocol = purple_protocols_add(YAHOO_TYPE_PROTOCOL); - if (!my_protocol) { - g_set_error(error, YAHOO_DOMAIN, 0, _("Failed to add yahoo protocol")); + my_protocol = purple_protocols_add(YAHOO_TYPE_PROTOCOL, error); + if (!my_protocol) return FALSE; - } yahoo_register_commands(); @@ -321,10 +319,8 @@ static gboolean plugin_unload(PurplePlugin *plugin, GError **error) { - if (!purple_protocols_remove(my_protocol)) { - g_set_error(error, YAHOO_DOMAIN, 0, _("Failed to remove yahoo protocol")); + if (!purple_protocols_remove(my_protocol, error)) return FALSE; - } return TRUE; }
--- a/libpurple/protocols/yahoo/libyahoo.h Sun Sep 01 00:58:23 2013 +0530 +++ b/libpurple/protocols/yahoo/libyahoo.h Sun Sep 01 01:40:21 2013 +0530 @@ -26,7 +26,6 @@ #define YAHOO_ID "prpl-yahoo" #define YAHOO_NAME "Yahoo" -#define YAHOO_DOMAIN (g_quark_from_static_string(YAHOO_ID)) #define YAHOO_TYPE_PROTOCOL (yahoo_protocol_get_type()) #define YAHOO_PROTOCOL(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), YAHOO_TYPE_PROTOCOL, YahooProtocol))
--- a/libpurple/protocols/yahoo/libyahoojp.c Sun Sep 01 00:58:23 2013 +0530 +++ b/libpurple/protocols/yahoo/libyahoojp.c Sun Sep 01 01:40:21 2013 +0530 @@ -134,12 +134,9 @@ static gboolean plugin_load(PurplePlugin *plugin, GError **error) { - my_protocol = purple_protocols_add(YAHOOJP_TYPE_PROTOCOL); - - if (!my_protocol) { - g_set_error(error, YAHOOJP_DOMAIN, 0, _("Failed to add yahoojp protocol")); + my_protocol = purple_protocols_add(YAHOOJP_TYPE_PROTOCOL, error); + if (!my_protocol) return FALSE; - } yahoojp_register_commands(); @@ -149,10 +146,8 @@ static gboolean plugin_unload(PurplePlugin *plugin, GError **error) { - if (!purple_protocols_remove(my_protocol)) { - g_set_error(error, YAHOOJP_DOMAIN, 0, _("Failed to remove yahoojp protocol")); + if (!purple_protocols_remove(my_protocol, error)) return FALSE; - } return TRUE; }
--- a/libpurple/protocols/yahoo/libyahoojp.h Sun Sep 01 00:58:23 2013 +0530 +++ b/libpurple/protocols/yahoo/libyahoojp.h Sun Sep 01 01:40:21 2013 +0530 @@ -26,7 +26,6 @@ #define YAHOOJP_ID "prpl-yahoojp" #define YAHOOJP_NAME "Yahoo JAPAN" -#define YAHOOJP_DOMAIN (g_quark_from_static_string(YAHOOJP_ID)) #define YAHOOJP_TYPE_PROTOCOL (yahoojp_protocol_get_type()) #define YAHOOJP_PROTOCOL(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), YAHOOJP_TYPE_PROTOCOL, YahooJPProtocol))
--- a/libpurple/protocols/zephyr/zephyr.c Sun Sep 01 00:58:23 2013 +0530 +++ b/libpurple/protocols/zephyr/zephyr.c Sun Sep 01 01:40:21 2013 +0530 @@ -2960,12 +2960,9 @@ static gboolean plugin_load(PurplePlugin *plugin, GError **error) { - my_protocol = purple_protocols_add(ZEPHYR_TYPE_PROTOCOL); - - if (!my_protocol) { - g_set_error(error, ZEPHYR_DOMAIN, 0, _("Failed to add zephyr protocol")); + my_protocol = purple_protocols_add(ZEPHYR_TYPE_PROTOCOL, error); + if (!my_protocol) return FALSE; - } return TRUE; } @@ -2974,10 +2971,8 @@ static gboolean plugin_unload(PurplePlugin *plugin, GError **error) { - if (!purple_protocols_remove(my_protocol)) { - g_set_error(error, ZEPHYR_DOMAIN, 0, _("Failed to remove zephyr protocol")); + if (!purple_protocols_remove(my_protocol, error)) return FALSE; - } return TRUE; }
--- a/libpurple/protocols/zephyr/zephyr.h Sun Sep 01 00:58:23 2013 +0530 +++ b/libpurple/protocols/zephyr/zephyr.h Sun Sep 01 01:40:21 2013 +0530 @@ -26,7 +26,6 @@ #define ZEPHYR_ID "prpl-zephyr" #define ZEPHYR_NAME "Zephyr" -#define ZEPHYR_DOMAIN (g_quark_from_static_string(ZEPHYR_ID)) #define ZEPHYR_TYPE_PROTOCOL (zephyr_protocol_get_type()) #define ZEPHYR_PROTOCOL(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), ZEPHYR_TYPE_PROTOCOL, ZephyrProtocol))