cpw.nader.asynclogging-3: 3f1762df: Went through and broke up long lines in ...

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


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

Changelog: 

Went through and broke up long lines in gntlog.c

Changes against parent 836bca30ace8f3c6f889070a59228e6602a937c0

  patched  finch/gntlog.c
  patched  pidgin/gtklog.c

-------------- next part --------------
============================================================
--- pidgin/gtklog.c	dfdfb52228b4d7328f8509bd8d5628e74d3377b3
+++ pidgin/gtklog.c	e1d92ca5347c39b5f490e0ce0f50947e7cef186e
@@ -1316,9 +1316,11 @@ pidgin_log_show_contact(PurpleContact *c
 		name = purple_buddy_get_contact_alias(
 			purple_contact_get_priority_buddy(contact));
 
-	/* This will happen if the contact doesn't have an alias,
+	/**
+	 * This will happen if the contact doesn't have an alias,
 	 * and none of the contact's buddies are online.
-	 * There is probably a better way to deal with this. */
+	 * There is probably a better way to deal with this.
+	 */
 	if (name == NULL) {
 		child = purple_blist_node_get_first_child(PURPLE_BLIST_NODE(contact));
 
============================================================
--- finch/gntlog.c	0b659385420022274bdad45cc5050c704e8ea5f1
+++ finch/gntlog.c	d81ba50b9f0b958b0b70b070c659f9e8863af529
@@ -118,7 +118,8 @@ static const gchar *log_get_date(PurpleL
 static guint log_viewer_hash(gconstpointer);
 static gboolean log_viewer_equal(gconstpointer, gconstpointer);
 static const gchar *log_get_date(PurpleLog *);
-static FinchLogViewer *finch_log_viewer_new(log_viewer_hash_t *, const gchar *, gboolean);
+static FinchLogViewer *finch_log_viewer_new(log_viewer_hash_t *, const gchar *,
+	gboolean);
 static void finch_log_search_done_cb(_finch_log_data *);
 static void finch_log_search_cb(GObject *, GAsyncResult *, gpointer);
 static void search_cb(GntWidget *, FinchLogViewer *);
@@ -395,7 +396,8 @@ static void
 }
 
 static void
-log_select_cb(GntWidget *w, gpointer old_row, gpointer new_row, FinchLogViewer *lv)
+log_select_cb(GntWidget *w, gpointer old_row, gpointer new_row,
+	FinchLogViewer *lv)
 {
 	_finch_log_data *finch_log_data;
 	PurpleLog *log;
@@ -448,17 +450,23 @@ log_select_cb(GntWidget *w, gpointer old
 	g_object_unref(cancel);
 }
 
-/* I want to make this smarter, but haven't come up with a cool algorithm to do so, yet.
- * I want the tree to be divided into groups like "Today," "Yesterday," "Last week,"
- * "August," "2002," etc. based on how many conversation took place in each subdivision.
+/**
+ * I want to make this smarter, but haven't come up with a cool algorithm to
+ * do so, yet.
  *
+ * I want the tree to be divided into groups like "Today,"
+ * "Yesterday," "Last week," "August," "2002," etc. based on how many
+ * conversation took place in each subdivision.
+ *
  * For now, I'll just make it a flat list.
  */
 static void
 populate_log_tree(FinchLogViewer *lv)
-     /* Logs are made from trees in real life.
-        This is a tree made from logs */
 {
+	/**
+	 * Logs are made from trees in real life.
+	 * This is a tree made from logs
+	 */
 	GntTree *tree = GNT_TREE(finch_log_viewer_get_tree(lv));
 	GList *logs = finch_log_viewer_get_logs(lv);
 	const gchar *pmonth;
@@ -507,7 +515,9 @@ finch_log_viewer_new(log_viewer_hash_t *
 		"need-log-size", need_log_size,
 		NULL);
 
-	/* Store the information to later prevent duplicate windows from popping up */
+	/**
+	 * Store the information to later prevent duplicate windows from popping up.
+	 */
 	if (ht != NULL) {
 		G_LOCK(log_viewers);
 		g_hash_table_insert(log_viewers, ht, g_object_ref(lv));
@@ -536,13 +546,13 @@ finch_log_done_cb(_finch_log_data *finch
 
 			if (chat_type == PURPLE_LOG_SYSTEM) {
 				if (!purple_prefs_get_bool("/purple/logging/log_system"))
-					log_preferences = _("System events will only be logged if the "
-						"\"Log all status changes to system log\" "
+					log_preferences = _("System events will only be logged "
+						"if the \"Log all status changes to system log\" "
 						"preference is enabled.");
 			} else if (chat_type == PURPLE_LOG_IM) {
 				if (!purple_prefs_get_bool("/purple/logging/log_ims"))
-					log_preferences = _("Instant messages will only be logged if the "
-						"\"Log all instant messages\" "
+					log_preferences = _("Instant messages will only be logged " 
+						"if the \"Log all instant messages\" "
 						"preference is enabled.");
 			} else if (chat_type == PURPLE_LOG_CHAT) {
 				if (!purple_prefs_get_bool("/purple/logging/log_chats"))
@@ -700,10 +710,12 @@ finch_log_sets_cb(GObject *object, GAsyn
 
 				finch_log_data->count = (finch_log_data->total += 2);
 
-				purple_logs_get_logs_async(PURPLE_LOG_IM, set->name, set->account,
-					G_PRIORITY_DEFAULT, cancel, finch_log_list_cb, finch_log_data);
-				purple_logs_get_total_size_async(PURPLE_LOG_IM, set->name, set->account,
-					G_PRIORITY_DEFAULT, cancel, finch_log_size_cb, finch_log_data);
+				purple_logs_get_logs_async(PURPLE_LOG_IM, set->name,
+					set->account, G_PRIORITY_DEFAULT, cancel,
+					finch_log_list_cb, finch_log_data);
+				purple_logs_get_total_size_async(PURPLE_LOG_IM, set->name,
+					set->account, G_PRIORITY_DEFAULT, cancel,
+					finch_log_size_cb, finch_log_data);
 			}
 		}
 
@@ -718,7 +730,8 @@ void
 }
 
 void
-finch_log_show(PurpleLogChatType chat_type, const gchar *username, PurpleAccount *account)
+finch_log_show(PurpleLogChatType chat_type, const gchar *username,
+	PurpleAccount *account)
 {
 	log_viewer_hash_t *ht;
 	_finch_log_data *finch_log_data;
@@ -832,11 +845,14 @@ finch_log_show_contact(PurpleContact *co
 	}
 
 	if ((name = purple_contact_get_alias(contact)) == NULL)
-		name = purple_buddy_get_contact_alias(purple_contact_get_priority_buddy(contact));
+		name = purple_buddy_get_contact_alias(
+			purple_contact_get_priority_buddy(contact));
 
-	/* This will happen if the contact doesn't have an alias,
+	/**
+	 * This will happen if the contact doesn't have an alias,
 	 * and none of the contact's buddies are online.
-	 * There is probably a better way to deal with this. */
+	 * There is probably a better way to deal with this.
+	 */
 	if (name == NULL) {
 		child = purple_blist_node_get_first_child(PURPLE_BLIST_NODE(contact));
 
@@ -1196,7 +1212,8 @@ static void
 }
 
 static void
-finch_log_viewer_set_viewer_type(FinchLogViewer *lv, PurpleLogChatType viewer_type)
+finch_log_viewer_set_viewer_type(FinchLogViewer *lv,
+	PurpleLogChatType viewer_type)
 {
 	g_return_if_fail(FINCH_IS_LOG_VIEWER(lv));
 
@@ -1210,7 +1227,8 @@ finch_log_viewer_set_need_log_size(Finch
 {
 	g_return_if_fail(FINCH_IS_LOG_VIEWER(lv));
 
-	FINCH_LOG_VIEWER_GET_PRIVATE(lv)->need_log_size = need_log_size ? TRUE : FALSE;
+	FINCH_LOG_VIEWER_GET_PRIVATE(lv)->need_log_size =
+		need_log_size ? TRUE : FALSE;
 
 	g_object_notify(G_OBJECT(lv), "need-log-size");
 }
@@ -1241,7 +1259,8 @@ finch_log_viewer_constructed(GObject *ob
 
 		/* Strange things associated with the log size being set on
 		   construction that need to be worked out */
-		text = g_strdup_printf("%s %s", _("Total log size:"), _("calculating..."));
+		text = g_strdup_printf("%s %s", _("Total log size:"),
+			_("calculating..."));
 
 		priv->size_label = gnt_label_new(text);
 		gnt_box_add_widget(GNT_BOX(priv->view_box), priv->size_label);
@@ -1250,7 +1269,8 @@ finch_log_viewer_constructed(GObject *ob
 	}
 
 	/* Hook up all the signals */
-	g_signal_connect(priv->tree, "selection-changed", G_CALLBACK(log_select_cb), lv);
+	g_signal_connect(priv->tree, "selection-changed",
+		G_CALLBACK(log_select_cb), lv);
 	g_signal_connect(priv->entry, "activate", G_CALLBACK(search_cb), lv);
 }
 
@@ -1284,7 +1304,8 @@ static void
 }
 
 static void
-finch_log_viewer_set_property(GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
+finch_log_viewer_set_property(GObject *object, guint prop_id,
+	const GValue *value, GParamSpec *pspec)
 {
 	FinchLogViewer *lv = FINCH_LOG_VIEWER(object);
 
@@ -1323,7 +1344,8 @@ static void
 }
 
 static void
-finch_log_viewer_get_property(GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
+finch_log_viewer_get_property(GObject *object, guint prop_id,
+	GValue *value, GParamSpec *pspec)
 {
 	FinchLogViewer *lv = FINCH_LOG_VIEWER(object);
 
@@ -1399,7 +1421,8 @@ finch_log_viewer_class_init(FinchLogView
 	properties[PROP_TEXT_AREA] =
 		g_param_spec_object("text-area",
 			"Text Area",
-			"The text area that displays the currently selected log to the user",
+			"The text area that displays the currently selected "
+			"log to the user",
 			GNT_TYPE_TEXT_VIEW,
 			G_PARAM_READABLE);
 
@@ -1443,14 +1466,16 @@ finch_log_viewer_class_init(FinchLogView
 	properties[PROP_LIST_CANCEL] =
 		g_param_spec_object("list-cancel",
 			"List Cancellable",
-			"A GCancellable object used to stop log-listings that are in progress",
+			"A GCancellable object used to stop log-listings that "
+			"are in progress",
 			G_TYPE_CANCELLABLE,
 			G_PARAM_READWRITE);
 
 	properties[PROP_READ_CANCEL] =
 		g_param_spec_object("read-cancel",
 			"Read Cancellable",
-			"A GCancellable object used to stop log-listings that are in progress",
+			"A GCancellable object used to stop log-listings that "
+			"are in progress",
 			G_TYPE_CANCELLABLE,
 			G_PARAM_READWRITE);
 
@@ -1619,7 +1644,8 @@ finch_log_init(void)
 
 	G_LOCK(log_viewers);
 	/* Is the ht stuff leaking? */
-	log_viewers = g_hash_table_new_full(log_viewer_hash, log_viewer_equal, NULL, g_object_unref);
+	log_viewers = g_hash_table_new_full(log_viewer_hash, log_viewer_equal,
+		NULL, g_object_unref);
 	G_UNLOCK(log_viewers);
 
 	G_LOCK(syslog_viewer);


More information about the Commits mailing list