tasque r128 - in trunk: . src src/Backends/Dummy src/Backends/EDS src/Backends/IceCore src/Backends/Sqlite



Author: sharm
Date: Wed Oct  8 13:01:09 2008
New Revision: 128
URL: http://svn.gnome.org/viewvc/tasque?rev=128&view=rev

Log:
* tasque/src/TaskGroup.cs:
* tasque/src/Utilities.cs:
* tasque/src/TaskWindow.cs:
* tasque/src/Preferences.cs:
* tasque/src/Application.cs:
* tasque/src/TaskTreeView.cs:
* tasque/src/AbstractTask.cs:
* tasque/src/RemoteControl.cs:
* tasque/src/PreferencesDialog.cs:
* tasque/src/CompletedTaskGroup.cs:
* tasque/src/Backends/EDS/EDSBackends.cs:
* tasque/src/Backends/IceCore/IceBackend.cs:
* tasque/src/Backends/Dummy/DummyBackend.cs:
* tasque/src/Backends/Sqlite/SqliteBackend.cs: Increased readability of
  boolean expressions.  Fixes bug #555168, patch courtesy of Alex
  Launi.

Modified:
   trunk/ChangeLog
   trunk/src/AbstractTask.cs
   trunk/src/Application.cs
   trunk/src/Backends/Dummy/DummyBackend.cs
   trunk/src/Backends/EDS/EDSBackends.cs
   trunk/src/Backends/IceCore/IceBackend.cs
   trunk/src/Backends/Sqlite/SqliteBackend.cs
   trunk/src/CompletedTaskGroup.cs
   trunk/src/Preferences.cs
   trunk/src/PreferencesDialog.cs
   trunk/src/RemoteControl.cs
   trunk/src/TaskGroup.cs
   trunk/src/TaskTreeView.cs
   trunk/src/TaskWindow.cs
   trunk/src/Utilities.cs

Modified: trunk/src/AbstractTask.cs
==============================================================================
--- trunk/src/AbstractTask.cs	(original)
+++ trunk/src/AbstractTask.cs	Wed Oct  8 13:01:09 2008
@@ -99,7 +99,7 @@
 					|| DueDate.DayOfYear != task.DueDate.DayOfYear)
 				isSameDate = false;
 			
-			if (isSameDate == false) {
+			if (!isSameDate) {
 				if (DueDate == DateTime.MinValue) {
 					// No due date set on this task. Since we already tested to see
 					// if the dates were the same above, we know that the passed-in
@@ -128,7 +128,7 @@
 					|| CompletionDate.DayOfYear != task.CompletionDate.DayOfYear)
 				isSameDate = false;
 			
-			if (isSameDate == false) {
+			if (!isSameDate) {
 				if (CompletionDate == DateTime.MinValue) {
 					// No completion date set for some reason.  Since we already
 					// tested to see if the dates were the same above, we know

Modified: trunk/src/Application.cs
==============================================================================
--- trunk/src/Application.cs	(original)
+++ trunk/src/Application.cs	Wed Oct  8 13:01:09 2008
@@ -290,7 +290,7 @@
 			
 			foreach (IBackend backend in backends) {
 				string typeId = backend.GetType ().ToString ();
-				if (availableBackends.ContainsKey (typeId) == true)
+				if (availableBackends.ContainsKey (typeId))
 					continue;
 				
 				Logger.Debug ("Storing '{0}' = '{1}'", typeId, backend.Name);
@@ -312,7 +312,7 @@
 				return backends;
 			}
 			foreach (Type type in types) {
-				if (type.IsClass == false) {
+				if (!type.IsClass) {
 					continue; // Skip non-class types
 				}
 				if (type.GetInterface ("Tasque.Backends.IBackend") == null) {
@@ -364,7 +364,7 @@
 			} else {
 				TaskWindow.ShowWindow();
 			}
-			if (backend == null || backend.Configured == false){
+			if (backend == null || !backend.Configured){
 				GLib.Timeout.Add(1000, new GLib.TimeoutHandler(RetryBackend));
 			}
 
@@ -379,7 +379,7 @@
 			} catch (Exception e) {
 				Logger.Error("{0}", e.Message);
 			}
-			if (backend == null || backend.Configured == false) {
+			if (backend == null || !backend.Configured) {
 				return true;
 			} else {
 				return false;

Modified: trunk/src/Backends/Dummy/DummyBackend.cs
==============================================================================
--- trunk/src/Backends/Dummy/DummyBackend.cs	(original)
+++ trunk/src/Backends/Dummy/DummyBackend.cs	Wed Oct  8 13:01:09 2008
@@ -301,14 +301,14 @@
 			// Set the task in the store so the model will update the UI.
 			Gtk.TreeIter iter;
 			
-			if (taskIters.ContainsKey (task.DummyId) == false)
+			if (!taskIters.ContainsKey (task.DummyId))
 				return;
 				
 			iter = taskIters [task.DummyId];
 			
 			if (task.State == TaskState.Deleted) {
 				taskIters.Remove (task.DummyId);
-				if (taskStore.Remove (ref iter) == false) {
+				if (!taskStore.Remove (ref iter)) {
 					Logger.Debug ("Successfully deleted from taskStore: {0}",
 						task.Name);
 				} else {

Modified: trunk/src/Backends/EDS/EDSBackends.cs
==============================================================================
--- trunk/src/Backends/EDS/EDSBackends.cs	(original)
+++ trunk/src/Backends/EDS/EDSBackends.cs	Wed Oct  8 13:01:09 2008
@@ -347,14 +347,14 @@
                        // Set the task in the store so the model will update the UI.
                        Gtk.TreeIter iter;
 
-                       if (taskIters.ContainsKey (task.Id) == false)
+                       if (!taskIters.ContainsKey (task.Id))
                                return;
 
                        iter = taskIters [task.Id];
 
                        if (task.State == TaskState.Deleted) {
                                taskIters.Remove (task.Id);
-                               if (taskStore.Remove (ref iter) == false) {
+                               if (!taskStore.Remove (ref iter)) {
                                        Logger.Debug ("Successfully deleted from taskStore: {0}",
                                                task.Name);
                                } else {

Modified: trunk/src/Backends/IceCore/IceBackend.cs
==============================================================================
--- trunk/src/Backends/IceCore/IceBackend.cs	(original)
+++ trunk/src/Backends/IceCore/IceBackend.cs	Wed Oct  8 13:01:09 2008
@@ -228,7 +228,7 @@
 			sessionBus.NameOwnerChanged += OnDBusNameOwnerChanged;
 			
 			// Force the daemon to start up if it's not already running
-			if (Bus.Session.NameHasOwner (DaemonNamespace) == false) {
+			if (!Bus.Session.NameHasOwner (DaemonNamespace)) {
 				Bus.Session.StartServiceByName (DaemonNamespace);
 			}
 			
@@ -276,7 +276,7 @@
 			// Set the task in the store so the model will update the UI.
 			Gtk.TreeIter iter;
 			
-			if (taskIters.ContainsKey (task.Id) == false) {
+			if (!taskIters.ContainsKey (task.Id)) {
 				// This must be a new task that should be added in.
 				iter = tasks.Append ();
 				taskIters [task.Id] = iter;
@@ -286,7 +286,7 @@
 			
 			if (task.State == TaskState.Deleted) {
 				taskIters.Remove (task.Id);
-				if (tasks.Remove (ref iter) == false) {
+				if (!tasks.Remove (ref iter)) {
 					Logger.Debug ("Successfully deleted from taskStore: {0}",
 						task.Name);
 				} else {

Modified: trunk/src/Backends/Sqlite/SqliteBackend.cs
==============================================================================
--- trunk/src/Backends/Sqlite/SqliteBackend.cs	(original)
+++ trunk/src/Backends/Sqlite/SqliteBackend.cs	Wed Oct  8 13:01:09 2008
@@ -198,14 +198,14 @@
 			// Set the task in the store so the model will update the UI.
 			Gtk.TreeIter iter;
 			
-			if (taskIters.ContainsKey (task.SqliteId) == false)
+			if (!taskIters.ContainsKey (task.SqliteId))
 				return;
 				
 			iter = taskIters [task.SqliteId];
 			
 			if (task.State == TaskState.Deleted) {
 				taskIters.Remove (task.SqliteId);
-				if (taskStore.Remove (ref iter) == false) {
+				if (!taskStore.Remove (ref iter)) {
 					Logger.Debug ("Successfully deleted from taskStore: {0}",
 						task.Name);
 				} else {

Modified: trunk/src/CompletedTaskGroup.cs
==============================================================================
--- trunk/src/CompletedTaskGroup.cs	(original)
+++ trunk/src/CompletedTaskGroup.cs	Wed Oct  8 13:01:09 2008
@@ -91,7 +91,7 @@
 		protected override bool FilterTasks (TreeModel model, TreeIter iter)
 		{
 			// Don't show any task here if showCompletedTasks is false
-			if (showCompletedTasks == false)
+			if (!showCompletedTasks)
 				return false;
 			
 			ITask task = model.GetValue (iter, 0) as ITask;
@@ -99,7 +99,7 @@
 				return false;
 			
 			if (selectedCategory != null
-					&& selectedCategory.ContainsTask (task) == false)
+					&& !selectedCategory.ContainsTask (task))
 				return false;
 			
 			// Make sure that the task fits into the specified range depending
@@ -143,14 +143,14 @@
 				TreeIter iter;
 				TreeModel model = Application.Backend.Categories;
 				
-				if (model.GetIterFirst (out iter) == true) {
+				if (model.GetIterFirst (out iter)) {
 					do {
 						ICategory category = model.GetValue (iter, 0) as ICategory;
 						if (category.Name.CompareTo (cat) == 0) {
 							foundCategory = category;
 							break;
 						}
-					} while (model.IterNext (ref iter) == true);
+					} while (model.IterNext (ref iter));
 				}
 			}
 			

Modified: trunk/src/Preferences.cs
==============================================================================
--- trunk/src/Preferences.cs	(original)
+++ trunk/src/Preferences.cs	Wed Oct  8 13:01:09 2008
@@ -82,7 +82,7 @@
 			
 			string xPath = string.Format ("//{0}", settingKey.Trim ());
 			XmlNode node = document.SelectSingleNode (xPath);
-			if (node == null || node is XmlElement == false)
+			if (node == null || !(node is XmlElement))
 				return SetDefault (settingKey);
 			
 			XmlElement element = node as XmlElement;

Modified: trunk/src/PreferencesDialog.cs
==============================================================================
--- trunk/src/PreferencesDialog.cs	(original)
+++ trunk/src/PreferencesDialog.cs	Wed Oct  8 13:01:09 2008
@@ -307,7 +307,7 @@
 				}
 				
 				// if yes (replace backend)
-				if (backendComboMap.ContainsKey (selectedBackend) == true) {
+				if (backendComboMap.ContainsKey (selectedBackend)) {
 					// Cleanup old backend
 					IBackend oldBackend = backendComboMap [selectedBackend];
 					Logger.Info ("Cleaning up '{0}'...", oldBackend.Name);
@@ -325,7 +325,7 @@
 			}
 			
 			IBackend newBackend = null;
-			if (backendComboMap.ContainsKey (backendComboBox.Active) == true) {
+			if (backendComboMap.ContainsKey (backendComboBox.Active)) {
 				newBackend = backendComboMap [backendComboBox.Active];
 			}
 			
@@ -350,7 +350,7 @@
 				
 				// If the new backend is not configured, automatically switch
 				// to the backend's preferences page
-				if (newBackend.Configured == false)
+				if (!newBackend.Configured)
 					notebook.Page = backendPageId;
 			}
 			
@@ -383,7 +383,7 @@
 			}
 			
 			// Check to see if the category is specified in the list
-			if (categoriesToHide.Contains (category.Name) == true) {
+			if (categoriesToHide.Contains (category.Name)) {
 				crt.Active = false;
 				return;
 			}
@@ -411,7 +411,7 @@
 			Logger.Debug ("OnCategoryToggled");
 			Gtk.TreeIter iter;
 			Gtk.TreePath path = new Gtk.TreePath (args.Path);
-			if (categoriesTree.Model.GetIter (out iter, path) == false)
+			if (!categoriesTree.Model.GetIter (out iter, path))
 				return; // Do nothing
 			
 			ICategory category = categoriesTree.Model.GetValue (iter, 0) as ICategory;
@@ -464,7 +464,7 @@
 		
 		void RebuildCategoryTree ()
 		{
-			if (backendComboMap.ContainsKey (selectedBackend) == false) {
+			if (!backendComboMap.ContainsKey (selectedBackend)) {
 				categoriesTree.Model = null;
 				return;
 			}

Modified: trunk/src/RemoteControl.cs
==============================================================================
--- trunk/src/RemoteControl.cs	(original)
+++ trunk/src/RemoteControl.cs	Wed Oct  8 13:01:09 2008
@@ -68,7 +68,7 @@
 			//
 			// Look for the specified category
 			//
-			if (model.GetIterFirst (out iter) == false) {
+			if (!model.GetIterFirst (out iter)) {
 				return string.Empty;
 			}
 			
@@ -79,7 +79,7 @@
 					// Found a match
 					category = tempCategory;
 				}
-			} while (model.IterNext (ref iter) == true);
+			} while (model.IterNext (ref iter));
 			
 			if (category == null) {
 				return string.Empty;
@@ -97,7 +97,7 @@
 				return string.Empty;
 			}
 			
-			if (enterEditMode == true) {
+			if (enterEditMode) {
 				TaskWindow.SelectAndEdit (task);
 			}
 			
@@ -131,7 +131,7 @@
 			Gtk.TreeIter iter;
 			Gtk.TreeModel model = Application.Backend.Categories;
 			
-			if (model.GetIterFirst (out iter) == false)
+			if (!model.GetIterFirst (out iter))
 				return emptyArray;
 			
 			do {
@@ -139,7 +139,7 @@
 				if (category is AllCategory)
 					continue; // Prevent the AllCategory from being returned
 				categories.Add (category.Name);
-			} while (model.IterNext (ref iter) == true);
+			} while (model.IterNext (ref iter));
 			
 			return categories.ToArray ();
 		}

Modified: trunk/src/TaskGroup.cs
==============================================================================
--- trunk/src/TaskGroup.cs	(original)
+++ trunk/src/TaskGroup.cs	Wed Oct  8 13:01:09 2008
@@ -228,7 +228,7 @@
 			
 			iter = Gtk.TreeIter.Zero;
 			
-			if (model.GetIterFirst (out tempIter) == false)
+			if (!model.GetIterFirst (out tempIter))
 				return false;
 			
 			// Loop through the model looking for a matching task
@@ -238,7 +238,7 @@
 					iter = tempIter;
 					return true;
 				}
-			} while (model.IterNext (ref tempIter) == true);
+			} while (model.IterNext (ref tempIter));
 			
 			return false;
 		}
@@ -260,7 +260,7 @@
 			Gtk.TreeModel model = treeView.Model;
 			ITask task = model.GetValue (iter, 0) as ITask;
 			
-			if (model.GetIterFirst (out tempIter) == false)
+			if (!model.GetIterFirst (out tempIter))
 				return 0;
 			
 			// This is ugly, but figure out what position the specified iter is
@@ -271,7 +271,7 @@
 					break;
 				
 				pos++;
-			} while (model.IterNext (ref tempIter) == true);
+			} while (model.IterNext (ref tempIter));
 			
 			return pos;
 		}
@@ -289,7 +289,7 @@
 			Gtk.TreeModel model = treeView.Model;
 			ITask task = model.GetValue (iter, 0) as ITask;
 			
-			if (model.GetIterFirst (out tempIter) == false)
+			if (!model.GetIterFirst (out tempIter))
 				return 0;
 			
 			// This is ugly, but figure out what position the specified iter is
@@ -300,7 +300,7 @@
 					break;
 				
 				pos++;
-			} while (model.IterNext (ref tempIter) == true);
+			} while (model.IterNext (ref tempIter));
 
 //Logger.Debug ("pos: {0}", pos);
 //Logger.Debug ("height: {0}", height);			
@@ -333,7 +333,7 @@
 			base.OnRealized ();
 			
 			if (treeView.GetNumberOfTasks () == 0
-					&& (showCompletedTasks == false || hideWhenEmpty == true))
+					&& (!showCompletedTasks || hideWhenEmpty))
 				Hide ();
 			else
 				Show ();
@@ -352,7 +352,7 @@
 			// these tasks should always be in the very last category.
 			if (task.DueDate == DateTime.MinValue) {
 				if (timeRangeEnd == DateTime.MaxValue) {
-					if (ShowCompletedTask (task) == false)
+					if (!ShowCompletedTask (task))
 						return false;
 					
 					return true;
@@ -364,7 +364,7 @@
 			if (task.DueDate < timeRangeStart || task.DueDate > timeRangeEnd)
 				return false;
 			
-			if (ShowCompletedTask (task) == false)
+			if (!ShowCompletedTask (task))
 				return false;
 			
 			return true;
@@ -373,7 +373,7 @@
 		private bool ShowCompletedTask (ITask task)
 		{
 			if (task.State == TaskState.Completed) {
-				if (showCompletedTasks == false)
+				if (!showCompletedTasks)
 					return false;
 				
 				// Only show completed tasks that are from "Today".  Once it's
@@ -382,7 +382,7 @@
 				if (task.CompletionDate == DateTime.MinValue)
 					return false; // Just in case
 				
-				if (IsToday (task.CompletionDate) == false)
+				if (!IsToday (task.CompletionDate))
 					return false;
 			}
 			
@@ -430,7 +430,7 @@
 
 				// Iterate through (yeah, I know this is gross!) and find the
 				// matching category
-				if (model.GetIterFirst (out iter) == true) {
+				if (model.GetIterFirst (out iter)) {
 					do {
 						ICategory cat = model.GetValue (iter, 0) as ICategory;
 						if (cat == null)
@@ -438,7 +438,7 @@
 						if (cat.Name.CompareTo (selectedCategoryName) == 0) {
 							return cat;
 						}
-					} while (model.IterNext (ref iter) == true);
+					} while (model.IterNext (ref iter));
 				}
 			}
 			
@@ -452,7 +452,7 @@
 			//Logger.Debug ("TaskGroup (\"{0}\").OnNumberOfTasksChanged ()", DisplayName);
 			// Check to see whether this group should be hidden or shown.
 			if (treeView.GetNumberOfTasks () == 0
-					&& (showCompletedTasks == false || hideWhenEmpty == true))
+					&& (!showCompletedTasks || hideWhenEmpty))
 				Hide ();
 			else
 				Show ();

Modified: trunk/src/TaskTreeView.cs
==============================================================================
--- trunk/src/TaskTreeView.cs	(original)
+++ trunk/src/TaskTreeView.cs	Wed Oct  8 13:01:09 2008
@@ -539,7 +539,7 @@
 			Logger.Debug ("OnTaskToggled");
 			Gtk.TreeIter iter;
 			Gtk.TreePath path = new Gtk.TreePath (args.Path);
-			if (Model.GetIter (out iter, path) == false)
+			if (!Model.GetIter (out iter, path))
 				return; // Do nothing
 			
 			ITask task = Model.GetValue (iter, 0) as ITask;
@@ -557,7 +557,7 @@
 				// When showCompletedTasks is true, complete the tasks right
 				// away.  Otherwise, set a timer and show the timer animation
 				// before marking the task completed.
-				if (showCompletedTasks == true) {
+				if (showCompletedTasks) {
 					task.Complete ();
 					ShowCompletedTaskStatus ();
 				} else {
@@ -582,7 +582,7 @@
 		{
 			Gtk.TreeIter iter;
 			Gtk.TreePath path = new TreePath (args.Path);
-			if (Model.GetIter (out iter, path) == false)
+			if (!Model.GetIter (out iter, path))
 				return;
 
 			TaskPriority newPriority;
@@ -605,7 +605,7 @@
 		{
 			Gtk.TreeIter iter;
 			Gtk.TreePath path = new TreePath (args.Path);
-			if (Model.GetIter (out iter, path) == false)
+			if (!Model.GetIter (out iter, path))
 				return;
 			
 			ITask task = Model.GetValue (iter, 0) as ITask;
@@ -650,7 +650,7 @@
 			
 			Gtk.TreeIter iter;
 			Gtk.TreePath path = new TreePath (args.Path);
-			if (Model.GetIter (out iter, path) == false)
+			if (!Model.GetIter (out iter, path))
 				return;
 			
 			//  2/11 - Today

Modified: trunk/src/TaskWindow.cs
==============================================================================
--- trunk/src/TaskWindow.cs	(original)
+++ trunk/src/TaskWindow.cs	Wed Oct  8 13:01:09 2008
@@ -534,7 +534,7 @@
 				Gtk.Application.RunIteration ();
 
 			foreach (TaskGroup taskGroup in taskGroups) {
-				if (taskGroup.ContainsTask (task, out iter) == true) {
+				if (taskGroup.ContainsTask (task, out iter)) {
 					taskGroup.TreeView.Selection.SelectIter (iter);
 					break;
 				}
@@ -578,7 +578,7 @@
 				//Logger.Debug("taskGroupHeights: {0}", taskGroupHeights);
 				TreePath start;
 				TreePath end;
-				if (taskGroup.TreeView.GetVisibleRange (out start, out end) == true) {
+				if (taskGroup.TreeView.GetVisibleRange (out start, out end)) {
 					Logger.Debug ("TaskGroup '{0}' range: {1} - {2}",
 						taskGroup.DisplayName,
 						start.ToString (),
@@ -587,7 +587,7 @@
 					Logger.Debug ("TaskGroup range not visible: {0}", taskGroup.DisplayName);
 				}
 				
-				if (taskGroup.ContainsTask (task, out iter) == true) {
+				if (taskGroup.ContainsTask (task, out iter)) {
 					Logger.Debug ("Found new task group: {0}", taskGroup.DisplayName);
 					
 					// Get the header height
@@ -649,7 +649,7 @@
 			Gtk.TreeIter iter;
 			Gtk.TreeModel model = Application.Backend.Tasks;
 			
-			if (model.GetIterFirst (out iter) == false)
+			if (!model.GetIterFirst (out iter))
 				return 0;
 			
 			do {
@@ -662,7 +662,7 @@
 				
 				if (category.ContainsTask (task))
 					count++;
-			} while (model.IterNext (ref iter) == true);
+			} while (model.IterNext (ref iter));
 			
 			return count;
 		}
@@ -690,13 +690,13 @@
 			while (Gtk.Application.EventsPending ())
 				Gtk.Application.RunIteration ();
 			
-			if (adjustScrolledWindow == true)
+			if (adjustScrolledWindow)
 				ScrollToTask (task);
 			
 			
 			Gtk.TreeIter iter;
 			foreach (TaskGroup taskGroup in taskGroups) {
-				if (taskGroup.ContainsTask (task, out iter) == true) {
+				if (taskGroup.ContainsTask (task, out iter)) {
 					Logger.Debug ("Found new task group: {0}", taskGroup.DisplayName);
 					
 					// Get the header height
@@ -711,7 +711,7 @@
 			Gtk.Menu menu = new Menu ();
 			
 			Gtk.TreeIter iter;
-			if (categoriesModel.GetIterFirst (out iter) == true) {
+			if (categoriesModel.GetIterFirst (out iter)) {
 				do {
 					ICategory category =
 						categoriesModel.GetValue (iter, 0) as ICategory;
@@ -723,7 +723,7 @@
 					item.Activated += OnNewTaskByCategory;
 					item.ShowAll ();
 					menu.Add (item);
-				} while (categoriesModel.IterNext (ref iter) == true);
+				} while (categoriesModel.IterNext (ref iter));
 			}
 			
 			addTaskButton.Menu = menu;
@@ -738,7 +738,7 @@
 			if (categoryName != null) {
 				// Iterate through (yeah, I know this is gross!) and find the
 				// matching category
-				if (model.GetIterFirst (out iter) == true) {
+				if (model.GetIterFirst (out iter)) {
 					do {
 						ICategory cat = model.GetValue (iter, 0) as ICategory;
 						if (cat == null)
@@ -748,14 +748,14 @@
 							categoryWasSelected = true;
 							break;
 						}
-					} while (model.IterNext (ref iter) == true);
+					} while (model.IterNext (ref iter));
 				}
 			}
 			
-			if (categoryWasSelected == false) {
+			if (!categoryWasSelected) {
 				// Select the first item in the list (which should be the "All"
 				// category.
-				if (model.GetIterFirst (out iter) == true) {
+				if (model.GetIterFirst (out iter)) {
 					// Make sure we can actually get a category
 					ICategory cat = model.GetValue (iter, 0) as ICategory;
 					if (cat != null)
@@ -767,7 +767,7 @@
 		private void ShowTaskNotes (ITask task)
 		{
 			NoteDialog dialog = null;
-			if (noteDialogs.ContainsKey (task) == false) {
+			if (!noteDialogs.ContainsKey (task)) {
 				dialog = new NoteDialog (this, task);
 				dialog.Hidden += OnNoteDialogHidden;
 				noteDialogs [task] = dialog;
@@ -896,7 +896,7 @@
 				return;
 			
 			Gtk.TreeIter iter;
-			if (categoryComboBox.GetActiveIter (out iter) == false)
+			if (!categoryComboBox.GetActiveIter (out iter))
 				return;
 			
 			ICategory category =
@@ -940,7 +940,7 @@
 			// to switch the category first so the user will be able to edit
 			// the title of the task.
 			Gtk.TreeIter iter;
-			if (categoryComboBox.GetActiveIter (out iter) == true) {
+			if (categoryComboBox.GetActiveIter (out iter)) {
 				ICategory selectedCategory =
 					categoryComboBox.Model.GetValue (iter, 0) as ICategory;
 				
@@ -968,7 +968,7 @@
 		void OnCategoryChanged (object sender, EventArgs args)
 		{
 			Gtk.TreeIter iter;
-			if (categoryComboBox.GetActiveIter (out iter) == false)
+			if (!categoryComboBox.GetActiveIter (out iter))
 				return;
 			
 			ICategory category =
@@ -999,7 +999,7 @@
 			
 			Gtk.TreeIter iter;
 			
-			if (model.GetIter (out iter, args.Path) == false)
+			if (!model.GetIter (out iter, args.Path))
 				return;
 			
 			ITask task = model.GetValue (iter, 0) as ITask;
@@ -1027,11 +1027,11 @@
 					Gtk.TreePath path;
 					Gtk.TreeViewColumn column = null;
 
-					if (tv.GetPathAtPos ((int) args.Event.X,
-									(int) args.Event.Y, out path, out column) == false)
+					if (!tv.GetPathAtPos ((int) args.Event.X,
+									(int) args.Event.Y, out path, out column))
 						return;
 
-					if (model.GetIter (out iter, path) == false)
+					if (!model.GetIter (out iter, path))
 						return;
 					
 					clickedTask = model.GetValue (iter, 0) as ITask;
@@ -1103,7 +1103,7 @@
 				return;
 			}
 			
-			if (noteDialogs.ContainsKey (dialog.Task) == false) {
+			if (!noteDialogs.ContainsKey (dialog.Task)) {
 				Logger.Warn ("Closed NoteDialog not found in noteDialogs");
 				return;
 			}

Modified: trunk/src/Utilities.cs
==============================================================================
--- trunk/src/Utilities.cs	(original)
+++ trunk/src/Utilities.cs	Wed Oct  8 13:01:09 2008
@@ -125,7 +125,7 @@
 		/// </summary>
 		public static void CreateDirectoryIfNeeded (string path)
 		{
-			if (System.IO.Directory.Exists (path) == false) {
+			if (!System.IO.Directory.Exists (path)) {
 				try {
 					System.IO.Directory.CreateDirectory (path);
 				} catch {



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