/soc/2013/ashmew2/filetransferX: 33e859f82064: Fixed #2308

Ashish Gupta ashmew2 at gmail.com
Tue Jun 4 18:24:27 EDT 2013


Changeset: 33e859f820645576db6451c41f39ee799b5e04cd
Author:	 Ashish Gupta <ashmew2 at gmail.com>
Date:	 2013-05-06 19:12 +0530
Branch:	 default
URL: https://hg.pidgin.im/soc/2013/ashmew2/filetransferX/rev/33e859f82064

Description:

Fixed #2308

diffstat:

 pidgin/gtkft.c |  28 +++++++++++++++++++++++++++-
 1 files changed, 27 insertions(+), 1 deletions(-)

diffs (39 lines):

diff --git a/pidgin/gtkft.c b/pidgin/gtkft.c
--- a/pidgin/gtkft.c
+++ b/pidgin/gtkft.c
@@ -415,8 +415,34 @@ static void
 toggle_clear_finished_cb(GtkWidget *w, PidginXferDialog *dialog)
 {
 	dialog->auto_clear = !dialog->auto_clear;
+	if (dialog->num_transfers > 0 && dialog->auto_clear) {
+		
+		gboolean valid;
+		GtkTreeIter iter;
+		
+		valid = gtk_tree_model_get_iter_first(GTK_TREE_MODEL(dialog->model),
+						      &iter);
+		
+		while (valid) {
+			GValue val;
+			PurpleXfer *next;
+			
+			val.g_type = 0;
+			gtk_tree_model_get_value(GTK_TREE_MODEL(dialog->model),
+						 &iter, COLUMN_DATA, &val);
+			
+			next = g_value_get_pointer(&val);
+			if (purple_xfer_is_completed(next)) {
+			        pidgin_xfer_dialog_remove_xfer(dialog, next);
+			}
+			
+			valid = gtk_tree_model_iter_next(GTK_TREE_MODEL(dialog->model),
+							 &iter);
+		}
+	}
+	
 	purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/filetransfer/clear_finished",
-						dialog->auto_clear);
+			      dialog->auto_clear);
 }
 
 static void



More information about the Commits mailing list