[f-spot] Don't break out of the main loop.
- From: Ruben Vermeersch <rubenv src gnome org>
- To: svn-commits-list gnome org
- Subject: [f-spot] Don't break out of the main loop.
- Date: Sun, 14 Jun 2009 20:04:29 -0400 (EDT)
commit 100baa4916e3a3bcb76a8585909564e463cd611a
Author: Ruben Vermeersch <ruben savanne be>
Date: Mon Jun 15 01:57:04 2009 +0200
Don't break out of the main loop.
Additionally, increase the buffer size a bit, should speed things up
slightly (my small experiment showed that an even larger size is
even better).
src/AsyncPixbufLoader.cs | 16 +++++++---------
1 files changed, 7 insertions(+), 9 deletions(-)
---
diff --git a/src/AsyncPixbufLoader.cs b/src/AsyncPixbufLoader.cs
index ee91b9a..08627c1 100644
--- a/src/AsyncPixbufLoader.cs
+++ b/src/AsyncPixbufLoader.cs
@@ -1,3 +1,4 @@
+using Gtk;
using System;
using System.IO;
using System.Runtime.Remoting.Messaging;
@@ -45,8 +46,7 @@ namespace FSpot {
private System.EventHandler ap;
private System.EventHandler ev;
- //byte [] buffer = new byte [8192];
- byte [] buffer = new byte [1 << 15];
+ byte [] buffer = new byte [1 << 16];
public event EventHandler<AreaUpdatedEventArgs> AreaUpdated;
public event EventHandler<AreaPreparedEventArgs> AreaPrepared;
@@ -160,18 +160,16 @@ namespace FSpot {
}
- private void LoadToAreaPrepared ()
+ private void LoadToAreaPrepared ()
{
- delay.Stop ();
- while (!area_prepared && AsyncRead ())
- ; //step
+ while (!area_prepared && delay.IsPending)
+ Application.RunIteration ();
}
public void LoadToDone ()
{
- delay.Stop ();
- while (!done_reading && AsyncRead ())
- ; //step
+ while (!done_reading && delay.IsPending)
+ Application.RunIteration ();
}
private void Close () {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]