f-spot r4141 - in trunk: . src src/Core src/UI.Dialog src/Widgets



Author: rubenv
Date: Thu Jul  3 08:50:37 2008
New Revision: 4141
URL: http://svn.gnome.org/viewvc/f-spot?rev=4141&view=rev

Log:
2008-07-03  Ruben Vermeersch  <ruben savanne be>

	Fix bgo #170956. Adds flags in various places to designate what caused the
	change. This avoids photo reloads when adding a tag.

	* src/Core/BrowsableEventArgs.cs: Add MetadataChanged and ContentChanged
	flags to show what changed.

	* src/Core/BrowsablePointer.cs: Add flags as well.

	* src/FileImportBackend.cs, src/ImportCommand.cs, src/InfoOverlay.cs,
	src/ItemAction.cs, src/MainWindow.cs, src/PhotoVersionCommands.cs,
	src/PhotoView.cs, src/UI.Dialog/ColorDialog.cs: Change the way changes are
	marked and committed, to supply the extra needed metadata.

	* src/PhotoImageView.cs: Don't reload if the image didn't change at all.

	* src/PhotoQuery.cs: Allow passing flags through PhotoQuery. Propagate the
	ones from the PhotoEventArgs. Always pass the Changed events through the
	store, makes sure everyone receives them.

	* src/PhotoStore.cs: Add PhotoEventArgs. Deprecate normal Commit
	operations, instead force the usage of metadata aware Commit methods.
	Provide new EmitChanged methods to signal changes to photos.

	* src/TimeDialog.cs: Change TimeChangedEventArgs to inherit from
	PhotoEventArgs.

	* src/Widgets/Filmstrip.cs, src/Widgets/IconView.cs,
	src/Widgets/MetadataDisplay.cs: Correctly handle events, based on what
	actually happened.


Modified:
   trunk/ChangeLog
   trunk/src/Core/BrowsableEventArgs.cs
   trunk/src/Core/BrowsablePointer.cs
   trunk/src/FileImportBackend.cs
   trunk/src/ImportCommand.cs
   trunk/src/InfoOverlay.cs
   trunk/src/ItemAction.cs
   trunk/src/MainWindow.cs
   trunk/src/PhotoImageView.cs
   trunk/src/PhotoQuery.cs
   trunk/src/PhotoStore.cs
   trunk/src/PhotoVersionCommands.cs
   trunk/src/PhotoView.cs
   trunk/src/TimeDialog.cs
   trunk/src/UI.Dialog/ColorDialog.cs
   trunk/src/Widgets/Filmstrip.cs
   trunk/src/Widgets/IconView.cs
   trunk/src/Widgets/MetadataDisplay.cs

Modified: trunk/src/Core/BrowsableEventArgs.cs
==============================================================================
--- trunk/src/Core/BrowsableEventArgs.cs	(original)
+++ trunk/src/Core/BrowsableEventArgs.cs	Thu Jul  3 08:50:37 2008
@@ -7,23 +7,46 @@
  * This is free software. See COPYING for details.
  */
 
+using System;
+
 namespace FSpot
 {
 	public class BrowsableEventArgs : System.EventArgs {
-		int [] items;
-
+		private readonly int [] items;
 		public int [] Items {
 			get { return items; }
 		}
 
-		public BrowsableEventArgs (int num)
+		private readonly bool metadata_changed;
+		public bool MetadataChanged {
+			get { return metadata_changed; }
+		}
+
+		private readonly bool data_changed;
+		public bool DataChanged {
+			get { return data_changed; }
+		}
+
+		public BrowsableEventArgs (int num, bool metadata_changed, bool data_changed)
+			: this (new int [] { num }, metadata_changed, data_changed)
 		{
-			items = new int [] { num };
 		}
 
-		public BrowsableEventArgs (int [] items)
+		public BrowsableEventArgs (int [] items, bool metadata_changed, bool data_changed)
 		{
 			this.items = items;
+			this.metadata_changed = metadata_changed;
+			this.data_changed = data_changed;
+		}
+
+		[Obsolete ("You should be smarter and provide info about what changed!")]
+		public BrowsableEventArgs (int num) : this (new int [] { num }, true, true)
+		{
+		}
+
+		[Obsolete ("You should be smarter and provide info about what changed!")]
+		public BrowsableEventArgs (int [] items) : this (items, true, true)
+		{
 		}
 	}
 }

Modified: trunk/src/Core/BrowsablePointer.cs
==============================================================================
--- trunk/src/Core/BrowsablePointer.cs	(original)
+++ trunk/src/Core/BrowsablePointer.cs	Thu Jul  3 08:50:37 2008
@@ -12,21 +12,33 @@
 	public delegate void ItemChangedHandler (BrowsablePointer pointer, BrowsablePointerChangedArgs old);
 
 	public class BrowsablePointerChangedArgs {
-		IBrowsableItem previous_item;
-		int previous_index;
-		
+		private readonly IBrowsableItem previous_item;
 		public IBrowsableItem PreviousItem {
 			get { return previous_item; }
 		}
-		
+
+		private readonly int previous_index;
 		public int PreviousIndex {
 			get { return previous_index; }
 		}
 
-		public BrowsablePointerChangedArgs (IBrowsableItem old_item, int old_index)
+		private readonly bool metadata_changed;
+		public bool MetadataChanged {
+			get { return metadata_changed; }
+		}
+
+		private readonly bool data_changed;
+		public bool DataChanged {
+			get { return data_changed; }
+		}
+
+		public BrowsablePointerChangedArgs (IBrowsableItem previous_item, int previous_index,
+				bool metadata_changed, bool data_changed)
 		{
-			previous_item = old_item;
-			previous_index = old_index;
+			this.previous_item = previous_item;
+			this.previous_index = previous_index;
+			this.metadata_changed = metadata_changed;
+			this.data_changed = data_changed;
 		}
 	}
 
@@ -114,16 +126,17 @@
 			get { return index; }
 			set {
 				if (index != value) {
-					SetIndex (value);
+					SetIndex (value, false, false);
 				}				
 			}
 		}
 
-		private void SetIndex (int value)
+		private void SetIndex (int value, bool metadata_changed, bool data_changed)
 		{
 			BrowsablePointerChangedArgs args;
 			
-			args = new BrowsablePointerChangedArgs (Current, index);
+			args = new BrowsablePointerChangedArgs (Current, index,
+					metadata_changed, data_changed);
 			
 			index = value;
 			item = Current;
@@ -137,7 +150,7 @@
 		{
 			foreach (int item in event_args.Items)
 				if (item == Index) 
-					SetIndex (Index);
+					SetIndex (Index, event_args.MetadataChanged, event_args.DataChanged);
 		}
 		
 		protected void HandleCollectionChanged (IBrowsableCollection collection)
@@ -147,17 +160,17 @@
 			
 			if (old_location == next_location) {
 				if (! Valid (next_location))
-					SetIndex (0);
+					SetIndex (0, false, false);
 
 				return;
 			}
 			
 			if (Valid (next_location))
-				SetIndex (next_location);
+				SetIndex (next_location, false, false);
 			else if (Valid (old_location))
-				SetIndex (old_location);
+				SetIndex (old_location, false, false);
 			else
-				SetIndex (0);
+				SetIndex (0, false, false);
 		}
 	}
 }

Modified: trunk/src/FileImportBackend.cs
==============================================================================
--- trunk/src/FileImportBackend.cs	(original)
+++ trunk/src/FileImportBackend.cs	Thu Jul  3 08:50:37 2008
@@ -244,7 +244,7 @@
 			needs_commit |= xmptags.Import (photo, info.DestinationPath, info.OriginalPath);
 
 			if (needs_commit)
-				store.Commit(photo);
+				store.Commit(photo, true, true);
 			
 			info.Photo = photo;
 		} catch (System.Exception e) {

Modified: trunk/src/ImportCommand.cs
==============================================================================
--- trunk/src/ImportCommand.cs	(original)
+++ trunk/src/ImportCommand.cs	Thu Jul  3 08:50:37 2008
@@ -689,7 +689,7 @@
 						continue;
 					
 					p.AddTag ((Tag [])tags_selected.ToArray(typeof(Tag)));
-					store.Commit (p);
+					store.Commit (p, true, true);
 				}
 			}
 

Modified: trunk/src/InfoOverlay.cs
==============================================================================
--- trunk/src/InfoOverlay.cs	(original)
+++ trunk/src/InfoOverlay.cs	Thu Jul  3 08:50:37 2008
@@ -35,7 +35,7 @@
 
 			if (p !=  null && q != null) {
 				p.DefaultVersionId  = version_id;
-				q.Commit (item.Index);
+				q.Commit (item.Index, true, false);
 			}
 		}
 	}

Modified: trunk/src/ItemAction.cs
==============================================================================
--- trunk/src/ItemAction.cs	(original)
+++ trunk/src/ItemAction.cs	Thu Jul  3 08:50:37 2008
@@ -179,7 +179,7 @@
 			PhotoQuery q = item.Collection as PhotoQuery;
 			if (photo != null && q != null) {
 				photo.DefaultVersionId = version;
-				q.Commit (item.Index);
+				q.Commit (item.Index, true, true);
 			} else {
 				item.Collection.MarkChanged (item.Index);
 			}

Modified: trunk/src/MainWindow.cs
==============================================================================
--- trunk/src/MainWindow.cs	(original)
+++ trunk/src/MainWindow.cs	Thu Jul  3 08:50:37 2008
@@ -827,10 +827,8 @@
 		RotateCommand command = new RotateCommand (parent);
 		
 		int [] selected_ids = SelectedIds ();
-		if (command.Execute (direction, SelectedPhotos (selected_ids))) {
-			foreach (int num in selected_ids)
-				query.MarkChanged (num);
-		}
+		if (command.Execute (direction, SelectedPhotos (selected_ids)))
+			query.MarkChanged (selected_ids, true, true);
 	}
 
 	//
@@ -846,7 +844,7 @@
 	{
 		foreach (int num in nums)
 			query.Photos [num].AddTag (tags);
-		query.Commit (nums);
+		query.Commit (nums, true, false);
 
 		foreach (Tag t in tags) {
 			if (t.Icon != null)
@@ -870,7 +868,7 @@
 	{
 		foreach (int num in nums)
 			query.Photos [num].RemoveTag (tags);
-		query.Commit (nums);
+		query.Commit (nums, true, false);
 	}
 
 	void HandleTagSelectionRowActivated (object sender, RowActivatedArgs args)
@@ -1006,7 +1004,7 @@
 				
 				// FIXME this should really follow the AddTagsExtended path too
 				photo.AddTag (new Tag[] {tag});
-				db.Photos.Commit (photo);
+				db.Photos.Commit (photo, true, false);
 			}
 			db.CommitTransaction ();
 			InvalidateViews ();
@@ -1497,11 +1495,12 @@
 
 		Photo p;
 		db.BeginTransaction ();
-		foreach (int num in SelectedIds ()) {
+		int [] selected_photos = SelectedIds ();
+		foreach (int num in selected_photos) {
 			p = query.Photos [num];
 			p.Rating = (uint) r;
-			query.Commit (num);
 		}
+		query.Commit (selected_photos, true, false);
 		db.CommitTransaction ();
 	}
 
@@ -1852,7 +1851,7 @@
 		PhotoVersionCommands.Create cmd = new PhotoVersionCommands.Create ();
 
 		if (cmd.Execute (db.Photos, CurrentPhoto, GetToplevel (null))) {
-			query.MarkChanged (ActiveIndex ());
+			query.MarkChanged (ActiveIndex (), true, false);
 		}
 	}
 
@@ -1861,7 +1860,7 @@
 		PhotoVersionCommands.Delete cmd = new PhotoVersionCommands.Delete ();
 
 		if (cmd.Execute (db.Photos, CurrentPhoto, GetToplevel (null))) {
-			query.MarkChanged (ActiveIndex ());
+			query.MarkChanged (ActiveIndex (), true, true);
 		}
 	}
 
@@ -1885,7 +1884,7 @@
 		PhotoVersionCommands.Rename cmd = new PhotoVersionCommands.Rename ();
 
 		if (cmd.Execute (db.Photos, CurrentPhoto, main_window)) {
-			query.MarkChanged (ActiveIndex ());
+			query.MarkChanged (ActiveIndex (), true, false);
 		}
 	}
 	
@@ -2466,7 +2465,7 @@
 		int [] selected_ids = SelectedIds ();
 		if (command.Execute (SelectedPhotos (selected_ids))) {
 			foreach (int num in selected_ids)
-				query.MarkChanged (num);
+				query.MarkChanged (num, false, true);
 		}
 	}
 
@@ -2694,7 +2693,7 @@
 		CurrentPhoto.DefaultVersionId = version_id;
 		int active = ActiveIndex ();
 		
-		query.Commit (active);
+		query.Commit (active, true, false);
 	}
 
 	void HandleVersionIdChanged (PhotoVersionMenu menu)
@@ -2992,7 +2991,7 @@
 					uint version = photo.CreateNamedVersion (mime_application.Name, photo.DefaultVersionId, true);
 					photo.DefaultVersionId = version;
 				}
-				query.MarkChanged (query.IndexOf (photo));
+				query.MarkChanged (query.IndexOf (photo), true, true);
 			} catch (Exception e) {
 				errors.Add (new EditException (photo, e));
 			}
@@ -3008,7 +3007,7 @@
 		}
 
 		if (create_new_versions) {
-			db.Photos.Commit (selected, new DbItemEventArgs (selected));
+			db.Photos.Commit (selected, true, false);
 		}
 
 		mime_application.Launch (uri_list);

Modified: trunk/src/PhotoImageView.cs
==============================================================================
--- trunk/src/PhotoImageView.cs	(original)
+++ trunk/src/PhotoImageView.cs	Thu Jul  3 08:50:37 2008
@@ -306,7 +306,6 @@
 
 		private void PhotoItemChanged (BrowsablePointer item, BrowsablePointerChangedArgs args) 
 		{
-			Log.Debug ("PhotoImageView::item changed");
 			// If it is just the position that changed fall out
 			if (args != null && 
 			    args.PreviousItem != null &&
@@ -315,6 +314,14 @@
 			    (this.Item.Current.DefaultVersionUri == args.PreviousItem.DefaultVersionUri))
 				return;
 
+			// Don't reload if the image didn't change at all.
+			if (!args.DataChanged &&
+			    args != null &&
+			    args.PreviousItem != null &&
+			    Item.IsValid &&
+			    this.Item.Current.DefaultVersionUri == args.PreviousItem.DefaultVersionUri)
+				return;
+
 			if (args != null &&
 			    args.PreviousItem != null && 
 			    Item.IsValid && 

Modified: trunk/src/PhotoQuery.cs
==============================================================================
--- trunk/src/PhotoQuery.cs	(original)
+++ trunk/src/PhotoQuery.cs	Thu Jul  3 08:50:37 2008
@@ -185,12 +185,17 @@
 			return System.Array.IndexOf (photos, photo);
 		}
 		
-		public void Commit (params int [] indexes)
+		public void Commit (int index, bool metadata_changed, bool data_changed)
+		{
+			Commit (new int [] {index}, metadata_changed, data_changed);
+		}
+
+		public void Commit (int [] indexes, bool metadata_changed, bool data_changed)
 		{
 			List<Photo> to_commit = new List<Photo>();
 			foreach (int index in indexes)
 				to_commit.Add (photos [index]);
-			store.Commit (to_commit.ToArray ());
+			store.Commit (to_commit.ToArray (), metadata_changed, data_changed);
 		}
 
 		private void MarkChanged (object sender, DbItemEventArgs args)
@@ -205,16 +210,34 @@
 					indexes.Add (index);
 			}
 
-			if (indexes.Count > 0) 
-				MarkChanged (indexes.ToArray ());
+			PhotoEventArgs photo_args = args as PhotoEventArgs;
+
+			if (indexes.Count > 0 && ItemsChanged != null)
+				ItemsChanged (this, new BrowsableEventArgs(indexes.ToArray (),
+							photo_args.MetadataChanged, photo_args.DataChanged));
+		}
+
+		public void MarkChanged (int index, bool metadata_changed, bool data_changed)
+		{
+			MarkChanged (new int [] {index}, metadata_changed, data_changed);
+		}
+
+		public void MarkChanged (int [] indexes, bool metadata_changed, bool data_changed)
+		{
+			List<Photo> to_emit = new List<Photo> ();
+			foreach (int index in indexes)
+				to_emit.Add (photos [index]);
+			store.EmitChanged (to_emit.ToArray (), metadata_changed, data_changed);
 		}
 
+		[Obsolete ("You should provide info on what changed!")]
 		public void MarkChanged (int index)
 		{
 			MarkChanged (new int [] {index});
 		}
 
-		public void MarkChanged (params int [] indexes)
+		[Obsolete ("You should provide info on what changed!")]
+		private void MarkChanged (params int [] indexes)
 		{
 			ItemsChanged (this, new BrowsableEventArgs (indexes));
 		}

Modified: trunk/src/PhotoStore.cs
==============================================================================
--- trunk/src/PhotoStore.cs	(original)
+++ trunk/src/PhotoStore.cs	Thu Jul  3 08:50:37 2008
@@ -29,6 +29,29 @@
 
 using Banshee.Database;
 
+public class PhotoEventArgs : DbItemEventArgs {
+	private readonly bool metadata_changed;
+	public bool MetadataChanged {
+		get { return metadata_changed; }
+	}
+
+	private readonly bool data_changed;
+	public bool DataChanged {
+		get { return data_changed; }
+	}
+
+	public PhotoEventArgs (Photo photo, bool metadata_changed, bool data_changed)
+		: this (new Photo [] { photo }, metadata_changed, data_changed)
+	{
+	}
+
+	public PhotoEventArgs (Photo [] items, bool metadata_changed, bool data_changed)
+		: base (items)
+	{
+		this.metadata_changed = metadata_changed;
+		this.data_changed = data_changed;
+	}
+}
 
 public class PhotoStore : DbStore {
 	public int TotalPhotos {
@@ -365,7 +388,7 @@
 
 		foreach (Photo photo in photos) {
 			photo.RemoveCategory (tags);
-			Commit (photo);
+			Commit (photo, true, false);
 		}
 		
 		foreach (Tag tag in tags)
@@ -395,19 +418,25 @@
 		Remove (new Photo [] { (Photo)item });
 	}
 
+// Marking this obsolete causes a warning: Obsolete member `PhotoStore.Commit(FSpot.DbItem)' overrides non-obsolete member `DbStore.Commit(FSpot.DbItem)'.
+//	[Obsolete("WARNING! You should not use this one for photos, the events are not specific enough")]
 	public override void Commit (DbItem item)
 	{
-		DbItemEventArgs args = new DbItemEventArgs (item);
-		Commit (args.Items, args);
+		Log.Warning ("You should not use PhotoStore.Commit(DbItem) for photos, the events are not specific enough");
+		Commit (item as Photo, true, true);
+	}
+
+	public void Commit (Photo photo, bool metadata_changed, bool data_changed)
+	{
+		Commit (new Photo [] { photo }, metadata_changed, data_changed);
 	}
 
-	public void Commit (Photo [] items)
+	public void Commit (Photo [] items, bool metadata_changed, bool data_changed)
 	{
-		DbItemEventArgs args = new DbItemEventArgs (items);
-		Commit (args.Items, args);
+		Commit (items, new PhotoEventArgs (items, metadata_changed, data_changed));
 	}
 
-	public void Commit (DbItem [] items, DbItemEventArgs args)
+	public void Commit (Photo [] items, PhotoEventArgs args)
 	{
 		// Only use a transaction for multiple saves. Avoids recursive transactions.
 		bool use_transactions = !Database.InTransaction && items.Length > 1;
@@ -417,16 +446,25 @@
 
 		foreach (DbItem item in items)
 			Update ((Photo)item);
-		
+
 		if (use_transactions)
 			Database.CommitTransaction ();
 
 		EmitChanged (items, args);
 	}
+
+	public void EmitChanged (Photo photo, bool metadata_changed, bool data_changed)
+	{
+		EmitChanged (new Photo [] { photo }, metadata_changed, data_changed);
+	}
+
+	public void EmitChanged (Photo [] items, bool metadata_changed, bool data_changed)
+	{
+		EmitChanged (items, new PhotoEventArgs (items, metadata_changed, data_changed));
+	}
 	
 	private void Update (Photo photo) {
 		// Update photo.
-
 		Database.ExecuteNonQuery (new DbCommand (
 			"UPDATE photos SET description = :description, " + 
 			"default_version_id = :default_version_id, " + 

Modified: trunk/src/PhotoVersionCommands.cs
==============================================================================
--- trunk/src/PhotoVersionCommands.cs	(original)
+++ trunk/src/PhotoVersionCommands.cs	Thu Jul  3 08:50:37 2008
@@ -104,7 +104,7 @@
 
 			try {
 				photo.DefaultVersionId = photo.CreateVersion (name, photo.DefaultVersionId, true);
-				store.Commit (photo);
+				store.Commit (photo, true, false);
 			} catch (Exception e) {
 					string msg = Catalog.GetString ("Could not create a new version");
 					string desc = String.Format (Catalog.GetString ("Received exception \"{0}\". Unable to create version \"{1}\""),
@@ -147,7 +147,7 @@
 			if (dialog.Run () == (int) ResponseType.Ok) {
 				try {
 					photo.DeleteVersion (photo.DefaultVersionId);
-					store.Commit (photo);
+					store.Commit (photo, true, true);
 				} catch (Exception e) {
 					// FIXME show error dialog.
 					string msg = Catalog.GetString ("Could not delete a version");
@@ -190,7 +190,7 @@
 
 			try {
 				photo.RenameVersion (photo.DefaultVersionId, new_name);
-				store.Commit (photo);
+				store.Commit (photo, true, false);
 			} catch (Exception e) {
 					string msg = Catalog.GetString ("Could not rename a version");
 					string desc = String.Format (Catalog.GetString ("Received exception \"{0}\". Unable to rename version to \"{1}\""),
@@ -218,7 +218,7 @@
 				foreach (uint version_id in photo.VersionIds) {
 					try {
 						new_parent.DefaultVersionId = new_parent.CreateReparentedVersion (photo.GetVersion (version_id) as PhotoVersion);
-						store.Commit (new_parent);
+						store.Commit (new_parent, true, false);
 					} catch (Exception e) {
 						Console.WriteLine (e);	
 					}
@@ -232,7 +232,7 @@
 						Console.WriteLine(e);
 					}
 				}
-				store.Commit (photo);
+				store.Commit (photo, true, false);
 				MainWindow.Toplevel.Database.Photos.Remove (photo);
 			}
 			return true;

Modified: trunk/src/PhotoView.cs
==============================================================================
--- trunk/src/PhotoView.cs	(original)
+++ trunk/src/PhotoView.cs	Thu Jul  3 08:50:37 2008
@@ -279,7 +279,7 @@
 				FSpot.SepiaTone sepia = new FSpot.SepiaTone (photo);
 				sepia.Image = View.CompletePixbuf ();
 				sepia.Adjust ();
-				Core.Database.Photos.Commit (photo);
+				Core.Database.Photos.Commit (photo, true, true);
 			} catch (System.Exception e) {
 				ShowError (e, photo); 
 			}
@@ -293,7 +293,7 @@
 				FSpot.Desaturate desaturate = new FSpot.Desaturate (photo);
 				desaturate.Image = View.CompletePixbuf ();
 				desaturate.Adjust ();
-				Core.Database.Photos.Commit (photo);
+				Core.Database.Photos.Commit (photo, true, true);
 			} catch (System.Exception e) {
 				ShowError (e, photo);
 			}
@@ -341,7 +341,7 @@
 				
 				bool create_version = photo.DefaultVersion.IsProtected;
 				photo.SaveVersion (edited, create_version);
-				((PhotoQuery)query).Commit (Item.Index);
+				((PhotoQuery)query).Commit (Item.Index, true, true);
 	
 				// FIXME the fact that the selection doesn't go away is a bug in ImageView, it should
 				// be fixed there.
@@ -368,7 +368,7 @@
 		{
 			if (commit_delay.IsPending) {
 				commit_delay.Stop ();
-				((PhotoQuery)query).Commit (changed_photo);
+				((PhotoQuery)query).Commit (changed_photo, true, false);
 			}
 			return true;
 		}

Modified: trunk/src/TimeDialog.cs
==============================================================================
--- trunk/src/TimeDialog.cs	(original)
+++ trunk/src/TimeDialog.cs	Thu Jul  3 08:50:37 2008
@@ -7,10 +7,11 @@
 using FSpot.UI.Dialog;
 
 namespace FSpot {
-	public class TimeChangedEventArgs : DbItemEventArgs {
+	public class TimeChangedEventArgs : PhotoEventArgs {
 		TimeSpan span;
 
-		public TimeChangedEventArgs (DbItem [] items, TimeSpan span) : base (items)
+		public TimeChangedEventArgs (Photo [] items, TimeSpan span)
+			: base (items, true, false)
 		{
 			this.span = span;
 		}

Modified: trunk/src/UI.Dialog/ColorDialog.cs
==============================================================================
--- trunk/src/UI.Dialog/ColorDialog.cs	(original)
+++ trunk/src/UI.Dialog/ColorDialog.cs	Thu Jul  3 08:50:37 2008
@@ -205,7 +205,7 @@
 							 transform);
 				
 				photo.SaveVersion (final, create_version);
-				((PhotoQuery)view.Query).Commit (view.Item.Index);
+				((PhotoQuery)view.Query).Commit (view.Item.Index, true, true);
 				final.Dispose ();
 			} catch (System.Exception e) {
 				string msg = Catalog.GetString ("Error saving adjusted photo");

Modified: trunk/src/Widgets/Filmstrip.cs
==============================================================================
--- trunk/src/Widgets/Filmstrip.cs	(original)
+++ trunk/src/Widgets/Filmstrip.cs	Thu Jul  3 08:50:37 2008
@@ -478,7 +478,10 @@
 		{
 			//FIXME: need to be smarter here...
 
-			//invalidate the thumbs cache
+			if (!args.DataChanged)
+				return;
+
+			// Invalidate the thumbs cache
 			thumb_cache.Dispose ();
 			thumb_cache = new DisposableCache<string, Pixbuf> (30);
 			QueueDraw ();

Modified: trunk/src/Widgets/IconView.cs
==============================================================================
--- trunk/src/Widgets/IconView.cs	(original)
+++ trunk/src/Widgets/IconView.cs	Thu Jul  3 08:50:37 2008
@@ -258,7 +258,8 @@
 		private void HandleItemsChanged (FSpot.IBrowsableCollection sender, BrowsableEventArgs args)
 		{
 			foreach (int item in args.Items) {
-				UpdateThumbnail (item);
+				if (args.DataChanged)
+					UpdateThumbnail (item);
 				InvalidateCell (item);
 			}
 		}
@@ -351,7 +352,8 @@
 				if (local_ids.Count == 0)
 					return;
 
-				ItemsChanged (this, new BrowsableEventArgs ((int [])local_ids.ToArray (typeof (int))));
+				int [] items = (int [])local_ids.ToArray (typeof (int));
+				ItemsChanged (this, new BrowsableEventArgs (items, args.MetadataChanged, args.DataChanged));
 			}
 
 			public int [] Ids {
@@ -1427,7 +1429,7 @@
 				| ModifierType.ShiftMask)) != 0)
 				return;
 				if (DoubleClicked != null)
-					DoubleClicked (this, new BrowsableEventArgs (cell_num));
+					DoubleClicked (this, new BrowsableEventArgs (cell_num, false, false));
 				return;
 
 			case EventType.ButtonPress:
@@ -1544,7 +1546,7 @@
 			case Gdk.Key.Return:
 				if (DoubleClicked == null)
 					break;
-				DoubleClicked (this, new BrowsableEventArgs (FocusCell));
+				DoubleClicked (this, new BrowsableEventArgs (FocusCell, false, false));
 				break;
 			default:
 				args.RetVal = false;

Modified: trunk/src/Widgets/MetadataDisplay.cs
==============================================================================
--- trunk/src/Widgets/MetadataDisplay.cs	(original)
+++ trunk/src/Widgets/MetadataDisplay.cs	Thu Jul  3 08:50:37 2008
@@ -156,6 +156,9 @@
 		}
 		
 		internal void HandleSelectionItemsChanged (IBrowsableCollection collection, BrowsableEventArgs args) {
+			if (!args.MetadataChanged)
+				return;
+
 			if (!Page.IsActive)
 				up_to_date = false;
 			else



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