cpw.nader.asynclogging-3: 8e5c8f5e: Finished documenting gntlog.h

morshed.nader at gmail.com morshed.nader at gmail.com
Mon May 30 03:41:48 EDT 2011


----------------------------------------------------------------------
Revision: 8e5c8f5efd4fbddfd336ee0d4b9a5d74142a78dc
Parent:   9cc4e609aa175bd263da6730279245b6d61682f5
Author:   morshed.nader at gmail.com
Date:     05/30/11 03:35:51
Branch:   im.pidgin.cpw.nader.asynclogging-3
URL: http://d.pidgin.im/viewmtn/revision/info/8e5c8f5efd4fbddfd336ee0d4b9a5d74142a78dc

Changelog: 

Finished documenting gntlog.h
Removed pidgin_log_viewer_set_search_string, pidgin_log_viewer_set_total_size, and the finch equivalents from the public API (Properties are only readable now)
Removed my random comment from conversation.c

Changes against parent 9cc4e609aa175bd263da6730279245b6d61682f5

  patched  finch/gntlog.c
  patched  finch/gntlog.h
  patched  libpurple/conversation.c
  patched  pidgin/gtklog.c
  patched  pidgin/gtklog.h

-------------- next part --------------
============================================================
--- libpurple/conversation.c	a333425c51a150330fa2db7f62cfa5bf93181a82
+++ libpurple/conversation.c	883fa7b0066358f457be552c05bcd346ade56977
@@ -1006,7 +1006,6 @@ purple_conversation_write(PurpleConversa
 
 	add_message_to_history(conv, who, alias, message, flags, mtime);
 
-	// We should have a "wrote-log-msg" signal!
 	purple_signal_emit(purple_conversations_get_handle(),
 		(type == PURPLE_CONV_TYPE_IM ? "wrote-im-msg" : "wrote-chat-msg"),
 		account, who, displayed, conv, flags);
============================================================
--- pidgin/gtklog.c	d58265ceb9349f34afc9bd35352971f64ffd8f56
+++ pidgin/gtklog.c	e8553bef7ff9bf1bdfd554829eb21e75d09dd9d1
@@ -174,6 +174,9 @@ static void pidgin_log_system_list_cb(GO
 static void pidgin_log_size_cb(GObject *, GAsyncResult *, gpointer);
 static void pidgin_log_list_cb(GObject *, GAsyncResult *, gpointer);
 static void pidgin_log_system_list_cb(GObject *, GAsyncResult *, gpointer);
+static void pidgin_log_viewer_set_search_string(PidginLogViewer *,
+	const gchar *);
+static void pidgin_log_viewer_set_total_size(PidginLogViewer *, gsize);
 static void pidgin_log_viewer_set_selected(PidginLogViewer *,
 	gboolean);
 
@@ -915,7 +918,7 @@ populate_log_tree(PidginLogViewer *lv)
 	}
 }
 
-PidginLogViewer *
+static PidginLogViewer *
 pidgin_log_viewer_new(log_viewer_hash_t *ht, const gchar *title,
 	GtkWidget *icon, gboolean need_log_size)
 {
@@ -1594,7 +1597,7 @@ pidgin_log_viewer_set_logs(PidginLogView
 	g_object_notify(G_OBJECT(lv), "logs");
 }
 
-void
+static void
 pidgin_log_viewer_set_search_string(PidginLogViewer *lv, const gchar *search)
 {
 	PidginLogViewerPrivate *priv;
@@ -1609,7 +1612,7 @@ pidgin_log_viewer_set_search_string(Pidg
 	g_object_notify(G_OBJECT(lv), "search-string");
 }
 
-void
+static void
 pidgin_log_viewer_set_total_size(PidginLogViewer *lv, gsize total)
 {
 	PidginLogViewerPrivate *priv;
@@ -1863,12 +1866,6 @@ pidgin_log_viewer_set_property(GObject *
 	case PROP_LOGS:
 		pidgin_log_viewer_set_logs(lv, g_value_get_pointer(value));
 		break;
-	case PROP_SEARCH_STRING:
-		pidgin_log_viewer_set_search_string(lv, g_value_get_string(value));
-		break;
-	case PROP_TOTAL_SIZE:
-		pidgin_log_viewer_set_total_size(lv, g_value_get_long(value));
-		break;
 	case PROP_SEARCH_CANCEL:
 		pidgin_log_viewer_set_search_cancel(lv, g_value_get_object(value));
 		break;
@@ -1993,7 +1990,7 @@ pidgin_log_viewer_class_init(PidginLogVi
 			"Search String",
 			"The string containing the current search term",
 			NULL,
-			G_PARAM_READWRITE);
+			G_PARAM_READABLE);
 
 	properties[PROP_TOTAL_SIZE] =
 		g_param_spec_ulong("total-size",
@@ -2002,7 +1999,7 @@ pidgin_log_viewer_class_init(PidginLogVi
 			0,
 			G_MAXSIZE,
 			0,
-			G_PARAM_READWRITE);
+			G_PARAM_READABLE);
 
 	properties[PROP_LIST_BAR] =
 		g_param_spec_object("list-bar",
============================================================
--- pidgin/gtklog.h	76338e3325217aab318394b5bfef68836a82d230
+++ pidgin/gtklog.h	d992054bda64fef187374c9ea3209d412f83a8a4
@@ -254,31 +254,6 @@ void pidgin_log_viewer_set_logs(PidginLo
 void pidgin_log_viewer_set_logs(PidginLogViewer *lv, GList *logs);
 
 /**
- * Sets the current string being searched for in the logs.
- *
- * Note: As this does not actually trigger a search, nor does it update the
- * GtkEntry visible to the user, it is only really for internal use.
- *
- * @param lv           The log viewer
- * @param string       The search string
- *
- * @since 3.0.0
- */
-void pidgin_log_viewer_set_search_string(PidginLogViewer *lv,
-	const gchar *string);
-
-/**
- * Sets the total size, to be displayed, of the logs currently added to the
- * viewer.
- *
- * @param lv           The log viewer
- * @param total        The total size of the logs, in bytes
- *
- * @since 3.0.0
- */
-void pidgin_log_viewer_set_total_size(PidginLogViewer *lv, gsize total);
-
-/**
  * Sets the object used to cancel searchs in progress.
  * If the object was already set, this cancels previous searches in progress.
  *
============================================================
--- finch/gntlog.c	266bb9e94e883a8717bcffe8a5f84332da450c8c
+++ finch/gntlog.c	04c12f16325217b28e7a529a9170e041b5aaccad
@@ -134,6 +134,8 @@ static void finch_log_sets_cb(GObject *,
 static void finch_log_list_cb(GObject *, GAsyncResult *, gpointer);
 static void finch_log_system_list_cb(GObject *, GAsyncResult *, gpointer);
 static void finch_log_sets_cb(GObject *, GAsyncResult *, gpointer);
+static void finch_log_viewer_set_search_string(FinchLogViewer *, const gchar *);
+static void finch_log_viewer_set_total_size(FinchLogViewer *, gsize);
 
 
 G_LOCK_DEFINE(log_viewers);
@@ -1102,7 +1104,7 @@ finch_log_viewer_set_logs(FinchLogViewer
 	g_object_notify(G_OBJECT(lv), "logs");
 }
 
-void
+static void
 finch_log_viewer_set_search_string(FinchLogViewer *lv, const gchar *search)
 {
 	FinchLogViewerPrivate *priv;
@@ -1117,7 +1119,7 @@ finch_log_viewer_set_search_string(Finch
 	g_object_notify(G_OBJECT(lv), "search-string");
 }
 
-void
+static void
 finch_log_viewer_set_total_size(FinchLogViewer *lv, gsize total)
 {
 	FinchLogViewerPrivate *priv;
@@ -1305,12 +1307,6 @@ finch_log_viewer_set_property(GObject *o
 	case PROP_LOGS:
 		finch_log_viewer_set_logs(lv, g_value_get_pointer(value));
 		break;
-	case PROP_SEARCH_STRING:
-		finch_log_viewer_set_search_string(lv, g_value_get_string(value));
-		break;
-	case PROP_TOTAL_SIZE:
-		finch_log_viewer_set_total_size(lv, g_value_get_long(value));
-		break;
 	case PROP_SEARCH_CANCEL:
 		finch_log_viewer_set_search_cancel(lv, g_value_get_object(value));
 		break;
@@ -1423,7 +1419,7 @@ finch_log_viewer_class_init(FinchLogView
 			"Search String",
 			"The string containing the current search term",
 			NULL,
-			G_PARAM_READWRITE);
+			G_PARAM_READABLE);
 
 	properties[PROP_TOTAL_SIZE] =
 		g_param_spec_ulong("total-size",
@@ -1432,7 +1428,7 @@ finch_log_viewer_class_init(FinchLogView
 			0,
 			G_MAXSIZE,
 			0,
-			G_PARAM_READWRITE);
+			G_PARAM_READABLE);
 
 	properties[PROP_LIST_BAR] =
 		g_param_spec_object("list-bar",
============================================================
--- finch/gntlog.h	b86870d6ced2ea62a354838c056e78d665488ef7
+++ finch/gntlog.h	f262f1ebb7c54bbf640cc045981748018a2e5013
@@ -28,9 +28,10 @@
 
 #include <glib-object.h>
 
+#include <gntwindow.h>
+
 #include "log.h"
 #include "account.h"
-#include "gntwindow.h"
 
 G_BEGIN_DECLS
 
@@ -67,50 +68,206 @@ struct _FinchLogViewerClass {
 };
 
 
-//
+/**
+ * Gets the list of logs being displayed by the log viewer
+ *
+ * @param lv           The log viewer
+ *
+ * @return             The list of logs
+ *
+ * @since 3.0.0
+ */
 GList *finch_log_viewer_get_logs(FinchLogViewer *lv);
-//
+
+/**
+ * Gets the tree containing the current structure of logs being displayed
+ *
+ * @param lv           The log viewer
+ *
+ * @return             The tree
+ *
+ * @since 3.0.0
+ */
 GntWidget *finch_log_viewer_get_tree(FinchLogViewer *lv);
-//
+
+/**
+ * Gets the text area used to display the currently selected log
+ *
+ * @param lv           The log viewer
+ *
+ * @return             The text area
+ *
+ * @since 3.0.0
+ */
 GntWidget *finch_log_viewer_get_text_area(FinchLogViewer *lv);
-//
+
+/**
+ * Gets current text string being used to search through the logs
+ *
+ * @param lv           The log viewer
+ *
+ * @return             The search string
+ *
+ * @since 3.0.0
+ */
 G_CONST_RETURN gchar *finch_log_viewer_get_search_string(FinchLogViewer *lv);
-//
+
+/**
+ * Gets the total size, in bytes, of all the logs being displayed
+ *
+ * @param lv           The log viewer
+ *
+ * @return             The total size of the logs
+ *
+ * @since 3.0.0
+ */
 gsize finch_log_viewer_get_total_size(FinchLogViewer *lv);
-//
+
+/**
+ * Gets the bar used to indicate the progress of a listing process
+ *
+ * @param lv           The log viewer
+ *
+ * @return             The progress bar
+ *
+ * @since 3.0.0
+ */
 GntWidget *finch_log_viewer_get_list_bar(FinchLogViewer *lv);
-//
+
+/**
+ * Gets the bar used to indicate the progress of a searching process
+ *
+ * @param lv           The log viewer
+ *
+ * @return             The progress bar
+ *
+ * @since 3.0.0
+ */
 GntWidget *finch_log_viewer_get_search_bar(FinchLogViewer *lv);
-//
+
+/**
+ * Gets the object used to cancel a search that is currently in progress
+ *
+ * @param lv           The log viewer
+ *
+ * @return             The GCancellable object
+ *
+ * @since 3.0.0
+ */
 GCancellable *finch_log_viewer_get_search_cancel(FinchLogViewer *lv);
-//
+
+/**
+ * Gets the object used to cancel a listing that is currently in progress
+ *
+ * @param lv           The log viewer
+ *
+ * @return             The GCancellable object
+ *
+ * @since 3.0.0
+ */
 GCancellable *finch_log_viewer_get_list_cancel(FinchLogViewer *lv);
-//
+
+/**
+ * Gets the object used to cancel a read that is currently in progress
+ *
+ * @param lv           The log viewer
+ *
+ * @return             The GCancellable object
+ *
+ * @since 3.0.0
+ */
 GCancellable *finch_log_viewer_get_read_cancel(FinchLogViewer *lv);
-//
+
+/**
+ * Gets the type of logs being displayed
+ *
+ * @param lv           The log viewer
+ *
+ * @return             The log type
+ *
+ * @since 3.0.0
+ */
 PurpleLogChatType finch_log_viewer_get_viewer_type(FinchLogViewer *lv);
-//
+
+/**
+ * Checks whether the viewer still needs to finish getting the total log size
+ *
+ * @param lv           The log viewer
+ *
+ * @return             %TRUE if the sizing is incomplete, %FALSE otherwise
+ *
+ * @since 3.0.0
+ */
 gboolean finch_log_viewer_get_need_log_size(FinchLogViewer *lv);
-//
+
+/**
+ * Gets the title for the log viewer (I.E. "Conversations with Foo")
+ *
+ * @param lv           The log viewer
+ *
+ * @return             The title
+ *
+ * @since 3.0.0
+ */
 G_CONST_RETURN gchar *finch_log_viewer_get_viewer_title(FinchLogViewer *lv);
 
-//
+/**
+ * Adds a list of logs to be displayed in the viewer
+ *
+ * @param lv           The log viewer
+ * @param logs         The logs to be added
+ *
+ * @since 3.0.0
+ */
 void finch_log_viewer_add_logs(FinchLogViewer *lv, GList *logs);
-//
+
+/**
+ * Clears the viewer of its logs and sets a new list of logs to be displayed
+ *
+ * @param lv           The log viewer
+ * @param logs         The logs to be added
+ *
+ * @since 3.0.0
+ */
 void finch_log_viewer_set_logs(FinchLogViewer *lv, GList *logs);
-//
-void finch_log_viewer_set_search_string(FinchLogViewer *lv, const gchar *string);
-//
-void finch_log_viewer_set_total_size(FinchLogViewer *lv, gsize total);
-//
-void finch_log_viewer_set_search_cancel(FinchLogViewer *lv, GCancellable *cancellable);
-//
-void finch_log_viewer_set_list_cancel(FinchLogViewer *lv, GCancellable *cancellable);
-//
-void finch_log_viewer_set_read_cancel(FinchLogViewer *lv, GCancellable *cancellable);
 
+/**
+ * Sets the object used to cancel searchs in progress.
+ * If the object was already set, this cancels previous searches in progress.
+ *
+ * @param lv           The log viewer
+ * @param cancellable  (allow-none): GCancellable object
+ *
+ * @since 3.0.0
+ */
+void finch_log_viewer_set_search_cancel(FinchLogViewer *lv,
+	GCancellable *cancellable);
 
+/**
+ * Sets the object used to cancel listings in progress.
+ * If the object was already set, this cancels previous listings in progress.
+ *
+ * @param lv           The log viewer
+ * @param cancellable  (allow-none): GCancellable object
+ *
+ * @since 3.0.0
+ */
+void finch_log_viewer_set_list_cancel(FinchLogViewer *lv,
+	GCancellable *cancellable);
 
+/**
+ * Sets the object used to cancel reads in progress.
+ * If the object was already set, this cancels previous reads in progress.
+ *
+ * @param lv           The log viewer
+ * @param cancellable  (allow-none): GCancellable object
+ *
+ * @since 3.0.0
+ */
+void finch_log_viewer_set_read_cancel(FinchLogViewer *lv,
+	GCancellable *cancellable);
+
+
 /**************************************************************************/
 /** @name Log Viewer Creators                                             */
 /**************************************************************************/
@@ -126,7 +283,8 @@ GType finch_log_viewer_get_type(void);
  * @param username:    The buddy or chat name
  * @param account:     The account
  */
-void finch_log_show(PurpleLogChatType chat_type, const gchar *username, PurpleAccount *account);
+void finch_log_show(PurpleLogChatType chat_type, const gchar *username,
+	PurpleAccount *account);
 
 /**
  * Displays the logs for one contact


More information about the Commits mailing list