cpw.nader.asynclogging-3: 29e972f5: Updated all the list/syslog/total size f.

morshed.nader at gmail.com morshed.nader at gmail.com
Thu Jan 5 15:27:05 EST 2012


----------------------------------------------------------------------
Revision: 29e972f5238c9d4adb5c0ea34306401753c4296a
Parent:   32d2495e080586a45d60c86977f7f5a91254c6f4
Author:   morshed.nader at gmail.com
Date:     01/04/12 21:10:37
Branch:   im.pidgin.cpw.nader.asynclogging-3
URL: http://d.pidgin.im/viewmtn/revision/info/29e972f5238c9d4adb5c0ea34306401753c4296a

Changelog: 

Updated all the list/syslog/total size functions to no longer require the dummy PurpleLog
Removed the purple_log_(list, list_syslog, and total_size)_* functions, which are no longer needed (Ya cleaning up code!)

Changes against parent 32d2495e080586a45d60c86977f7f5a91254c6f4

  patched  libpurple/htmllog.c
  patched  libpurple/log.c
  patched  libpurple/log.h
  patched  libpurple/oldlog.c
  patched  libpurple/txtlog.c

-------------- next part --------------
============================================================
--- libpurple/log.c	4df70e25a6fcba0f063566e0e354420a6996ccc3
+++ libpurple/log.c	cb492aefbf0023425d205712b6e63061cb62fd7f
@@ -127,12 +127,9 @@ static gssize purple_log_real_size_finis
 
 static gssize purple_log_real_size_finish(PurpleLog *, GAsyncResult *,
 	GError **);
-static GList *purple_log_real_list_logs_finish(PurpleLog *, GAsyncResult *,
-	GError **);
-static GList *purple_log_real_list_syslog_finish(PurpleLog *, GAsyncResult *,
-	GError **);
-static gssize purple_log_real_total_size_finish(PurpleLog *, GAsyncResult *,
-	GError **);
+static GList *purple_log_real_list_logs_finish(GAsyncResult *, GError **);
+static GList *purple_log_real_list_syslog_finish(GAsyncResult *, GError **);
+static gssize purple_log_real_total_size_finish(GAsyncResult *, GError **);
 static GHashTable *purple_log_real_get_log_sets_finish(PurpleLog *,
 	GAsyncResult *, GError **);
 
@@ -763,72 +760,13 @@ purple_log_get_size_finish(PurpleLog *lo
 	return PURPLE_LOG_GET_CLASS(log)->size_finish(log, res, error);
 }
 
-GList *
-purple_log_list_logs(PurpleLog *log, PurpleLogChatType chat_type,
-	const gchar *name, PurpleAccount *account, GCancellable *cancellable,
-	GError **error)
-{
-	PurpleLogClass *class;
-
-	g_return_val_if_fail(PURPLE_IS_LOG(log), NULL);
-	g_return_val_if_fail(name != NULL, NULL);
-	g_return_val_if_fail(PURPLE_IS_ACCOUNT(account), NULL);
-
-	class = PURPLE_LOG_GET_CLASS(log);
-
-	if (class->list_fn == NULL) {
-		g_set_error_literal(error,
-			G_IO_ERROR,
-			G_IO_ERROR_NOT_SUPPORTED,
-			_("Operation not supported"));
-
-		return NULL;
-	}
-
-	return class->list_fn(log, chat_type, name, account, cancellable, error);
-}
-
-void
-purple_log_list_logs_async(PurpleLog *log, PurpleLogChatType chat_type,
-	const gchar *name, PurpleAccount *account, gint io_priority,
-	GCancellable *cancellable, GAsyncReadyCallback cb, gpointer userdata)
-{
-	PurpleLogClass *class;
-
-	g_return_if_fail(PURPLE_IS_LOG(log));
-	g_return_if_fail(name != NULL);
-	g_return_if_fail(PURPLE_IS_ACCOUNT(account));
-
-	class = PURPLE_LOG_GET_CLASS(log);
-
-	if (class->list_async == NULL)
-		_notify_not_supported(G_OBJECT(log), cb, userdata);
-	else
-		class->list_async(log, chat_type, name, account, io_priority,
-			cancellable, cb, userdata);
-}
-
 static GList *
-purple_log_real_list_logs_finish(PurpleLog *log, GAsyncResult *res,
-	GError **error)
+purple_log_real_list_logs_finish(GAsyncResult *res, GError **error)
 {
-	return purple_log_list_copy(g_simple_async_result_get_op_res_gpointer(G_SIMPLE_ASYNC_RESULT(res)));
-}
+	GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT(res);
+	GList *list = g_simple_async_result_get_op_res_gpointer(simple);
 
-GList *
-purple_log_list_logs_finish(PurpleLog *log, GAsyncResult *res, GError **error)
-{
-	g_return_val_if_fail(PURPLE_IS_LOG(log), NULL);
-	g_return_val_if_fail(G_IS_ASYNC_RESULT(res), NULL);
-
-	if (G_IS_SIMPLE_ASYNC_RESULT(res)) {
-		GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT(res);
-
-		if (g_simple_async_result_propagate_error(simple, error))
-			return NULL;
-	}
-
-	return PURPLE_LOG_GET_CLASS(log)->list_finish(log, res, error);
+	return purple_log_list_copy(list);
 }
 
 GList *
@@ -845,15 +783,15 @@ purple_logs_list_logs(PurpleLogChatType 
 	array = purple_log_logger_get_all();
 
 	for (i = 0; i < array->len; i++) {
-		PurpleLog *log;
 		GError *err = NULL;
 		GList *list;
-		GType log_type = g_array_index(array, GType, i);
+		PurpleLogClass *klass = g_array_index(array, PurpleLogClass *, i);
 
-		log = g_object_new(log_type, NULL);
-		list = purple_log_list_logs(log, chat_type, name, account, cancellable,
-			&err);
+		if (klass->list_fn == NULL)
+			continue;
 
+		list = klass->list_fn(chat_type, name, account, cancellable, &err);
+
 		if (list == NULL && err != NULL) {
 			g_propagate_error(error, err);
 			purple_log_list_free(logs);
@@ -877,6 +815,7 @@ purple_logs_list_logs_async(PurpleLogCha
 	_list_logs_callback_data *callback_data;
 	GArray *array;
 	guint i;
+	gboolean any;
 
 	g_return_if_fail(name != NULL);
 	g_return_if_fail(account != NULL); /* XXX: PURPLE_IS_ACCOUNT(account) */
@@ -889,15 +828,25 @@ purple_logs_list_logs_async(PurpleLogCha
 	callback_data->counter = array->len;
 	callback_data->logs = NULL;
 
+	any = FALSE;
+
 	for (i = 0; i < array->len; i++) {
-		PurpleLog *log;
-		GType log_type = g_array_index(array, GType, i);
+		PurpleLogClass *klass = g_array_index(array, PurpleLogClass *, i);
 
-		log = g_object_new(log_type, NULL);
-		purple_log_list_logs_async(log, chat_type, name, account, io_priority,
+		if (klass->list_async == NULL) {
+			callback_data->counter--;
+			continue;
+		}
+
+		any = TRUE;
+		klass->list_async(chat_type, name, account, io_priority,
 			cancellable, log_list_cb, callback_data);
-		g_object_unref(log);
 	}
+
+	if (!any) {
+		callback_data->counter = 1;
+		log_list_cb(NULL, NULL, callback_data);
+	}
 }
 
 GList *
@@ -916,29 +865,6 @@ GList *
 }
 
 GList *
-purple_log_list_system_logs(PurpleLog *log, PurpleAccount *account,
-	GCancellable *cancellable, GError **error)
-{
-	PurpleLogClass *class;
-
-	g_return_val_if_fail(PURPLE_IS_LOG(log), NULL);
-	g_return_val_if_fail(account != NULL, NULL); /* XXX: PURPLE_IS_ACCOUNT(account) */
-
-	class = PURPLE_LOG_GET_CLASS(log);
-
-	if (class->list_syslog_fn == NULL) {
-		g_set_error_literal(error,
-			G_IO_ERROR,
-			G_IO_ERROR_NOT_SUPPORTED,
-			_("Operation not supported"));
-
-		return NULL;
-	}
-
-	return class->list_syslog_fn(log, account, cancellable, error);
-}
-
-GList *
 purple_logs_list_system_logs(PurpleAccount *account, GCancellable *cancellable,
 	GError **error)
 {
@@ -951,13 +877,14 @@ purple_logs_list_system_logs(PurpleAccou
 	array = purple_log_logger_get_all();
 
 	for (i = 0; i < array->len; i++) {
-		PurpleLog *log;
+		PurpleLogClass *klass = g_array_index(array, PurpleLogClass *, i);
 		GList *list;
-		GType log_type = g_array_index(array, GType, i);
 
-		log = g_object_new(log_type, NULL);
-		list = purple_log_list_system_logs(log, account, cancellable, error);
+		if (klass->list_syslog_fn == NULL)
+			continue;
 
+		list = klass->list_syslog_fn(account, cancellable, error);
+
 		if (list == NULL) {
 			purple_log_list_free(logs);
 			g_object_unref(log);
@@ -973,31 +900,13 @@ void
 }
 
 void
-purple_log_list_system_logs_async(PurpleLog *log, PurpleAccount *account,
-	gint io_priority, GCancellable *cancellable, GAsyncReadyCallback cb,
-	gpointer userdata)
-{
-	PurpleLogClass *class;
-
-	g_return_if_fail(PURPLE_IS_LOG(log));
-	g_return_if_fail(account != NULL); /* XXX: PURPLE_IS_ACCOUNT(account) */
-
-	class = PURPLE_LOG_GET_CLASS(log);
-
-	if (class->list_syslog_async == NULL)
-		_notify_not_supported(G_OBJECT(log), cb, userdata);
-	else
-		class->list_syslog_async(log, account, io_priority, cancellable, cb,
-			userdata);
-}
-
-void
 purple_logs_list_system_logs_async(PurpleAccount *account, gint io_priority,
 	GCancellable *cancellable, GAsyncReadyCallback cb, gpointer userdata)
 {
 	_list_logs_callback_data *callback_data;
 	GArray *array;
 	guint i;
+	gboolean any;
 
 	g_return_if_fail(account != NULL); /* XXX: PURPLE_IS_ACCOUNT(account) */
 
@@ -1009,40 +918,36 @@ purple_logs_list_system_logs_async(Purpl
 	callback_data->counter = array->len;
 	callback_data->logs = NULL;
 
+	any = FALSE;
+
 	for (i = 0; i < array->len; i++) {
-		PurpleLog *log;
-		GType log_type = g_array_index(array, GType, i);
+		PurpleLogClass *klass = g_array_index(array, PurpleLogClass *, i);
 
-		log = g_object_new(log_type, NULL);
-		purple_log_list_system_logs_async(log, account, io_priority, cancellable,
+		if (klass->list_syslog_async == NULL) {
+			callback_data->counter--;
+			continue;
+		}
+
+		any = TRUE;
+		klass->list_syslog_async(account, io_priority, cancellable,
 			log_system_list_cb, callback_data);
 
 		g_object_unref(log);
 	}
+
+	if (!any) {
+		callback_data->counter = 1;
+		log_system_list_cb(NULL, NULL, callback_data);
+	}
 }
 
 static GList *
-purple_log_real_list_syslog_finish(PurpleLog *log, GAsyncResult *res,
-	GError **error)
+purple_log_real_list_syslog_finish(GAsyncResult *res, GError **error)
 {
-	return purple_log_list_copy(g_simple_async_result_get_op_res_gpointer(G_SIMPLE_ASYNC_RESULT(res)));
-}
+	GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT(res);
+	GList *list = g_simple_async_result_get_op_res_gpointer(simple);
 
-GList *
-purple_log_list_system_logs_finish(PurpleLog *log, GAsyncResult *res,
-	GError **error)
-{
-	g_return_val_if_fail(PURPLE_IS_LOG(log), NULL);
-	g_return_val_if_fail(G_IS_ASYNC_RESULT(res), NULL);
-
-	if (G_IS_SIMPLE_ASYNC_RESULT(res)) {
-		GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT(res);
-
-		if (g_simple_async_result_propagate_error(simple, error))
-			return NULL;
-	}
-
-	return PURPLE_LOG_GET_CLASS(log)->list_syslog_finish(log, res, error);
+	return purple_log_list_copy(list);
 }
 
 GList *
@@ -1080,93 +985,13 @@ _purple_logsize_user_free_key(_purple_lo
 	g_free(lu);
 }
 
-gssize
-purple_log_get_total_size(PurpleLog *log, PurpleLogChatType chat_type,
-	const gchar *name, PurpleAccount *account, GCancellable *cancellable,
-	GError **error)
-{
-	PurpleLogClass *class;
-
-	g_return_val_if_fail(PURPLE_IS_LOG(log), -1);
-	g_return_val_if_fail(name != NULL, -1);
-	g_return_val_if_fail(account != NULL, -1); /* XXX: PURPLE_IS_ACCOUNT(account) */
-	
-	class = PURPLE_LOG_GET_CLASS(log);
-
-	if (class->total_size_fn){
-		return class->total_size_fn(log, chat_type, name, account, cancellable,
-			error);
-	} else {
-		GList *logs = purple_log_list_logs(log, chat_type, name, account,
-			cancellable, error);
-		gssize size, total = 0;
-
-		if (logs == NULL)
-			return -1;
-
-		for ( ; logs != NULL; logs = g_list_delete_link(logs, logs)) {
-			PurpleLog *log = logs->data;
-
-			size = purple_log_get_size(log, cancellable, error);
-
-			if (size < 0) {
-				purple_log_list_free(logs);
-				return -1;
-			}
-
-			total += size;
-			g_object_unref(log);
-		}
-
-		return total;
-	}
-}
-
-void
-purple_log_get_total_size_async(PurpleLog *log, PurpleLogChatType chat_type,
-	const gchar *name, PurpleAccount *account, gint io_priority,
-	GCancellable *cancellable, GAsyncReadyCallback cb, gpointer userdata)
-{
-	PurpleLogClass *class;
-
-	g_return_if_fail(PURPLE_IS_LOG(log));
-	g_return_if_fail(name != NULL);
-	g_return_if_fail(PURPLE_IS_ACCOUNT(account));
-
-	class = PURPLE_LOG_GET_CLASS(log);
-
-	if (class->total_size_async == NULL)
-		_notify_not_supported(G_OBJECT(log), cb, userdata);
-	else
-		class->total_size_async(log, chat_type, name, account, io_priority,
-			cancellable, cb, userdata);
-}
-
 static gssize
-purple_log_real_total_size_finish(PurpleLog *log, GAsyncResult *res,
-	GError **error)
+purple_log_real_total_size_finish(GAsyncResult *res, GError **error)
 {
 	return g_simple_async_result_get_op_res_gssize(G_SIMPLE_ASYNC_RESULT(res));
 }
 
 gssize
-purple_log_get_total_size_finish(PurpleLog *log, GAsyncResult *res,
-	GError **error)
-{
-	g_return_val_if_fail(PURPLE_IS_LOG(log), -1);
-	g_return_val_if_fail(G_IS_ASYNC_RESULT(res), -1);
-
-	if (G_IS_SIMPLE_ASYNC_RESULT(res)) {
-		GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT(res);
-
-		if (g_simple_async_result_propagate_error(simple, error))
-			return -1;
-	}
-
-	return PURPLE_LOG_GET_CLASS(log)->total_size_finish(log, res, error);
-}
-
-gssize
 purple_logs_get_total_size(PurpleLogChatType chat_type, const gchar *name,
 	PurpleAccount *account, GCancellable *cancellable, GError **error)
 {
@@ -1194,13 +1019,15 @@ purple_logs_get_total_size(PurpleLogChat
 		guint i;
 
 		for (i = 0; i < array->len; i++) {
-			GType log_type = g_array_index(array, GType, i);
-			PurpleLog *log = g_object_new(log_type, NULL);
-			gssize size = purple_log_get_total_size(log, chat_type, name,
-				account, cancellable, error);
+			PurpleLogClass *klass = g_array_index(array, PurpleLogClass *, i);
+			gssize size;
 
-			g_object_unref(log);
+			if (klass->total_size_fn == NULL)
+				continue;
 
+			size = klass->total_size_fn(chat_type, name, account, cancellable,
+				error);
+
 			if (size < 0)
 				return -1;
 
@@ -1237,7 +1064,7 @@ purple_logs_get_total_size_async(PurpleL
 	GSimpleAsyncResult *simple;
 	GArray *array;
 	gpointer ptrsize;
-	gboolean result;
+	gboolean result, any;
 	gssize size = 0;
 	guint i;
 
@@ -1281,15 +1108,25 @@ purple_logs_get_total_size_async(PurpleL
 	callback_data->counter = array->len;
 	callback_data->total = 0;
 
+	any = FALSE;
+
 	for (i = 0; i < array->len; i++) {
-		PurpleLog *log;
-		GType log_type = g_array_index(array, GType, i);
+		PurpleLogClass *klass = g_array_index(array, PurpleLogClass *, i);
 
-		log = g_object_new(log_type, NULL);
-		purple_log_get_total_size_async(log, chat_type, name, account,
-			io_priority, cancellable, log_total_size_cb, callback_data);
-		g_object_unref(log);
+		if (klass->total_size_async == NULL) {
+			callback_data->counter--;
+			continue;
+		}
+
+		any = TRUE;
+		klass->total_size_async(chat_type, name, account, io_priority,
+			cancellable, log_total_size_cb, callback_data);
 	}
+
+	if (!any) {
+		callback_data->counter = 1;
+		log_total_size_cb(NULL, NULL, callback_data);
+	}
 }
 
 gssize
@@ -2223,7 +2060,11 @@ log_list_cb(GObject *object, GAsyncResul
 	GError *error = NULL;
 	GList *list;
 
-	list = purple_log_list_logs_finish(log, res, &error);
+	if (res != NULL) {
+		list = purple_logs_list_logs_finish(res, &error);
+		callback_data->counter--;
+	} else
+		list = NULL;
 
 	if (list == NULL) {
 		if (error != NULL && error->code != G_IO_ERROR_NOT_SUPPORTED)
@@ -2234,8 +2075,6 @@ log_list_cb(GObject *object, GAsyncResul
 
 	g_clear_error(&error);
 
-	callback_data->counter--;
-
 	if (callback_data->counter < 1) {
 		GSimpleAsyncResult *simple = g_simple_async_result_new(NULL,
 			callback_data->cb, callback_data->userdata,
@@ -2258,7 +2097,11 @@ log_system_list_cb(GObject *object, GAsy
 	GError *error = NULL;
 	GList *list;
 
-	list = purple_log_list_system_logs_finish(log, res, &error);
+	if (res != NULL) {
+		list = purple_logs_list_system_logs_finish(res, &error);
+		callback_data->counter--;
+	} else
+		list = NULL;
 
 	if (list == NULL) {
 		if (error != NULL && error->code != G_IO_ERROR_NOT_SUPPORTED)
@@ -2269,8 +2112,6 @@ log_system_list_cb(GObject *object, GAsy
 
 	g_clear_error(&error);
 
-	callback_data->counter--;
-
 	if (callback_data->counter < 1) {
 		GSimpleAsyncResult *simple = g_simple_async_result_new(NULL,
 			callback_data->cb, callback_data->userdata,
@@ -2289,11 +2130,13 @@ log_total_size_cb(GObject *object, GAsyn
 log_total_size_cb(GObject *object, GAsyncResult *res, gpointer userdata)
 {
 	_purple_log_total_size_callback_data *callback_data = userdata;
-	PurpleLog *log = PURPLE_LOG(object);
 	GError *error = NULL;
 	gssize size;
 
-	size = purple_log_get_total_size_finish(log, res, &error);
+	if (res != NULL)
+		size = purple_logs_get_total_size_finish(res, &error);
+	else
+		size = 0;
 
 	/* It's hard to pass all the errors up, so just log them :( */
 	if (size < 0 && error != NULL)
============================================================
--- libpurple/log.h	410d09e43c4dae8687ae910a641e294bec752f77
+++ libpurple/log.h	614b8c711936fe92f5efed11d1b470b7fb02a9a8
@@ -154,81 +154,58 @@ struct _PurpleLogClass {
 
 	/**
 	 * Lists all available logs
-	 *
-	 * The log argument is a dummy object, only used to keep track of the class
 	 */
-	GList * (* list_fn) (PurpleLog *log, PurpleLogChatType type,
-		const gchar *name, PurpleAccount *account,
-		GCancellable *cancellable, GError **error);
+	GList * (* list_fn) (PurpleLogChatType type, const gchar *name,
+		PurpleAccount *account, GCancellable *cancellable, GError **error);
 
 	/**
 	 * Asynchronously lists all available logs
-	 *
-	 * The log argument is a dummy object, only used to keep track of the class
 	 */
-	void (* list_async) (PurpleLog *log, PurpleLogChatType type,
-		const gchar *name, PurpleAccount *account, gint io_priority,
-		GCancellable *cancellable, GAsyncReadyCallback cb, gpointer userdata);
+	void (* list_async) (PurpleLogChatType type, const gchar *name,
+		PurpleAccount *account, gint io_priority, GCancellable *cancellable, 
+		GAsyncReadyCallback cb, gpointer userdata);
 
 	/**
 	 * Finishes an asynchronous list logs operation
-	 *
-	 * The log argument is a dummy object, only used to keep track of the class
 	 */
-	GList * (* list_finish) (PurpleLog *log, GAsyncResult *res, GError **error);
+	GList * (* list_finish) (GAsyncResult *res, GError **error);
 
 	/**
 	 * Lists all available system logs
-	 *
-	 * The log argument is a dummy object, only used to keep track of the class
 	 */
-	GList * (* list_syslog_fn) (PurpleLog *log, PurpleAccount *account,
+	GList * (* list_syslog_fn) (PurpleAccount *account,
 		GCancellable *cancellable, GError **error);
 
 	/**
 	 * Asynchronously lists all available system logs
-	 *
-	 * The log argument is a dummy object, only used to keep track of the class
 	 */
-	void (* list_syslog_async) (PurpleLog *log, PurpleAccount *account,
-		gint io_priority, GCancellable *cancellable, GAsyncReadyCallback cb,
-		gpointer userdata);
+	void (* list_syslog_async) (PurpleAccount *account, gint io_priority, 
+		GCancellable *cancellable, GAsyncReadyCallback cb, gpointer userdata);
 
 	/**
 	 * Finishes an asynchronous list system logs operation
-	 *
-	 * The log argument is a dummy object, only used to keep track of the class
 	 */
-	GList * (* list_syslog_finish) (PurpleLog *log, GAsyncResult *res,
-		GError **error);
+	GList * (* list_syslog_finish) (GAsyncResult *res, GError **error);
 
 	/**
 	 * Gets the total size for all available logs
 	 *
 	 * If this is undefined a default implementation is used
-	 *
-	 * The log argument is a dummy object, only used to keep track of the class
 	 */
-	gssize (* total_size_fn) (PurpleLog *log, PurpleLogChatType type,
-		const gchar *name, PurpleAccount *account,
-		GCancellable *cancellable, GError **error);
+	gssize (* total_size_fn) (PurpleLogChatType type, const gchar *name,
+		PurpleAccount *account, GCancellable *cancellable, GError **error);
 
 	/**
 	 * Asynchronously gets the total size for all available logs
-	 *
-	 * The log argument is a dummy object, only used to keep track of the class
 	 */
-	void (* total_size_async) (PurpleLog *log, PurpleLogChatType type,
-		const gchar *name, PurpleAccount *account, gint io_priority,
-		GCancellable *cancellable, GAsyncReadyCallback cb, gpointer userdata);
+	void (* total_size_async) (PurpleLogChatType type, const gchar *name,
+		PurpleAccount *account, gint io_priority, GCancellable *cancellable,
+		GAsyncReadyCallback cb, gpointer userdata);
 
 	/**
 	 * Finishes an asynchronous total size operation
-	 *
-	 * The log argument is a dummy object, only used to keep track of the class
 	 */
-	gssize (* total_size_finish) (PurpleLog *log, GAsyncResult *res,
-		GError **error);
+	gssize (* total_size_finish) (GAsyncResult *res, GError **error);
 
 	/**
 	 * Adds log sets to a hash table. By passing the data in the
@@ -518,59 +495,6 @@ gssize purple_log_get_size_finish(Purple
 	GError **error);
 
 /**
- * Returns a list of all available logs for a given logger
- *
- * @param log          A dummy log of the type of logger to use
- * @param type         The type of the log
- * @param name         The name of the log
- * @param account      The account
- * @param cancellable  (allow-none): GCancellable object
- * @param error        (out) (allow-none): a GError location to store the error
- *
- * @return             A sorted list of logs
- */
-GList *purple_log_list_logs(PurpleLog *log, PurpleLogChatType type,
-	const gchar *name, PurpleAccount *account, GCancellable *cancellable,
-	GError **error);
-
-/**
- * Asynchronously gets a list of all available logs for a given logger
- *
- * @param log          A dummy log of the type of logger to use
- * @param type         The type of the log
- * @param name         The name of the log
- * @param account      The account
- * @param io_priority  The io priority of the request
- * @param cancellable  (allow-none): GCancellable object
- * @param cb           (allow-none): A GAsyncReadyCallback to call when the
-                       request is satisfied
- * @param userdata     (allow-none): The data to pass to callback function
- *
- * @since 3.0.0
- */
-void purple_log_list_logs_async(PurpleLog *log, PurpleLogChatType type,
-	const gchar *name, PurpleAccount *account, gint io_priority,
-	GCancellable *cancellable, GAsyncReadyCallback cb, gpointer userdata);
-
-/**
- * Finishes asynchronously getting a list of all available logs for a given
- * logger
- *
- * Note: Make sure to examine that error is not NULL as it is completely possible
- * for the list to be empty and the function to return NULL without an error
- *
- * @param log          A dummy log of the type of logger to use
- * @param res          A GAsyncResult
- * @param error        (out) (allow-none): a GError location to store the error
- *
- * @return             pointer to log list or %NULL on error
- *
- * @since 3.0.0
- */
-GList *purple_log_list_logs_finish(PurpleLog *log, GAsyncResult *res,
-	GError **error);
-
-/**
  * Gets a list of all available logs for all available added loggers.
  * See purple_log_get_logs() for more details.
  *
@@ -623,53 +547,6 @@ GList *purple_logs_list_logs_finish(GAsy
 GList *purple_logs_list_logs_finish(GAsyncResult *res, GError **error);
 
 /**
- * Returns a list of all available system logs
- *
- * @param log          A dummy log of the type of logger to use
- * @param account      The account
- * @param cancellable  (allow-none): GCancellable object
- * @param error        (out) (allow-none): a GError location to store the error
- *
- * @return             A sorted list of logs
- */
-GList *purple_log_list_system_logs(PurpleLog *log, PurpleAccount *account,
-	GCancellable *cancellable, GError **error);
-
-/**
- * Asychronously gets a list of all available system logs
- *
- * @param log          A dummy log of the type of logger to use
- * @param account      The account
- * @param io_priority  The io priority of the request
- * @param cancellable  (allow-none): GCancellable object
- * @param cb           (allow-none): A GAsyncReadyCallback to call when the
-                       request is satisfied
- * @param userdata     (allow-none): The data to pass to callback function
- *
- * @since 3.0.0
- */
-void purple_log_list_system_logs_async(PurpleLog *log, PurpleAccount *account,
-	gint io_priority, GCancellable *cancellable, GAsyncReadyCallback cb,
-	gpointer userdata);
-
-/**
- * Finishes asychronously getting a list of all available system logs
- *
- * Note: Make sure to examine that error is not NULL as it is completely possible
- * for the list to be empty and the function to return NULL without an error
- *
- * @param log          A dummy log of the type of logger to use
- * @param res          A GAsyncResult
- * @param error        (out) (allow-none): a GError location to store the error
- *
- * @return             pointer to log list or %NULL on error
- *
- * @since 3.0.0
- */
-GList *purple_log_list_system_logs_finish(PurpleLog *log, GAsyncResult *res,
-	GError **error);
-
-/**
  * Gets a list of all available system logs for all added loggers.
  * See purple_log_get_system_logs() for more details.
  *
@@ -717,55 +594,6 @@ GList *purple_logs_list_system_logs_fini
 GList *purple_logs_list_system_logs_finish(GAsyncResult *res, GError **error);
 
 /**
- * Returns the size, in bytes, of all logs of a conversation
- *
- * @param log          A dummy log of the type of logger to use
- * @param type         The type of the log
- * @param name         The name of the log
- * @param account      The account
- * @param cancellable  (allow-none): GCancellable object
- * @param error        (out) (allow-none): a GError location to store the error
- *
- * @return             Size of logs or -1 on error
- */
-gssize purple_log_get_total_size(PurpleLog *log, PurpleLogChatType type,
-	const gchar *name, PurpleAccount *account, GCancellable *cancellable,
-	GError **error);
-
-/**
- * Asychronously gets the size, in bytes, of all logs of a conversation
- * See purple_log_get_total_size() for more details.
- *
- * @param log          A dummy log of the type of logger to use
- * @param type         The type of the log
- * @param name         The name of the log
- * @param account      The account
- * @param io_priority  The io priority of the request
- * @param cancellable  (allow-none): GCancellable object
- * @param cb           (allow-none): A GAsyncReadyCallback to call when the
-                       request is satisfied
- * @param userdata     (allow-none): The data to pass to callback function
- * @since 3.0.0
- */
-void purple_log_get_total_size_async(PurpleLog *log, PurpleLogChatType type,
-	const gchar *name, PurpleAccount *account,  gint io_priority,
-	GCancellable *cancellable, GAsyncReadyCallback cb, gpointer userdata);
-
-/**
- * Finishes asynchronously getting the total size of a conversation
- *
- * @param log          A dummy log of the type of logger to use
- * @param res          A GAsyncResult
- * @param error        (out) (allow-none): a GError location to store the error
- *
- * @return             Size of logs or -1 on error
- *
- * @since 3.0.0
- */
-gssize purple_log_get_total_size_finish(PurpleLog *log, GAsyncResult *res,
-	GError **error);
-
-/**
  * Gets the total size of all stored conversations.
  * See purple_log_get_total_size().
  *
============================================================
--- libpurple/htmllog.c	737f2dd5b7e1de455331d45f253176c977c0bc8a
+++ libpurple/htmllog.c	511d8b879d506230f4e12cf306c441b570fa2ed0
@@ -651,7 +651,7 @@ static GList *
 }
 
 static GList *
-purple_html_log_list(PurpleLog *log, PurpleLogChatType type, const gchar *sn,
+purple_html_log_list(PurpleLogChatType type, const gchar *sn,
 	PurpleAccount *account, GCancellable *cancellable, GError **error)
 {
 	return purple_common_log_list(type, sn, account, ".html",
@@ -659,26 +659,25 @@ static void
 }
 
 static void
-purple_html_log_list_async(PurpleLog *log, PurpleLogChatType type,
-	const gchar *sn, PurpleAccount *account, gint io_priority,
-	GCancellable *cancellable, GAsyncReadyCallback cb, gpointer userdata)
+purple_html_log_list_async(PurpleLogChatType type, const gchar *sn,
+	PurpleAccount *account, gint io_priority, GCancellable *cancellable,
+	GAsyncReadyCallback cb, gpointer userdata)
 {
 	purple_common_log_list_async(type, sn, account, ".html",
 		html_klass, io_priority, cancellable, cb, userdata);
 }
 
 static GList *
-purple_html_log_list_syslog(PurpleLog *log, PurpleAccount *account,
-	GCancellable *cancellable, GError **error)
+purple_html_log_list_syslog(PurpleAccount *account, GCancellable *cancellable,
+	GError **error)
 {
 	return purple_common_log_list(PURPLE_LOG_SYSTEM, ".system", account,
 		".html", html_klass, cancellable, error);
 }
 
 static void
-purple_html_log_list_syslog_async(PurpleLog *log, PurpleAccount *account,
-	gint io_priority, GCancellable *cancellable, GAsyncReadyCallback cb,
-	gpointer userdata)
+purple_html_log_list_syslog_async(PurpleAccount *account, gint io_priority,
+	GCancellable *cancellable, GAsyncReadyCallback cb, gpointer userdata)
 {
 	purple_common_log_list_async(PURPLE_LOG_SYSTEM, ".system", account,
 		".html", html_klass, io_priority, cancellable, cb, userdata);
@@ -766,8 +765,8 @@ static gssize
 }
 
 static gssize
-purple_html_log_total_size(PurpleLog *log, PurpleLogChatType type,
-	const gchar *name, PurpleAccount *account, GCancellable *cancellable,
+purple_html_log_total_size(PurpleLogChatType type, const gchar *name,
+	PurpleAccount *account, GCancellable *cancellable,
 	GError **error)
 {
 	return purple_common_log_total_size(type, name, account, ".html",
@@ -775,9 +774,9 @@ static void
 }
 
 static void
-purple_html_log_total_size_async(PurpleLog *log, PurpleLogChatType type,
-	const gchar *name, PurpleAccount *account, gint io_priority,
-	GCancellable *cancellable, GAsyncReadyCallback cb, gpointer userdata)
+purple_html_log_total_size_async(PurpleLogChatType type, const gchar *name,
+	PurpleAccount *account, gint io_priority, GCancellable *cancellable,
+	GAsyncReadyCallback cb, gpointer userdata)
 {
 	purple_common_log_total_size_async(type, name, account, ".html",
 		io_priority, cancellable, cb, userdata);
============================================================
--- libpurple/oldlog.c	cad89a752c00c9310446b5849284dd3bd48d9d2e
+++ libpurple/oldlog.c	acd0976061d273561c46e7af9ce9a56f037bf90a
@@ -31,9 +31,9 @@ PurpleLogClass *old_klass = NULL;
 G_DEFINE_TYPE (PurpleOldLog, purple_old_log, PURPLE_TYPE_COMMON_LOG)
 PurpleLogClass *old_klass = NULL;
 
-static GList *purple_old_log_list(PurpleLog *, PurpleLogChatType, const gchar *,
+static GList *purple_old_log_list(PurpleLogChatType, const gchar *,
 	PurpleAccount *, GCancellable *, GError **);
-static gint purple_old_log_total_size(PurpleLog *, PurpleLogChatType,
+static gint purple_old_log_total_size(PurpleLogChatType,
 	const gchar *, PurpleAccount *, GCancellable *, GError **);
 static gchar *purple_old_log_read(PurpleLog *, PurpleLogReadFlags *,
 	GCancellable *, GError **);
@@ -66,9 +66,8 @@ static GList *
 
 /* XXX: Needs testing!!! */
 static GList *
-purple_old_log_list(PurpleLog *log, PurpleLogChatType chat_type,
-	const gchar *sn, PurpleAccount *account, GCancellable *cancellable,
-	GError **error)
+purple_old_log_list(PurpleLogChatType chat_type, const gchar *sn,
+	PurpleAccount *account, GCancellable *cancellable, GError **error)
 {
 	GDataInputStream *data_stream;
 	GError *err = NULL;
@@ -374,9 +373,8 @@ static gssize
 }
 
 static gssize
-purple_old_log_total_size(PurpleLog *log, PurpleLogChatType chat_type,
-	const gchar *name, PurpleAccount *account, GCancellable *cancellable,
-	GError **error)
+purple_old_log_total_size(PurpleLogChatType chat_type, const gchar *name,
+	PurpleAccount *account, GCancellable *cancellable, GError **error)
 {
 	/* Yes, only one file. */
 	GError *err = NULL;
============================================================
--- libpurple/txtlog.c	2b1f737bc7ccbb1f6823633c345072c2b9882ce7
+++ libpurple/txtlog.c	414d86583297938e3b97af8a93cbacbf656895f8
@@ -217,7 +217,7 @@ static GList *
 }
 
 static GList *
-purple_txt_log_list(PurpleLog *log, PurpleLogChatType type, const gchar *sn,
+purple_txt_log_list(PurpleLogChatType type, const gchar *sn,
 	PurpleAccount *account, GCancellable *cancellable, GError **error)
 {
 	return purple_common_log_list(type, sn, account, ".txt",
@@ -225,26 +225,25 @@ static void
 }
 
 static void
-purple_txt_log_list_async(PurpleLog *log, PurpleLogChatType type,
-	const gchar *sn, PurpleAccount *account, gint io_priority,
-	GCancellable *cancellable, GAsyncReadyCallback cb, gpointer userdata)
+purple_txt_log_list_async(PurpleLogChatType type, const gchar *sn,
+	PurpleAccount *account, gint io_priority, GCancellable *cancellable,
+	GAsyncReadyCallback cb, gpointer userdata)
 {
 	purple_common_log_list_async(type, sn, account, ".txt",
 		txt_klass, io_priority, cancellable, cb, userdata);
 }
 
 static GList *
-purple_txt_log_list_syslog(PurpleLog *log, PurpleAccount *account,
-	GCancellable *cancellable, GError **error)
+purple_txt_log_list_syslog(PurpleAccount *account, GCancellable *cancellable,
+	GError **error)
 {
 	return purple_common_log_list(PURPLE_LOG_SYSTEM, ".system", account,
 		".txt", txt_klass, cancellable, error);
 }
 
 static void
-purple_txt_log_list_syslog_async(PurpleLog *log, PurpleAccount *account,
-	gint io_priority, GCancellable *cancellable, GAsyncReadyCallback cb,
-	gpointer userdata)
+purple_txt_log_list_syslog_async(PurpleAccount *account, gint io_priority,
+	GCancellable *cancellable, GAsyncReadyCallback cb, gpointer userdata)
 {
 	purple_common_log_list_async(PURPLE_LOG_SYSTEM, ".system", account,
 		".txt", txt_klass, io_priority, cancellable, cb, userdata);
@@ -324,18 +323,17 @@ static gssize
 }
 
 static gssize
-purple_txt_log_total_size(PurpleLog *log, PurpleLogChatType type,
-	const gchar *name, PurpleAccount *account, GCancellable *cancellable,
-	GError **error)
+purple_txt_log_total_size(PurpleLogChatType type, const gchar *name,
+	PurpleAccount *account, GCancellable *cancellable, GError **error)
 {
 	return purple_common_log_total_size(type, name, account, ".txt",
 		cancellable, error);
 }
 
 static void
-purple_txt_log_total_size_async(PurpleLog *log, PurpleLogChatType type,
-	const gchar *name, PurpleAccount *account, gint io_priority,
-	GCancellable *cancellable, GAsyncReadyCallback cb, gpointer userdata)
+purple_txt_log_total_size_async(PurpleLogChatType type, const gchar *name,
+	PurpleAccount *account, gint io_priority, GCancellable *cancellable,
+	GAsyncReadyCallback cb, gpointer userdata)
 {
 	purple_common_log_total_size_async(type, name, account, ".txt",
 		io_priority, cancellable, cb, userdata);


More information about the Commits mailing list