[f-spot] Kill Gnome.VFS. GIO is the new king.



commit 8aefa1c8a8c1f19841e9402a11d037c8a89756bb
Author: Ruben Vermeersch <ruben savanne be>
Date:   Sat May 15 17:02:50 2010 +0200

    Kill Gnome.VFS. GIO is the new king.
    
    Also drop some duplicate thumbnail generation bits from the importer.

 configure.ac                                 |    2 +-
 extensions/Services/DBusService/DBusProxy.cs |    4 +-
 extensions/Tools/MergeDb/MergeDb.cs          |    5 +-
 src/FileImportBackend.cs                     |   54 +-------------
 src/ImportCommand.cs                         |  101 +++++---------------------
 src/Makefile.am                              |    4 +-
 src/PhotoStore.cs                            |   53 +++-----------
 src/Utils/GtkUtil.cs                         |   14 ++++
 src/main.cs                                  |    5 +-
 tests/src/PhotoStore.cs                      |   10 +--
 10 files changed, 57 insertions(+), 195 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 8bdacfa..4432aa5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -151,7 +151,7 @@ LCMS_REQUIRED=1.12
 LIBGPHOTO2_REQUIRED=2.4
 MONOADDINS_REQUIRED=0.3
 
-PKG_CHECK_MODULES(F, libgnome-2.0 >= $LIBGNOME_REQUIRED libgnomeui-2.0 >= $LIBGNOMEUI_REQUIRED libexif >= $LIBEXIF_REQUIRED_MIN libexif < $LIBEXIF_REQUIRED_MAX gtk-sharp-2.0 >= $GTKSHARP_REQUIRED glib-sharp-2.0 >= $GTKSHARP_REQUIRED glade-sharp-2.0 >= $GTKSHARP_REQUIRED gnome-vfs-sharp-2.0 >= $GTKSHARP_REQUIRED gtk+-2.0 >= $GTK_REQUIRED mono-cairo >= $MONO_CAIRO_REQUIRED cairo >= $CAIRO_REQUIRED mono-addins >= $MONOADDINS_REQUIRED mono-addins-gui >= $MONOADDINS_REQUIRED mono-addins-setup >= $MONOADDINS_REQUIRED)
+PKG_CHECK_MODULES(F, libgnome-2.0 >= $LIBGNOME_REQUIRED libgnomeui-2.0 >= $LIBGNOMEUI_REQUIRED libexif >= $LIBEXIF_REQUIRED_MIN libexif < $LIBEXIF_REQUIRED_MAX gtk-sharp-2.0 >= $GTKSHARP_REQUIRED glib-sharp-2.0 >= $GTKSHARP_REQUIRED glade-sharp-2.0 >= $GTKSHARP_REQUIRED gtk+-2.0 >= $GTK_REQUIRED mono-cairo >= $MONO_CAIRO_REQUIRED cairo >= $CAIRO_REQUIRED mono-addins >= $MONOADDINS_REQUIRED mono-addins-gui >= $MONOADDINS_REQUIRED mono-addins-setup >= $MONOADDINS_REQUIRED)
 AC_SUBST(F_CFLAGS)
 AC_SUBST(F_LIBS)
 
diff --git a/extensions/Services/DBusService/DBusProxy.cs b/extensions/Services/DBusService/DBusProxy.cs
index d8036c0..75806ac 100644
--- a/extensions/Services/DBusService/DBusProxy.cs
+++ b/extensions/Services/DBusService/DBusProxy.cs
@@ -413,8 +413,6 @@ namespace DBusService {
 			// add tags that exist in tag store
 			List<Tag> tag_list = GetTagsByNames (tags);
 
-			Gdk.Pixbuf pixbuf = null;
-
 			// FIXME: this is more or less a copy of the file import backend code
 			// this should be streamlined
 			try {
@@ -426,7 +424,7 @@ namespace DBusService {
 				if (new_path != path)
 					System.IO.File.Copy (path, new_path);
 
-				Photo created = db.Photos.CreateOverDBus (new_path, path, current_roll.Id, out pixbuf);
+				Photo created = db.Photos.CreateOverDBus (new_path, path, current_roll.Id);
 
 				try {
 					File.SetAttributes (new_path, File.GetAttributes (new_path) & ~FileAttributes.ReadOnly);
diff --git a/extensions/Tools/MergeDb/MergeDb.cs b/extensions/Tools/MergeDb/MergeDb.cs
index 043885e..50b90bf 100644
--- a/extensions/Tools/MergeDb/MergeDb.cs
+++ b/extensions/Tools/MergeDb/MergeDb.cs
@@ -229,7 +229,6 @@ namespace MergeDbExtension
 			}
 
 			string destination;
-			Gdk.Pixbuf pixbuf;
 			Photo newp;
 
 			if (copy)
@@ -239,11 +238,11 @@ namespace MergeDbExtension
 
 			// Don't copy if we are already home
 			if (photo_path == destination)
-				newp = to_store.Create (UriUtils.PathToFileUri (destination), roll_map [photo.RollId], out pixbuf);
+				newp = to_store.Create (UriUtils.PathToFileUri (destination), roll_map [photo.RollId]);
 			else {
 				System.IO.File.Copy (photo_path, destination);
 
-				newp = to_store.Create (UriUtils.PathToFileUri (destination), UriUtils.PathToFileUri (photo_path), roll_map [photo.RollId], out pixbuf);
+				newp = to_store.Create (UriUtils.PathToFileUri (destination), UriUtils.PathToFileUri (photo_path), roll_map [photo.RollId]);
 				try {
 					File.SetAttributes (destination, File.GetAttributes (destination) & ~FileAttributes.ReadOnly);
 					DateTime create = File.GetCreationTime (photo_path);
diff --git a/src/FileImportBackend.cs b/src/FileImportBackend.cs
index 5c3a04e..b737975 100644
--- a/src/FileImportBackend.cs
+++ b/src/FileImportBackend.cs
@@ -222,7 +222,7 @@ public class FileImportBackend : ImportBackend {
 					photo = store.CheckForDuplicate (UriUtils.PathToFileUri (destination));
 
 				if (photo == null)
-					photo = store.Create (UriUtils.PathToFileUri (info.DestinationPath), roll.Id, out thumbnail);
+					photo = store.Create (UriUtils.PathToFileUri (info.DestinationPath), roll.Id);
 				else
 				 	is_duplicate = true;
 			} else {
@@ -237,8 +237,7 @@ public class FileImportBackend : ImportBackend {
 				{
 					photo = store.Create (UriUtils.PathToFileUri (info.DestinationPath),
 					                      UriUtils.PathToFileUri (info.OriginalPath),
-					                      roll.Id,
-					                      out thumbnail);
+					                      roll.Id);
 				 	
 
 					try {
@@ -276,10 +275,6 @@ public class FileImportBackend : ImportBackend {
 			}
 		} catch (System.Exception e) {
 			System.Console.WriteLine ("Error importing {0}{2}{1}", info.OriginalPath, e.ToString (), Environment.NewLine);
-			if (thumbnail != null)
-				thumbnail.Dispose ();
-
-			thumbnail = null;
 			photo = null;
 
 			HigMessageDialog errordialog = new HigMessageDialog (parent,
@@ -300,7 +295,7 @@ public class FileImportBackend : ImportBackend {
 		if (is_duplicate)
 		 	this.duplicate_count ++;
 
-		status_info = new StepStatusInfo (photo, thumbnail, this.count, is_duplicate);
+		status_info = new StepStatusInfo (photo, this.count, is_duplicate);
 
 		return (!abort && count != import_info.Count);
 	}
@@ -379,47 +374,4 @@ public class FileImportBackend : ImportBackend {
 		this.tags = tags;
 		this.parent = parent;
 	}
-
-#if TEST_FILE_IMPORT_BACKEND
-
-	public static void Main (string [] args)
-	{
-		Program program = new Program ("FileImportTest", "0.0", Modules.UI, args);
-
-		const string path = "/tmp/FileImportTest.db";
-
-		try {
-			File.Delete (path);
-		} catch {}
-
-		Db db = new Db (path, true);
-
-		FileImportBackend import = new FileImportBackend (db.Photos, args [0],true, this);
-
-		Console.WriteLine ("Preparing...");
-
-		int total_count = import.Prepare();
-		if (total_count == 0)
-			Console.WriteLine ("(No pictures)");
-
-		Console.WriteLine ("Prepared: {0} picture(s)", total_count);
-
-		bool ongoing;
-		do {
-			Photo photo;
-			Pixbuf thumbnail;
-			int count;
-
-			ongoing = import.Step (out photo, out thumbnail, out count);
-
-			Console.WriteLine ("{0}/{1} - {2}", count, total_count, photo.Path);
-
-			if (thumbnail != null)
-				thumbnail.Dispose ();
-		} while (ongoing);
-
-		import.Finish ();
-	}
-
-#endif
 }
diff --git a/src/ImportCommand.cs b/src/ImportCommand.cs
index dd903c8..6df8822 100644
--- a/src/ImportCommand.cs
+++ b/src/ImportCommand.cs
@@ -80,26 +80,24 @@ public class ImportCommand : GladeDialog
 		protected VfsSource () {}
 	}
 
-	internal class VolumeSource : VfsSource
+	internal class MountSource : VfsSource
 	{
-		public Gnome.Vfs.Volume Volume;
+		public GLib.Mount Mount;
 		public string mount_point;
 
-		public VolumeSource (Gnome.Vfs.Volume vol)
+		public MountSource (GLib.Mount mount)
 		{
-			this.Volume = vol;
-			this.Name = vol.DisplayName;
+			this.Mount = mount;
+			this.Name = mount.Name;
 
 			try {
-				mount_point = new Uri (vol.ActivationUri).LocalPath;
+				mount_point = mount.Root.Uri.LocalPath;
 			} catch (System.Exception e) {
 				System.Console.WriteLine (e);
 			}
 
 			uri = mount_point;
 			
-                        if (this.Icon == null)
-				this.Icon = GtkUtil.TryLoadIcon (FSpot.Global.IconTheme, vol.Icon, 32, (Gtk.IconLookupFlags)0);
 			
 			if (this.IsIPodPhoto)
 				this.Icon = GtkUtil.TryLoadIcon (FSpot.Global.IconTheme, "multimedia-player", 32, (Gtk.IconLookupFlags)0);
@@ -107,11 +105,13 @@ public class ImportCommand : GladeDialog
 			if (this.Icon == null && this.IsCamera)
 				this.Icon = GtkUtil.TryLoadIcon (FSpot.Global.IconTheme, "media-flash", 32, (Gtk.IconLookupFlags)0);
 
-			try {
-				if (this.Icon == null)
-					this.Icon = new Gdk.Pixbuf (vol.Icon);
-			} catch (System.Exception e) {
-				System.Console.WriteLine (e.ToString ());
+			if (this.Icon == null) {
+				if (mount.Icon is GLib.ThemedIcon) {
+					this.Icon = GtkUtil.TryLoadIcon (FSpot.Global.IconTheme, (mount.Icon as GLib.ThemedIcon).Names, 32, (Gtk.IconLookupFlags)0);
+				} else {
+					// TODO
+					throw new Exception ("Unloadable icon type");
+				}
 			}
 		}
 
@@ -127,10 +127,6 @@ public class ImportCommand : GladeDialog
 
 		private bool IsIPodPhoto {
 			get {
-				if (Volume.DeviceType != Gnome.Vfs.DeviceType.MusicPlayer 
-				    && Volume.DeviceType != Gnome.Vfs.DeviceType.Apple)
-					return false;
-
 				try {
 					return (Directory.Exists (Path.Combine (mount_point, "Photos")) &&
 						Directory.Exists (Path.Combine (mount_point, "iPod_Control")));
@@ -141,24 +137,6 @@ public class ImportCommand : GladeDialog
 		}
 	}
 
-	internal class DriveSource : ImportSource
-	{
-		public Gnome.Vfs.Drive Drive;
-		
-		public DriveSource (Gnome.Vfs.Drive drive) 
-		{
-			this.Name = drive.DisplayName;
-			this.Drive = drive;
-
-			if (drive.IsMounted) {
-				this.Icon = GtkUtil.TryLoadIcon (FSpot.Global.IconTheme, drive.MountedVolume.Icon, 32, (Gtk.IconLookupFlags)0);
-				//this.Sensitive = drive.MountedVolume.IsMounted;
-			} else {
-				this.Icon = GtkUtil.TryLoadIcon (FSpot.Global.IconTheme, drive.Icon, 32, (Gtk.IconLookupFlags)0);
-			}
-		}
-	}
-
 	internal class CameraSource : ImportSource
 	{
 		GPhotoCamera cam;
@@ -196,7 +174,7 @@ public class ImportCommand : GladeDialog
 		public int source_count;
 		ImportCommand command;
 
-		private static Gnome.Vfs.VolumeMonitor monitor = Gnome.Vfs.VolumeMonitor.Get ();
+		private static GLib.VolumeMonitor monitor = GLib.VolumeMonitor.Default;
 
 		public SourceMenu (ImportCommand command) {
 			this.command = command;
@@ -208,28 +186,12 @@ public class ImportCommand : GladeDialog
 			this.Append (new Gtk.SeparatorMenuItem ());
 
 			// Add external hard drives to the menu
-			foreach (Gnome.Vfs.Volume vol in monitor.MountedVolumes) {
-				 if (!vol.IsUserVisible || vol.DeviceType == Gnome.Vfs.DeviceType.Unknown)
-					 continue;
-				
-				 System.Console.WriteLine ("{0} - {1} - {2} {3} {4} {5} {6}",
-							  vol.DisplayName, 
-							  vol.Icon, 
-							  vol.VolumeType.ToString (), 
-							  vol.ActivationUri, 
-							  vol.IsUserVisible,
-							  vol.IsMounted,
-							  vol.DeviceType);
-				 
-				 if (vol.Drive != null)
-					 System.Console.WriteLine (vol.Drive.DeviceType.ToString ());
-
-				 ImportSource source = new VolumeSource (vol);
+			foreach (GLib.Mount mount in monitor.Mounts) {
+				 ImportSource source = new MountSource (mount);
 				 item = new SourceItem (source);
 				 item.Activated += HandleActivated;
 				 this.Append (item);
 				 source_count++;
-
 			}
 
 
@@ -263,17 +225,6 @@ public class ImportCommand : GladeDialog
 				item.Sensitive = false;
 				this.Append (item);
 			}
-			/*
-			this.Append (new Gtk.SeparatorMenuItem ());
-			
-			foreach (Gnome.Vfs.Drive drive in monitor.ConnectedDrives) {
-				ImportSource source = new DriveSource (drive);
-				
-				Gtk.ImageMenuItem item = new SourceItem (source);
-				item.Sensitive = drive.IsMounted;
-				this.Append (item);
-			}
-			*/
 
 			this.ShowAll ();
 		}
@@ -446,18 +397,14 @@ public class ImportCommand : GladeDialog
 			return false;
 		}
 
-		if (!status_info.IsDuplicate && (status_info.Photo == null || status_info.Thumbnail == null)) {
+		if (!status_info.IsDuplicate && (status_info.Photo == null)) {
 			Console.WriteLine ("Could not import file");
 		} else {
 			//icon_scrolled.Visible = true;
 		 	if (!status_info.IsDuplicate)
 				collection.Add (status_info.Photo);
-			//grid.AddThumbnail (thumbnail);
 
 		}
-
-		if (status_info.Thumbnail != null)
-			status_info.Thumbnail.Dispose ();
 		
 		if (status_info.Count < total)
 			UpdateProgressBar (status_info.Count + 1, total);
@@ -869,7 +816,6 @@ public class ImportCommand : GladeDialog
 
 public class StepStatusInfo {
 	private Photo photo;
-	private Pixbuf thumbnail;
 	private int count;
 	private bool is_duplicate;
 
@@ -879,12 +825,6 @@ public class StepStatusInfo {
 		} 
 	}
 
-	public Pixbuf Thumbnail {
-		get {
-			return thumbnail; 
-		} 
-	}
-
 	public int Count {
 		get {
 			return count; 
@@ -897,16 +837,15 @@ public class StepStatusInfo {
 		} 
 	}
 
-	public StepStatusInfo (Photo photo, Pixbuf thumbnail, int count, bool is_duplicate)
+	public StepStatusInfo (Photo photo, int count, bool is_duplicate)
 	{
 		this.photo = photo;
-		this.thumbnail = thumbnail;
 		this.count = count;
 		this.is_duplicate = is_duplicate;
 	}
  
-	public StepStatusInfo (Photo photo, Pixbuf thumbnail, int count)
-		: this (photo, thumbnail, count, false)
+	public StepStatusInfo (Photo photo, int count)
+		: this (photo, count, false)
 	{ }
 }
 
diff --git a/src/Makefile.am b/src/Makefile.am
index 7a3bbe0..ba9ed53 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -327,7 +327,6 @@ CMS_ASSEMBLIES = 				\
 
 CORE_ASSEMBLIES =				\
 	-pkg:gtk-sharp-2.0			\
-	-pkg:gnome-vfs-sharp-2.0		\
 	-r:Cms.dll				\
 	-r:Mono.Posix				\
 	-r:FSpot.Utils.dll
@@ -408,8 +407,7 @@ F_SPOT_ASSEMBLIES = 				\
 	-pkg:mono-addins-setup			\
 	-pkg:mono-addins-gui			\
 	-pkg:glade-sharp-2.0			\
-	-pkg:gnome-sharp-2.0			\
-	-pkg:gnome-vfs-sharp-2.0
+	-pkg:gnome-sharp-2.0
 
 F_SPOT_DISTRESOURCES =					\
 	$(srcdir)/dces.rdf				\
diff --git a/src/PhotoStore.cs b/src/PhotoStore.cs
index 550a5f3..e7bdb98 100644
--- a/src/PhotoStore.cs
+++ b/src/PhotoStore.cs
@@ -52,39 +52,6 @@ public class PhotoStore : DbStore<Photo> {
 			System.IO.Directory.CreateDirectory (large_thumbnail_directory_path);
 	}
 
-	//
-	// Generates the thumbnail, returns the Pixbuf, and also stores it as a side effect
-	//
-
-	private static Pixbuf GenerateThumbnail (System.Uri uri)
-	{
-		using (FSpot.ImageFile img = FSpot.ImageFile.Create (uri)) {
-			return GenerateThumbnail (uri, img);
-		}
-	}
-
-	private static Pixbuf GenerateThumbnail (System.Uri uri, ImageFile img)
-	{
-		Pixbuf thumbnail = null;
-
-		if (img is FSpot.IThumbnailContainer) {
-			try {
-				thumbnail = ((FSpot.IThumbnailContainer)img).GetEmbeddedThumbnail ();
-			} catch (Exception e) {
-				Log.Debug ("Exception while loading embedded thumbail {0}", e.ToString ());
-			}
-		}
-
-		// Save embedded thumbnails in a silightly invalid way so that we know to regnerate them later.
-		if (thumbnail != null)
-			//FIXME with gio, set it to uri time minus a few sec
-			ThumbnailFactory.SaveThumbnail (thumbnail, uri, new DateTime (1980, 1, 1));
-		 else
-			thumbnail = FSpot.ThumbnailGenerator.Create (uri);
-		
-		return thumbnail;
-	}
-
 	// Constructor
 
 	public PhotoStore (QueuedSqliteDatabase database, bool is_new)
@@ -140,16 +107,18 @@ public class PhotoStore : DbStore<Photo> {
 		 	return found;
 
 		string md5 = Photo.GenerateMD5 (uri);			
-		Gnome.Vfs.FileInfo info = new Gnome.Vfs.FileInfo (uri.ToString (), Gnome.Vfs.FileInfoOptions.GetMimeType);
+		var file = GLib.FileFactory.NewForUri (uri);
+		var info = file.QueryInfo ("standard::content-type", GLib.FileQueryInfoFlags.None, null);
 
 		Photo[] md5_matches = GetByMD5 (md5);
 
 		foreach (Photo match in md5_matches)
 		{
-			Gnome.Vfs.FileInfo match_info = new Gnome.Vfs.FileInfo (match.DefaultVersionUri.ToString (), Gnome.Vfs.FileInfoOptions.GetMimeType);
+			var file2 = GLib.FileFactory.NewForUri (match.DefaultVersionUri);
+			var info2 = file.QueryInfo ("standard::content-type", GLib.FileQueryInfoFlags.None, null);
 
 			// same mimetype?
-			if (info.MimeType != match_info.MimeType)
+			if (info.ContentType != info2.ContentType)
 			 	continue;
 
 			// other comparisons?
@@ -162,12 +131,12 @@ public class PhotoStore : DbStore<Photo> {
 		return null;
 	}
 
-	public Photo Create (System.Uri uri, uint roll_id, out Pixbuf thumbnail)
+	public Photo Create (System.Uri uri, uint roll_id)
 	{
-		return Create (uri, uri, roll_id, out thumbnail);
+		return Create (uri, uri, roll_id);
 	}
 
-	public Photo Create (System.Uri new_uri, System.Uri orig_uri, uint roll_id, out Pixbuf thumbnail)
+	public Photo Create (System.Uri new_uri, System.Uri orig_uri, uint roll_id)
 	{
 		Photo photo;
 		using (FSpot.ImageFile img = FSpot.ImageFile.Create (orig_uri)) {
@@ -193,8 +162,6 @@ public class PhotoStore : DbStore<Photo> {
 			photo = new Photo (id, unix_time, new_uri, md5_sum);
 			AddToCache (photo);
 			photo.Loaded = true;
-	
-			thumbnail = GenerateThumbnail (new_uri, img);		
 			EmitAdded (photo);
 		}
 		return photo;
@@ -613,8 +580,8 @@ public class PhotoStore : DbStore<Photo> {
 	public event EventHandler<DbItemEventArgs<Photo>> ItemsAddedOverDBus;
 	public event EventHandler<DbItemEventArgs<Photo>> ItemsRemovedOverDBus;
 
-	public Photo CreateOverDBus (string new_path, string orig_path, uint roll_id, out Gdk.Pixbuf pixbuf)  {
-		Photo photo = Create (UriUtils.PathToFileUri (new_path), UriUtils.PathToFileUri (orig_path), roll_id, out pixbuf);
+	public Photo CreateOverDBus (string new_path, string orig_path, uint roll_id)  {
+		Photo photo = Create (UriUtils.PathToFileUri (new_path), UriUtils.PathToFileUri (orig_path), roll_id);
 		EmitAddedOverDBus (photo);
 
 		return photo;
diff --git a/src/Utils/GtkUtil.cs b/src/Utils/GtkUtil.cs
index b1ba369..9c9ff8c 100644
--- a/src/Utils/GtkUtil.cs
+++ b/src/Utils/GtkUtil.cs
@@ -83,6 +83,20 @@ namespace FSpot.Utils
 			button.UseUnderline = true;
 			return button;
 		}
+
+		public static Gdk.Pixbuf TryLoadIcon (Gtk.IconTheme theme, string[] names, int size, Gtk.IconLookupFlags flags)
+		{
+			try {
+				var info = theme.ChooseIcon (names, size, flags);
+				return info.LoadIcon ();
+			} catch {
+				try {
+					return theme.LoadIcon ("gtk-missing-image", size, flags);
+				} catch {
+					return null;
+				}
+			}	
+		}
 	
 		public static Gdk.Pixbuf TryLoadIcon (Gtk.IconTheme theme, string icon_name, int size, Gtk.IconLookupFlags flags)
 		{
diff --git a/src/main.cs b/src/main.cs
index 2b02ede..8dc10d2 100644
--- a/src/main.cs
+++ b/src/main.cs
@@ -175,7 +175,7 @@ namespace FSpot
 				return 1;
 			}
 
-			//Initialize Mono.Addins
+			// Initialize Mono.Addins
 			uint timer = Log.InformationTimerStart ("Initializing Mono.Addins");
 			AddinManager.Initialize (FSpot.Global.BaseDirectory);
 			AddinManager.Registry.Update (null);
@@ -190,9 +190,8 @@ namespace FSpot
 			Log.DebugTimerPrint (timer, "Mono.Addins Initialization took {0}");
 
 
-			//Gtk initialization
+			// Gtk initialization
 			Gtk.Application.Init (Defines.PACKAGE, ref args);
-			Gnome.Vfs.Vfs.Initialize ();
 
 			// init web proxy globally
 			Platform.WebProxy.Init ();
diff --git a/tests/src/PhotoStore.cs b/tests/src/PhotoStore.cs
index f60c87d..7291d3f 100644
--- a/tests/src/PhotoStore.cs
+++ b/tests/src/PhotoStore.cs
@@ -103,16 +103,13 @@ namespace FSpot.Tests
 			//uint landscapes_tag_id = landscapes_tag.Id;
 			//uint favorites_tag_id = favorites_tag.Id;
 	
-			Pixbuf unused_thumbnail;
-	
-			Photo ny_landscape = db.Photos.Create (UriUtils.PathToFileUri ("../images/pano.jpg"), 0, out unused_thumbnail);
+			Photo ny_landscape = db.Photos.Create (UriUtils.PathToFileUri ("../images/pano.jpg"), 0);
 			ny_landscape.Description = "Snowy landscape";
 			ny_landscape.AddTag (landscapes_tag);
 			ny_landscape.AddTag (favorites_tag);
 			db.Photos.Commit (ny_landscape);
 	
-//			Photo me_in_sf = db.Photos.Create (DateTime.Now.ToUniversalTime (), 2, "/home/ettore/Photos/me_in_sf.jpg",
-//							   out unused_thumbnail);
+//			Photo me_in_sf = db.Photos.Create (DateTime.Now.ToUniversalTime (), 2, "/home/ettore/Photos/me_in_sf.jpg");
 //			me_in_sf.AddTag (landscapes_tag);
 //			me_in_sf.AddTag (portraits_tag);
 //			me_in_sf.AddTag (favorites_tag);
@@ -124,8 +121,7 @@ namespace FSpot.Tests
 //			me_in_sf.CreateVersion ("UM-ed", Photo.OriginalVersionId);
 //			db.Photos.Commit (me_in_sf);
 //	
-//			Photo macro_shot = db.Photos.Create (DateTime.Now.ToUniversalTime (), 2, "/home/ettore/Photos/macro_shot.jpg",
-//							     out unused_thumbnail);
+//			Photo macro_shot = db.Photos.Create (DateTime.Now.ToUniversalTime (), 2, "/home/ettore/Photos/macro_shot.jpg");
 			db.Dispose ();
 	
 			db.Init (path, false);



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