Re: CPU usage on export



Hi all,

On Sun, 2007-02-11 at 12:26 +0100, Ruben Vermeersch wrote:
> On Sun, 2007-02-11 at 11:22 +0100, Stephane Delcroix wrote:
> > On Sat, 2007-02-10 at 18:42 +0100, Lorenzo Milesi wrote:
> > > Hi
> > > 
> > > I just noticed that after the exporting of pictures finished (it
> > > happened to me to Picasa and to local directory) F-spot takes LOT of
> > > cpu until you press the OK button.

This bug is caused by the changed ThreadProgressDialog, the attached
patch should fix it, please test.  I don't know if a bugzilla item
already exists, if not, i'll create one.

> 
> Happens to me all the way through export (which is quite annoying, as it
> effectively turns my laptop into a vacuum cleaner).
> 

Sorry about that...

Regards,
Thomas
Index: src/ThreadProgressDialog.cs
===================================================================
--- src/ThreadProgressDialog.cs	(revision 2945)
+++ src/ThreadProgressDialog.cs	(working copy)
@@ -132,9 +132,11 @@
 			}
 		}
 
+		private bool retry_skip;
 		private bool RetrySkipVisible {
 			set { 
-				retry_button.Visible = skip_button.Visible = value;
+				retry_skip = value;
+				delay.Start ();
 			} 
 		}
 
@@ -149,7 +151,7 @@
 
 			RetrySkipVisible = false;
 
-			return error_response == Gtk.ResponseType.Yes ? true : false;
+			return (error_response == Gtk.ResponseType.Yes);
 		}
 
 		private void HandleResponse (object obj, Gtk.ResponseArgs args) {
@@ -162,8 +164,9 @@
 			progress_bar.Text = progress_text;
 			progress_bar.Fraction = System.Math.Min (1.0, System.Math.Max (0.0, fraction));
 			button.Label = button_label;
+			retry_button.Visible = skip_button.Visible = retry_skip;
 
-			return true;
+			return false;
 		}
 
 		private void HandleDestroy (object sender, EventArgs args)
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 2945)
+++ ChangeLog	(working copy)
@@ -1,3 +1,7 @@
+2007-02-11  Thomas Van Machelen <thomas vanmachelen gmail com>
+	* src/ThreadProgressDialog: fix the cpu to take 100% when
+	ThreadProgressDialog is shown
+
 2007-02-09  Larry Ewing  <lewing novell com>
 
 	* src/Imaging/JpegHeader.cs: break out of the loop if we read zero


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]