/soc/2013/ankitkv/gobjectification: ca1dab25bd7a: Removed purple...

Ankit Vani a at nevitus.org
Fri Sep 6 17:10:39 EDT 2013


Changeset: ca1dab25bd7a46a0489449abc77e0c6c29818522
Author:	 Ankit Vani <a at nevitus.org>
Date:	 2013-09-07 01:13 +0530
Branch:	 soc.2013.gobjectification
URL: https://hg.pidgin.im/soc/2013/ankitkv/gobjectification/rev/ca1dab25bd7a

Description:

Removed purple_whiteboard_destroy(). Renamed purple_whiteboard_create() to purple_whiteboard_new().

diffstat:

 libpurple/plugins/perl/common/Whiteboard.xs |  6 +-----
 libpurple/protocols/silc/wb.c               |  4 ++--
 libpurple/protocols/yahoo/libymsg.c         |  2 +-
 libpurple/protocols/yahoo/yahoo_doodle.c    |  6 +++---
 libpurple/whiteboard.c                      |  4 ++--
 libpurple/whiteboard.h                      |  2 +-
 pidgin/gtkwhiteboard.c                      |  4 ++--
 7 files changed, 12 insertions(+), 16 deletions(-)

diffs (138 lines):

diff --git a/libpurple/plugins/perl/common/Whiteboard.xs b/libpurple/plugins/perl/common/Whiteboard.xs
--- a/libpurple/plugins/perl/common/Whiteboard.xs
+++ b/libpurple/plugins/perl/common/Whiteboard.xs
@@ -8,16 +8,12 @@ purple_whiteboard_clear(wb)
 	Purple::Whiteboard wb
 
 Purple::Whiteboard
-purple_whiteboard_create(account, who, state)
+purple_whiteboard_new(account, who, state)
 	Purple::Account account
 	const char* who
 	int state
 
 void
-purple_whiteboard_destroy(wb)
-	Purple::Whiteboard wb
-
-void
 purple_whiteboard_draw_line(wb, x1, y1, x2, y2, color, size)
 	Purple::Whiteboard wb
 	int x1
diff --git a/libpurple/protocols/silc/wb.c b/libpurple/protocols/silc/wb.c
--- a/libpurple/protocols/silc/wb.c
+++ b/libpurple/protocols/silc/wb.c
@@ -110,7 +110,7 @@ PurpleWhiteboard *silcpurple_wb_init(Sil
 
 	wb = purple_whiteboard_get_session(sg->account, client_entry->nickname);
 	if (!wb)
-		wb = purple_whiteboard_create(sg->account, client_entry->nickname, 0);
+		wb = purple_whiteboard_new(sg->account, client_entry->nickname, 0);
 	if (!wb)
 		return NULL;
 
@@ -141,7 +141,7 @@ PurpleWhiteboard *silcpurple_wb_init_ch(
 
 	wb = purple_whiteboard_get_session(sg->account, channel->channel_name);
 	if (!wb)
-		wb = purple_whiteboard_create(sg->account, channel->channel_name, 0);
+		wb = purple_whiteboard_new(sg->account, channel->channel_name, 0);
 	if (!wb)
 		return NULL;
 
diff --git a/libpurple/protocols/yahoo/libymsg.c b/libpurple/protocols/yahoo/libymsg.c
--- a/libpurple/protocols/yahoo/libymsg.c
+++ b/libpurple/protocols/yahoo/libymsg.c
@@ -1062,7 +1062,7 @@ static void yahoo_process_message(Purple
 						if(wb == NULL)
 						{
 							doodle_session *ds;
-							wb = purple_whiteboard_create(account, im->from,
+							wb = purple_whiteboard_new(account, im->from,
 											DOODLE_STATE_REQUESTED);
 							ds = purple_whiteboard_get_protocol_data(wb);
 							ds->imv_key = g_strdup(pair->value);
diff --git a/libpurple/protocols/yahoo/yahoo_doodle.c b/libpurple/protocols/yahoo/yahoo_doodle.c
--- a/libpurple/protocols/yahoo/yahoo_doodle.c
+++ b/libpurple/protocols/yahoo/yahoo_doodle.c
@@ -114,7 +114,7 @@ void yahoo_doodle_initiate(PurpleConnect
 		/* Insert this 'session' in the list.  At this point, it's only a
 		 * requested session.
 		 */
-		purple_whiteboard_create(account, to, DOODLE_STATE_REQUESTING);
+		purple_whiteboard_new(account, to, DOODLE_STATE_REQUESTING);
 	}
 
 	/* NOTE Perhaps some careful handling of remote assumed established
@@ -157,7 +157,7 @@ static void yahoo_doodle_command_got_req
 		dialog_message, NULL, NULL, NULL);
 		*/
 
-		wb = purple_whiteboard_create(account, from, DOODLE_STATE_REQUESTED);
+		wb = purple_whiteboard_new(account, from, DOODLE_STATE_REQUESTED);
 		ds = purple_whiteboard_get_protocol_data(wb);
 		ds->imv_key = g_strdup(imv_key);
 
@@ -370,7 +370,7 @@ void yahoo_doodle_command_got_shutdown(P
 	/* TODO Ask if user wants to save picture before the session is closed */
 
 	purple_whiteboard_set_state(wb, DOODLE_STATE_CANCELLED);
-	purple_whiteboard_destroy(wb);
+	g_object_unref(wb);
 }
 
 static void yahoo_doodle_command_send_generic(const char *type,
diff --git a/libpurple/whiteboard.c b/libpurple/whiteboard.c
--- a/libpurple/whiteboard.c
+++ b/libpurple/whiteboard.c
@@ -75,7 +75,7 @@ void purple_whiteboard_set_prpl_ops(Purp
 	priv->prpl_ops = ops;
 }
 
-PurpleWhiteboard *purple_whiteboard_create(PurpleAccount *account, const char *who, int state)
+PurpleWhiteboard *purple_whiteboard_new(PurpleAccount *account, const char *who, int state)
 {
 	PurpleWhiteboardPrivate *priv;
 	PurplePluginProtocolInfo *prpl_info;
@@ -104,7 +104,7 @@ PurpleWhiteboard *purple_whiteboard_crea
 	return wb;
 }
 
-void purple_whiteboard_destroy(PurpleWhiteboard *wb)
+void g_object_unref(PurpleWhiteboard *wb)
 {
 	PurpleWhiteboardPrivate *priv = PURPLE_WHITEBOARD_GET_PRIVATE(wb);
 
diff --git a/libpurple/whiteboard.h b/libpurple/whiteboard.h
--- a/libpurple/whiteboard.h
+++ b/libpurple/whiteboard.h
@@ -148,7 +148,7 @@ void purple_whiteboard_set_prpl_ops(Purp
  *
  * @return The new whiteboard
  */
-PurpleWhiteboard *purple_whiteboard_create(PurpleAccount *account, const char *who, int state);
+PurpleWhiteboard *purple_whiteboard_new(PurpleAccount *account, const char *who, int state);
 
 /**
  * Returns the whiteboard's account.
diff --git a/pidgin/gtkwhiteboard.c b/pidgin/gtkwhiteboard.c
--- a/pidgin/gtkwhiteboard.c
+++ b/pidgin/gtkwhiteboard.c
@@ -323,7 +323,7 @@ static gboolean whiteboard_close_cb(GtkW
 	wb = gtkwb->wb;
 	g_return_val_if_fail(wb != NULL, FALSE);
 
-	purple_whiteboard_destroy(wb);
+	g_object_unref(wb);
 
 	return FALSE;
 }
@@ -360,7 +360,7 @@ static void pidginwhiteboard_button_star
 	/* Insert this 'session' in the list.  At this point, it's only a requested
 	 * session.
 	 */
-	wb = purple_whiteboard_create(account, to, DOODLE_STATE_REQUESTING);
+	wb = purple_whiteboard_new(account, to, DOODLE_STATE_REQUESTING);
 }
 #endif
 



More information about the Commits mailing list