Request API refactoring: switch purple_request_folder to PurpleRequestCommonParameters

Tue, 10 Sep 2013 23:15:56 +0200

author
Tomasz Wasilczyk <twasilczyk@pidgin.im>
date
Tue, 10 Sep 2013 23:15:56 +0200
changeset 34334
f5f3a9945a6d
parent 34333
b92698241603
child 34335
2496c53cd401

Request API refactoring: switch purple_request_folder to PurpleRequestCommonParameters

finch/gntrequest.c file | annotate | diff | comparison | revisions
libpurple/request.c file | annotate | diff | comparison | revisions
libpurple/request.h file | annotate | diff | comparison | revisions
pidgin/gtkrequest.c file | annotate | diff | comparison | revisions
--- a/finch/gntrequest.c	Tue Sep 10 23:04:19 2013 +0200
+++ b/finch/gntrequest.c	Tue Sep 10 23:15:56 2013 +0200
@@ -788,8 +788,8 @@
 
 static void *
 finch_request_folder(const char *title, const char *dirname, GCallback ok_cb,
-		GCallback cancel_cb, PurpleAccount *account, const char *who, PurpleConversation *conv,
-		void *user_data)
+	GCallback cancel_cb, PurpleRequestCommonParameters *cpar,
+	void *user_data)
 {
 	FinchFileRequest *data;
 
--- a/libpurple/request.c	Tue Sep 10 23:04:19 2013 +0200
+++ b/libpurple/request.c	Tue Sep 10 23:15:56 2013 +0200
@@ -1924,9 +1924,8 @@
 
 void *
 purple_request_folder(void *handle, const char *title, const char *dirname,
-				  GCallback ok_cb, GCallback cancel_cb,
-				  PurpleAccount *account, const char *who, PurpleConversation *conv,
-				  void *user_data)
+	GCallback ok_cb, GCallback cancel_cb,
+	PurpleRequestCommonParameters *cpar, void *user_data)
 {
 	PurpleRequestUiOps *ops;
 
@@ -1938,14 +1937,15 @@
 		info            = g_new0(PurpleRequestInfo, 1);
 		info->type      = PURPLE_REQUEST_FOLDER;
 		info->handle    = handle;
-		info->ui_handle = ops->request_folder(title, dirname,
-											ok_cb, cancel_cb,
-											account, who, conv,
-											user_data);
+		info->ui_handle = ops->request_folder(title, dirname, ok_cb,
+			cancel_cb, cpar, user_data);
 		handles = g_list_append(handles, info);
+
+		purple_request_cpar_unref(cpar);
 		return info->ui_handle;
 	}
 
+	purple_request_cpar_unref(cpar);
 	return NULL;
 }
 
--- a/libpurple/request.h	Tue Sep 10 23:04:19 2013 +0200
+++ b/libpurple/request.h	Tue Sep 10 23:15:56 2013 +0200
@@ -130,9 +130,8 @@
 
 	/** @see purple_request_folder(). */
 	void *(*request_folder)(const char *title, const char *dirname,
-	                        GCallback ok_cb, GCallback cancel_cb,
-	                        PurpleAccount *account, const char *who,
-	                        PurpleConversation *conv, void *user_data);
+		GCallback ok_cb, GCallback cancel_cb,
+		PurpleRequestCommonParameters *cpar, void *user_data);
 
 	void (*_purple_reserved1)(void);
 	void (*_purple_reserved2)(void);
@@ -1717,20 +1716,16 @@
  * @param dirname     The default directory name (may be @c NULL)
  * @param ok_cb       The callback for the @c OK button.
  * @param cancel_cb   The callback for the @c Cancel button, which may be @c NULL.
- * @param account     The #PurpleAccount associated with this request, or @c
- *                    NULL if none is
- * @param who         The username of the buddy associated with this request,
- *                    or @c NULL if none is
- * @param conv        The #PurpleConversation associated with this request, or
- *                    @c NULL if none is
+ * @param cpar        The #PurpleRequestCommonParameters object, which gets
+ *                    unref'ed after this call.
  * @param user_data   The data to pass to the callback.
  *
  * @return A UI-specific handle.
  */
-void *purple_request_folder(void *handle, const char *title, const char *dirname,
+void *
+purple_request_folder(void *handle, const char *title, const char *dirname,
 	GCallback ok_cb, GCallback cancel_cb,
-	PurpleAccount *account, const char *who, PurpleConversation *conv,
-	void *user_data);
+	PurpleRequestCommonParameters *cpar, void *user_data);
 
 /**
  * Prompts the user for action over a certificate.
--- a/pidgin/gtkrequest.c	Tue Sep 10 23:04:19 2013 +0200
+++ b/pidgin/gtkrequest.c	Tue Sep 10 23:15:56 2013 +0200
@@ -1694,10 +1694,9 @@
 }
 
 static void *
-pidgin_request_folder(const char *title, const char *dirname,
-					  GCallback ok_cb, GCallback cancel_cb,
-					  PurpleAccount *account, const char *who, PurpleConversation *conv,
-					  void *user_data)
+pidgin_request_folder(const char *title, const char *dirname, GCallback ok_cb,
+	GCallback cancel_cb, PurpleRequestCommonParameters *cpar,
+	void *user_data)
 {
 	PidginRequestData *data;
 	GtkWidget *dirsel;

mercurial