/soc/2013/ankitkv/gobjectification: 852cb2830a0a: Refactor nullp...

Ankit Vani a at nevitus.org
Wed Sep 4 07:39:20 EDT 2013


Changeset: 852cb2830a0acae7ad116fcb6cbaa631008547e0
Author:	 Ankit Vani <a at nevitus.org>
Date:	 2013-09-04 17:09 +0530
Branch:	 soc.2013.gobjectification.plugins
URL: https://hg.pidgin.im/soc/2013/ankitkv/gobjectification/rev/852cb2830a0a

Description:

Refactor nullprotocol to use instance init

diffstat:

 libpurple/protocols/null/nullprotocol.c |  25 ++++++++++++++++---------
 1 files changed, 16 insertions(+), 9 deletions(-)

diffs (48 lines):

diff --git a/libpurple/protocols/null/nullprotocol.c b/libpurple/protocols/null/nullprotocol.c
--- a/libpurple/protocols/null/nullprotocol.c
+++ b/libpurple/protocols/null/nullprotocol.c
@@ -1050,19 +1050,18 @@ static gboolean null_offline_message(con
 }
 
 /*
- * Initialize the protocol class. see protocol.h for more information.
+ * Initialize the protocol instance. see protocol.h for more information.
  */
 static void
-null_protocol_base_init(NullProtocolClass *klass)
+null_protocol_init(PurpleProtocol *protocol)
 {
-  PurpleProtocolClass *proto_class = PURPLE_PROTOCOL_CLASS(klass);
   PurpleAccountUserSplit *split;
   PurpleAccountOption *option;
 
-  proto_class->id        = "null";
-  proto_class->name      = "Null - Testing Protocol";
-  proto_class->options   = OPT_PROTO_NO_PASSWORD | OPT_PROTO_CHAT_TOPIC;
-  proto_class->icon_spec = purple_buddy_icon_spec_new(
+  protocol->id        = "null";
+  protocol->name      = "Null - Testing Protocol";
+  protocol->options   = OPT_PROTO_NO_PASSWORD | OPT_PROTO_CHAT_TOPIC;
+  protocol->icon_spec = purple_buddy_icon_spec_new(
       "png,jpg,gif",                   /* format */
       0,                               /* min_width */
       0,                               /* min_height */
@@ -1082,8 +1081,16 @@ null_protocol_base_init(NullProtocolClas
     "example",                /* pref name */
     "default");               /* default value */
 
-  proto_class->user_splits = g_list_append(NULL, split);
-  proto_class->protocol_options = g_list_append(NULL, option);
+  protocol->user_splits = g_list_append(NULL, split);
+  protocol->protocol_options = g_list_append(NULL, option);
+}
+
+/*
+ * Initialize the protocol class.
+ */
+static void
+null_protocol_class_init(PurpleProtocolClass *klass)
+{
 }
 
 /*



More information about the Commits mailing list