cpw.nader.asynclogging-3: 836bca30: Made pidgin_log_viewer_set_selected priv...

morshed.nader at gmail.com morshed.nader at gmail.com
Wed Mar 30 01:41:58 EDT 2011


----------------------------------------------------------------------
Revision: 836bca30ace8f3c6f889070a59228e6602a937c0
Parent:   68d462386b8d04f68739e7846cce7e44568ef070
Author:   morshed.nader at gmail.com
Date:     03/21/11 19:46:58
Branch:   im.pidgin.cpw.nader.asynclogging-3
URL: http://d.pidgin.im/viewmtn/revision/info/836bca30ace8f3c6f889070a59228e6602a937c0

Changelog: 

Made pidgin_log_viewer_set_selected private to gtklog.c, and PROP_SELECTED be read-only
Cleaned up gtklog.h and documented all the get/set functions

Changes against parent 68d462386b8d04f68739e7846cce7e44568ef070

  patched  pidgin/gtklog.c
  patched  pidgin/gtklog.h

-------------- next part --------------
============================================================
--- pidgin/gtklog.c	cfab497e80fa8327e7a57f5b3b6c5ee9bfd408a5
+++ pidgin/gtklog.c	dfdfb52228b4d7328f8509bd8d5628e74d3377b3
@@ -174,8 +174,11 @@ 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_selected(PidginLogViewer *,
+	gboolean);
 
 
+
 G_LOCK_DEFINE(log_viewers);
 G_LOCK_DEFINE(syslog_viewer);
 
@@ -1700,7 +1703,7 @@ pidgin_log_viewer_set_read_cancel(Pidgin
 	g_object_notify(G_OBJECT(lv), "read-cancel");
 }
 
-void
+static void
 pidgin_log_viewer_set_selected(PidginLogViewer *lv, gboolean selected)
 {
 	g_return_if_fail(PIDGIN_IS_LOG_VIEWER(lv));
@@ -1869,9 +1872,6 @@ pidgin_log_viewer_set_property(GObject *
 	case PROP_READ_CANCEL:
 		pidgin_log_viewer_set_read_cancel(lv, g_value_get_object(value));
 		break;
-	case PROP_SELECTED:
-		pidgin_log_viewer_set_selected(lv, g_value_get_boolean(value));
-		break;
 	case PROP_VIEWER_TYPE:
 		pidgin_log_viewer_set_viewer_type(lv, g_value_get_enum(value));
 		break;
@@ -2039,7 +2039,7 @@ pidgin_log_viewer_class_init(PidginLogVi
 			"Indicates whether or not the user has selected"
 			"a log from the tree view since it was last cleared",
 			FALSE,
-			G_PARAM_READWRITE);
+			G_PARAM_READABLE);
 
 	properties[PROP_VIEWER_TYPE] =
 		g_param_spec_enum("viewer-type",
============================================================
--- pidgin/gtklog.h	9f6aa767fa22a0eb1304aeb92f81fec4814dd6f2
+++ pidgin/gtklog.h	76338e3325217aab318394b5bfef68836a82d230
@@ -68,68 +68,260 @@ struct _PidginLogViewerClass {
 };
 
 
-//
+/**
+ * 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 *pidgin_log_viewer_get_logs(PidginLogViewer *lv);
-//
+
+/**
+ * Gets the tree store containing the current structure of logs being displayed
+ *
+ * @param lv           The log viewer
+ *
+ * @return             The tree store
+ *
+ * @since 3.0.0
+ */
 GtkTreeStore *pidgin_log_viewer_get_tree_store(PidginLogViewer *lv);
-//
+
+/**
+ * Gets the tree view being displayed by the log viewer
+ *
+ * @param lv           The log viewer
+ *
+ * @return             The tree view
+ *
+ * @since 3.0.0
+ */
 GtkWidget *pidgin_log_viewer_get_tree_view(PidginLogViewer *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
+ */
 GtkWidget *pidgin_log_viewer_get_text_area(PidginLogViewer *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 *pidgin_log_viewer_get_search_string(PidginLogViewer *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 pidgin_log_viewer_get_total_size(PidginLogViewer *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
+ */
 GtkWidget *pidgin_log_viewer_get_list_bar(PidginLogViewer *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
+ */
 GtkWidget *pidgin_log_viewer_get_search_bar(PidginLogViewer *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 *pidgin_log_viewer_get_search_cancel(PidginLogViewer *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 *pidgin_log_viewer_get_list_cancel(PidginLogViewer *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 *pidgin_log_viewer_get_read_cancel(PidginLogViewer *lv);
-//
+
+/**
+ * Checks whether a log has been selected from the tree view
+ *
+ * @param lv           The log viewer
+ *
+ * @return             %TRUE if a log is selected, %FALSE otherwise
+ *
+ * @since 3.0.0
+ */
 gboolean pidgin_log_viewer_is_selected(PidginLogViewer *lv);
-//
+
+/**
+ * Gets the type of logs being displayed
+ *
+ * @param lv           The log viewer
+ *
+ * @return             The log type
+ *
+ * @since 3.0.0
+ */
 PurpleLogChatType pidgin_log_viewer_get_viewer_type(PidginLogViewer *lv);
-//
+
+/**
+ * Gets the icon for the account being displayed
+ *
+ * @param lv           The log viewer
+ *
+ * @return             The icon
+ *
+ * @since 3.0.0
+ */
 GtkWidget *pidgin_log_viewer_get_icon(PidginLogViewer *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 pidgin_log_viewer_get_need_log_size(PidginLogViewer *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 pidgin_log_viewer_add_logs(PidginLogViewer *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 pidgin_log_viewer_set_logs(PidginLogViewer *lv, GList *logs);
-//
-void pidgin_log_viewer_set_search_string(PidginLogViewer *lv, const gchar *string);
-//
+
+/**
+ * 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);
-//
-void pidgin_log_viewer_set_search_cancel(PidginLogViewer *lv, GCancellable *cancellable);
-//
-void pidgin_log_viewer_set_list_cancel(PidginLogViewer *lv, GCancellable *cancellable);
-//
-void pidgin_log_viewer_set_read_cancel(PidginLogViewer *lv, GCancellable *cancellable);
-//
-void pidgin_log_viewer_set_selected(PidginLogViewer *lv, gboolean selected);
 
+/**
+ * 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 pidgin_log_viewer_set_search_cancel(PidginLogViewer *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 pidgin_log_viewer_set_list_cancel(PidginLogViewer *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 pidgin_log_viewer_set_read_cancel(PidginLogViewer *lv,
+	GCancellable *cancellable);
+
 /**************************************************************************/
 /** @name Log Viewer Creators                                             */
 /**************************************************************************/
 
 /*@{*/
 
-//
 GType pidgin_log_viewer_get_type(void);
 
-//
-// pidgin_log_viewer_new()
-
 /**
  * Displays the logs of a certain type for a buddy or chat on an account
  *
@@ -137,7 +329,8 @@ GType pidgin_log_viewer_get_type(void);
  * @param buddyname:   The buddy or chat name
  * @param account:     The account
  */
-void pidgin_log_show(PurpleLogChatType chat_type, const gchar *buddyname, PurpleAccount *account);
+void pidgin_log_show(PurpleLogChatType chat_type, const gchar *buddyname,
+	PurpleAccount *account);
 
 /**
  * Displays the logs for one contact


More information about the Commits mailing list