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



Author: sdelcroix
Date: Mon Jun 30 08:57:01 2008
New Revision: 4121
URL: http://svn.gnome.org/viewvc/f-spot?rev=4121&view=rev

Log:
remove some Console.WriteLine in favor of Log.Debug.


Modified:
   trunk/src/Widgets/FindBar.cs
   trunk/src/Widgets/IconView.cs
   trunk/src/Widgets/InfoBox.cs
   trunk/src/Widgets/PanZoom.cs
   trunk/src/Widgets/Rating.cs
   trunk/src/Widgets/ScalingIconView.cs
   trunk/src/Widgets/Sidebar.cs
   trunk/src/Widgets/SoftFocus.cs
   trunk/src/Widgets/TagMenu.cs
   trunk/src/Widgets/TrayView.cs
   trunk/src/XmpTagsImporter.cs
   trunk/src/main.cs

Modified: trunk/src/Widgets/FindBar.cs
==============================================================================
--- trunk/src/Widgets/FindBar.cs	(original)
+++ trunk/src/Widgets/FindBar.cs	Mon Jun 30 08:57:01 2008
@@ -16,6 +16,7 @@
 using Mono.Unix;
 
 using FSpot.Query;
+using FSpot.Utils;
 
 namespace FSpot.Widgets {
 	public class FindBar : HighlightedBox {
@@ -83,7 +84,7 @@
 
 		private void HandleEntryTextInserted (object sender, TextInsertedArgs args)
 		{
-			//Console.WriteLine ("inserting {0}, ( = {1}  ) = {2}", args.Text, open_parens, close_parens);
+			//Log.DebugFormat ("inserting {0}, ( = {1}  ) = {2}", args.Text, open_parens, close_parens);
 
 			//int start = args.Position - args.Length;
 
@@ -104,7 +105,7 @@
 				entry.TextInserted += HandleEntryTextInserted;
 				pos++;
 			}
-			//Console.WriteLine ("done w/ insert, {0}, ( = {1}  ) = {2}", args.Text, open_parens, close_parens);
+			//Log.Debugformat ("done w/ insert, {0}, ( = {1}  ) = {2}", args.Text, open_parens, close_parens);
 			last_entry_text = entry.Text;
 
 			QueueUpdate ();
@@ -113,7 +114,7 @@
 		private void HandleEntryTextDeleted (object sender, TextDeletedArgs args)
 		{
 			int length = args.EndPos - args.StartPos;
-			//Console.WriteLine ("start {0} end {1} len {2} last {3}", args.StartPos, args.EndPos, length, last_entry_text);
+			//Log.DebugFormat ("start {0} end {1} len {2} last {3}", args.StartPos, args.EndPos, length, last_entry_text);
 			string txt = last_entry_text.Substring (args.StartPos, length);
 
 			for (int i = 0; i < txt.Length; i++) {
@@ -201,9 +202,9 @@
 		private static void PrintGroup (GroupCollection groups, string name)
 		{
 			Group group = groups [name];
-			Console.WriteLine ("Name: {2} (success = {1}) group: {0}", group, group.Success, name);
+			Log.DebugFormat ("Name: {2} (success = {1}) group: {0}", group, group.Success, name);
 			foreach (Capture capture in group.Captures) {
-				Console.WriteLine ("  Have capture: {0}", capture);
+				Log.DebugFormat ("  Have capture: {0}", capture);
 			}
 		}
 
@@ -222,13 +223,13 @@
 
 			string indent = String.Format ("{0," + depth*2 + "}", " ");
 
-			//Console.WriteLine (indent + "Have text: {0}", txt);
+			//Log.DebugFormat (indent + "Have text: {0}", txt);
 
 			// Match the query the user typed against our regular expression
 			Match match = term_regex.Match (txt);
 
 			if (!match.Success) {
-				//Console.WriteLine (indent + "Failed to match.");
+				//Log.Debug (indent + "Failed to match.");
 				return false;
 			}
 
@@ -248,12 +249,12 @@
 			}
 
 			if (!op_valid) {
-				Console.WriteLine (indent + "Ambiguous operator sequence.  Use parenthesis to explicitly define evaluation order.");
+				Log.Information (indent + "Ambiguous operator sequence.  Use parenthesis to explicitly define evaluation order.");
 				return false;
 			}
 
 			if (match.Groups ["Terms"].Captures.Count == 1 && match.Groups["NotTerm"].Captures.Count != 1) {
-				//Console.WriteLine (indent + "Unbreakable term: {0}", match.Groups ["Terms"].Captures [0]);
+				//Log.DebugFormat (indent + "Unbreakable term: {0}", match.Groups ["Terms"].Captures [0]);
 				string literal;
 				bool is_negated = false;
 				Tag tag = null;
@@ -311,7 +312,7 @@
 						subterm = subterm.Remove (0, 1);
 					}
 
-					//Console.WriteLine (indent + "Breaking subterm apart: {0}", subterm);
+					//Log.DebugFormat (indent + "Breaking subterm apart: {0}", subterm);
 
 					if (!ConstructQuery (us, depth + 1, subterm, negated))
 						return false;
@@ -329,7 +330,7 @@
 						subterm = subterm.Remove (0, 1);
 					}
 
-					//Console.WriteLine (indent + "Breaking not subterm apart: {0}", subterm);
+					//Log.DebugFormat (indent + "Breaking not subterm apart: {0}", subterm);
 
 					if (!ConstructQuery (us, depth + 1, subterm, true))
 						return false;
@@ -391,7 +392,7 @@
 
 			if (ParensValid () && ConstructQuery (null, 0, entry.Text)) {
 				if (RootTerm != null) {
-					//Console.WriteLine("rootTerm = {0}", RootTerm);
+					//Log.DebugFormat("rootTerm = {0}", RootTerm);
 					if (!(RootTerm is AndTerm)) {
 						// A little hacky, here to make sure the root term is a AndTerm which will
 						// ensure we handle the Hidden tag properly
@@ -400,7 +401,7 @@
 						root_term = root_parent;
 					}
 
-					//Console.WriteLine("rootTerm = {0}", RootTerm);
+					//Log.DebugFormat("rootTerm = {0}", RootTerm);
 					if (!(RootTerm is AndTerm)) {
 						// A little hacky, here to make sure the root term is a AndTerm which will
 						// ensure we handle the Hidden tag properly
@@ -408,11 +409,11 @@
 						RootTerm.Parent = root_parent;
 						root_term = root_parent;
 					}
-					//Console.WriteLine ("condition = {0}", RootTerm.SqlCondition ());
+					//Log.DebugFormat ("condition = {0}", RootTerm.SqlCondition ());
 					query.ExtraCondition = RootTerm.SqlCondition ();
 				} else {
 					query.ExtraCondition = null;
-					//Console.WriteLine ("root term is null");
+					//Log.Debug ("root term is null");
 				}
 			}
 		}
@@ -508,7 +509,7 @@
 			entry.DeleteText (entry.Position - transformed_key.Length, entry.Position);
 
 			string name = args.Model.GetValue (args.Iter, TextColumn) as string;
-			//Console.WriteLine ("match selected..{0}", name);
+			//Log.DebugFormat ("match selected..{0}", name);
 			int pos = entry.Position;
 
 			completing = true;
@@ -518,7 +519,7 @@
 			entry.Position += name.Length;
 
 			args.RetVal = true;
-			//Console.WriteLine ("done w/ match selected");
+			//Log.Debug.Format ("done w/ match selected");
 		}
 
 		string last_key = String.Empty;
@@ -542,7 +543,7 @@
 					int start = 0;
 					for (int i = entry.Position - 1; i >= 0; i--) {
 						if (key [i] == ' ' || key [i] == ')' || key [i] == '(') {
-							//Console.WriteLine ("have start break char at {0}", i);
+							//Log.DebugFormat ("have start break char at {0}", i);
 							start = i + 1;
 							break;
 						}
@@ -556,7 +557,7 @@
 						}
 					}
 
-					//Console.WriteLine ("start = {0} end = {1}", start, end);
+					//Log.DebugFormat ("start = {0} end = {1}", start, end);
 
 					int len = end - start + 1;
 					if (len > 0 && start < last_key.Length)
@@ -564,7 +565,7 @@
 					else
 						transformed_key = String.Empty;
 				}
-				//Console.WriteLine ("transformed key {0} into {1}", key, transformed_key);
+				//Log.DebugFormat ("transformed key {0} into {1}", key, transformed_key);
 			}
 
 			if (transformed_key == String.Empty)
@@ -576,7 +577,7 @@
 			if (name == null || name.Length <= transformed_key.Length)
 				return false;
 
-			//Console.WriteLine ("entered = {0} compared to {1}", transformed_key, name);
+			//Log.DebugFormat ("entered = {0} compared to {1}", transformed_key, name);
 			return (String.Compare (transformed_key, name.Substring(0, transformed_key.Length), true) == 0);
 		}
 	}

Modified: trunk/src/Widgets/IconView.cs
==============================================================================
--- trunk/src/Widgets/IconView.cs	(original)
+++ trunk/src/Widgets/IconView.cs	Mon Jun 30 08:57:01 2008
@@ -1030,7 +1030,7 @@
 			i ++) {
 				int cell_x = start_cell_x;
 
-				//Console.WriteLine ("Drawing row {0}", start_cell_row + i);
+				//Log.DebugFormat ("Drawing row {0}", start_cell_row + i);
 				for (int j = 0; j < num_cols && cell_num + j < collection.Count; j ++) {
 					DrawCell (cell_num + j, area);
 					cell_x += cell_width;
@@ -1079,7 +1079,7 @@
 
 			Gdk.Region offscreen = new Gdk.Region ();
 			/*
-			System.Console.WriteLine ("step ({0}, {1}) allocation ({2},{3},{4},{5})",
+			Log.DebugFormat ("step ({0}, {1}) allocation ({2},{3},{4},{5})",
 					xstep, ystep, Hadjustment.Value, Vadjustment.Value,
 					Allocation.Width, Allocation.Height);
 			*/
@@ -1296,7 +1296,7 @@
 			int width, height;
 			PixbufUtils.Fit (result, ThumbnailWidth, ThumbnailHeight, false, out width, out height);
 			if (result.Width > width && result.Height > height) {
-				//  System.Console.WriteLine ("scaling");
+				//  Log.Debug ("scaling");
 				Gdk.Pixbuf temp = PixbufUtils.ScaleDown (result, width, height);
 				result.Dispose ();
 				result = temp;

Modified: trunk/src/Widgets/InfoBox.cs
==============================================================================
--- trunk/src/Widgets/InfoBox.cs	(original)
+++ trunk/src/Widgets/InfoBox.cs	Mon Jun 30 08:57:01 2008
@@ -18,7 +18,7 @@
 using FSpot;
 using SemWeb;
 using Mono.Unix;
-
+using FSpot.Utils;
 
 // FIXME TODO: We want to use something like EClippedLabel here throughout so it handles small sizes
 // gracefully using ellipsis.
@@ -320,7 +320,7 @@
 					}
 					//}
 			} catch (System.Exception e) {
-				System.Console.WriteLine (e);
+				Log.Debug (e.StackTrace);
 				info = new ImageInfo (null);			
 			}
 

Modified: trunk/src/Widgets/PanZoom.cs
==============================================================================
--- trunk/src/Widgets/PanZoom.cs	(original)
+++ trunk/src/Widgets/PanZoom.cs	Mon Jun 30 08:57:01 2008
@@ -139,7 +139,7 @@
 				//w.GdkWindow.Scroll (- (n_x - pan_x), - (n_y - pan_y));
 				w.QueueDraw ();
 				w.GdkWindow.ProcessUpdates (false);
-				Console.WriteLine ("{0} {1} elapsed", DateTime.UtcNow, DateTime.UtcNow - start);
+				//Log.DebugFormat ("{0} {1} elapsed", DateTime.UtcNow, DateTime.UtcNow - start);
 			}
 			pan_x = n_x;
 			pan_y = n_y;

Modified: trunk/src/Widgets/Rating.cs
==============================================================================
--- trunk/src/Widgets/Rating.cs	(original)
+++ trunk/src/Widgets/Rating.cs	Mon Jun 30 08:57:01 2008
@@ -105,7 +105,6 @@
 		
 		private int RatingFromPosition (double x)
 		{
-			//System.Console.WriteLine ("Rating from position >>{0}<<", (int) (x / (double)(IconRated.Width)));
 			int pos = (int) (x / (double) IconRated.Width);
 			
 			return pos;
@@ -202,7 +201,6 @@
 		protected override bool OnMotionNotifyEvent (Gdk.EventMotion evnt)
 		{
 			if (editable) {
-				System.Console.WriteLine ("OnMotionNotifyEvent");
 				// TODO draw highlights onmouseover a rating? (and clear on leaveNotify)
 				if (evnt.State != Gdk.ModifierType.Button1Mask)
 					return false;
@@ -215,14 +213,12 @@
 		[GLib.ConnectBefore]
 		protected override bool OnFocusInEvent (Gdk.EventFocus evnt)
 		{
-			System.Console.WriteLine ("OnFocusInEvent");
 			return true;
 		}
 		
 		[GLib.ConnectBefore]
 		protected override bool OnFocused (DirectionType direction)
 		{
-			System.Console.WriteLine ("OnFocus");
 			return true;
 		}
 
@@ -247,7 +243,6 @@
 			get { return rating; }
 			
 			set {
-				//Console.WriteLine ("Set Rating to >>{0}<<", value);
 				// Same rating
 				if (rating == value)
 					return;

Modified: trunk/src/Widgets/ScalingIconView.cs
==============================================================================
--- trunk/src/Widgets/ScalingIconView.cs	(original)
+++ trunk/src/Widgets/ScalingIconView.cs	Mon Jun 30 08:57:01 2008
@@ -13,7 +13,7 @@
 		
 		protected override void UpdateLayout ()
 		{
-			System.Console.WriteLine ("in update layout {0}", Allocation.ToString ());
+			//Log.DebugFormat ("in update layout {0}", Allocation.ToString ());
 
 			int num_thumbnails;
 			if (collection != null)

Modified: trunk/src/Widgets/Sidebar.cs
==============================================================================
--- trunk/src/Widgets/Sidebar.cs	(original)
+++ trunk/src/Widgets/Sidebar.cs	Mon Jun 30 08:57:01 2008
@@ -123,7 +123,7 @@
 
 		private void HandleCanSelectChanged (object sender, EventArgs args)
 		{
-			Console.WriteLine ("Can select changed for {0} to {1}", sender, (sender as SidebarPage).CanSelect);
+			//Log.DebugFormat ("Can select changed for {0} to {1}", sender, (sender as SidebarPage).CanSelect);
 		}
 
 		public void AppendPage (Widget widget, string label, string icon_name)

Modified: trunk/src/Widgets/SoftFocus.cs
==============================================================================
--- trunk/src/Widgets/SoftFocus.cs	(original)
+++ trunk/src/Widgets/SoftFocus.cs	Mon Jun 30 08:57:01 2008
@@ -87,7 +87,7 @@
 			ctx.Operator = Operator.Source;
 			Pattern p = new SurfacePattern (source.Surface);
 			ctx.Source = p;
-			Console.WriteLine (small);
+			//Log.Debug (small);
 			ctx.Paint ();
 			p.Destroy ();
 			((IDisposable)ctx).Dispose ();

Modified: trunk/src/Widgets/TagMenu.cs
==============================================================================
--- trunk/src/Widgets/TagMenu.cs	(original)
+++ trunk/src/Widgets/TagMenu.cs	Mon Jun 30 08:57:01 2008
@@ -153,7 +153,7 @@
 			if (t != null)
 				TagSelected (t.Value);
 			else 
-				Console.WriteLine ("Item was not a TagMenuItem");
+				Log.Debug ("TagMenu.HandleActivate: Item was not a TagMenuItem");
 		}
 	}
 }

Modified: trunk/src/Widgets/TrayView.cs
==============================================================================
--- trunk/src/Widgets/TrayView.cs	(original)
+++ trunk/src/Widgets/TrayView.cs	Mon Jun 30 08:57:01 2008
@@ -39,8 +39,6 @@
 				width = cell_width - 2 * cell_border_width;
 				cell_height = (int)(width / ThumbnailRatio) + 2 * cell_border_width;
 				total_rows = (int) System.Math.Ceiling (collection.Items.Length / (double)cells_per_row);
-				//total_rows = collection.Items.Length / cells_per_row;
-				//System.Console.WriteLine ("cells per row {0} {1} {2}", cells_per_row, total_rows, width)
 				cells_per_row ++;
 			} while (total_rows > Allocation.Height / cell_height);
 			cells_per_row --;

Modified: trunk/src/XmpTagsImporter.cs
==============================================================================
--- trunk/src/XmpTagsImporter.cs	(original)
+++ trunk/src/XmpTagsImporter.cs	Mon Jun 30 08:57:01 2008
@@ -17,6 +17,7 @@
 using SemWeb;
 using SemWeb.Util;
 using Mono.Unix;
+using FSpot.Utils;
 
 namespace FSpot.Xmp {
         internal class XmpTagsImporter {
@@ -156,7 +157,6 @@
 			foreach (Statement stmt in store) {
 				//StatementList list = null;
 				
-				//System.Console.WriteLine ("processing {0}", stmt);
 				switch (stmt.Predicate.Uri) {
 
 				case Caption:
@@ -198,7 +198,7 @@
 							tmp_ui = System.Convert.ToUInt32 (l.Value);
 						} catch {
 							// Set rating to 0, and continue
-							System.Console.WriteLine ("Found illegal rating >{0}< in predicate {1}. Rating cleared",
+							Log.DebugFormat ("Found illegal rating >{0}< in predicate {1}. Rating cleared",
 										 l.Value, stmt.Predicate.Uri);
 							tmp_ui = 0;
 						}

Modified: trunk/src/main.cs
==============================================================================
--- trunk/src/main.cs	(original)
+++ trunk/src/main.cs	Mon Jun 30 08:57:01 2008
@@ -129,7 +129,7 @@
 				while (!(i+1 == args.Length) && !args[i+1].StartsWith ("-"))
 					uris.Add (args [++i]);
 //				if (!System.IO.Directory.Exists (args[i+1]) && !System.IO.File.Exists (args[i+1])) {
-//					Console.WriteLine ("f-spot: -view argument must be an existing file or directory");
+//					Log.Error ("f-spot: -view argument must be an existing file or directory");
 //					return 1;
 //				}
 				break;



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