f-spot r4652 - in trunk: . src/Widgets



Author: sdelcroix
Date: Tue Dec  2 15:31:26 2008
New Revision: 4652
URL: http://svn.gnome.org/viewvc/f-spot?rev=4652&view=rev

Log:
drop depenedency on Gnome.Vfs

2008-12-02  Stephane Delcroix  <sdelcroix novell com>

	* src/Widgets/InfoBox.cs: no longer depend on Gnome.Vfs (or at least
	it won't when we'll have gtk-sharp 2.14)

Modified:
   trunk/ChangeLog
   trunk/src/Widgets/InfoBox.cs

Modified: trunk/src/Widgets/InfoBox.cs
==============================================================================
--- trunk/src/Widgets/InfoBox.cs	(original)
+++ trunk/src/Widgets/InfoBox.cs	Tue Dec  2 15:31:26 2008
@@ -20,6 +20,9 @@
 using SemWeb;
 using Mono.Unix;
 using FSpot.Utils;
+using GLib;
+using GFile = GLib.File;
+using GFileInfo = GLib.FileInfo;
 
 // FIXME TODO: We want to use something like EClippedLabel here throughout so it handles small sizes
 // gracefully using ellipsis.
@@ -487,7 +490,7 @@
 					}
 					//}
 			} catch (System.Exception e) {
-				Log.Debug (e.StackTrace);
+				FSpot.Utils.Log.Debug (e.StackTrace);
 				info = new ImageInfo (null);			
 			}
 
@@ -548,9 +551,10 @@
 
 			if (show_file_size) {
 				try {
-					Gnome.Vfs.FileInfo file_info = new Gnome.Vfs.FileInfo (photo.DefaultVersionUri.ToString ());
+					GFile file = FileFactory.NewForUri (photo.DefaultVersionUri);
+					GFileInfo file_info = file.QueryInfo ("standard::size", FileQueryInfoFlags.None, null);
 #if GTK_SHARP_2_14_0
-					file_size_value_label.Text = GLib.Format.SizeForDisplay (file_info.Size);
+					file_size_value_label.Text = Format.SizeForDisplay (file_info.Size);
 #else
 					file_size_value_label.Text = Gnome.Vfs.Format.FileSizeForDisplay (file_info.Size);
 #endif
@@ -637,7 +641,8 @@
 				foreach (Photo photo in Photos) {
 					
 					try {
-						Gnome.Vfs.FileInfo file_info = new Gnome.Vfs.FileInfo (photo.DefaultVersionUri.ToString ());
+						GFile file = FileFactory.NewForUri (photo.DefaultVersionUri);
+						GFileInfo file_info = file.QueryInfo ("standard::size", FileQueryInfoFlags.None, null);
 						file_size += file_info.Size;
 					} catch (System.IO.FileNotFoundException) {
 						file_size = -1;
@@ -645,11 +650,15 @@
 					}
 				}
 				
-				if (file_size != -1) {
+				if (file_size != -1)
+#if GTK_SHARP_2_14_0
+					file_size_value_label.Text = Format.SizeForDisplay (file_size);
+#else
 					file_size_value_label.Text = Gnome.Vfs.Format.FileSizeForDisplay (file_size);
-				} else {
+#endif
+
+				else
 					file_size_value_label.Text = Catalog.GetString("(At least one File not found)");
-				}
 			}
 			file_size_label.Visible = show_file_size;
 			file_size_value_label.Visible = show_file_size;	
@@ -693,7 +702,7 @@
 
 				hint.Dispose ();
 			} catch (System.Exception e) {
-				Log.Debug (e.StackTrace);
+				FSpot.Utils.Log.Debug (e.StackTrace);
 			}
 
 			return false;



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