nemo r23 - trunk/common



Author: arj
Date: Mon Jan  7 10:38:31 2008
New Revision: 23
URL: http://svn.gnome.org/viewvc/nemo?rev=23&view=rev

Log:
Minor cleanup



Modified:
   trunk/common/Common.cs

Modified: trunk/common/Common.cs
==============================================================================
--- trunk/common/Common.cs	(original)
+++ trunk/common/Common.cs	Mon Jan  7 10:38:31 2008
@@ -30,8 +30,7 @@
 			return delegate { Gtk.Application.Invoke( delegate { b(); }); };
 		}
 
-		private static Timer update_timer;
-
+		// uses one shared timer, so will only allow one caller type to use this at a time
 		public static void RunOnlyOnceFIFO(VoidFunction func, int timeout /* ms */)
 		{
             if (update_timer != null)
@@ -52,15 +51,16 @@
                          	         timeout /* msecs */, Timeout.Infinite);
         }
 
-		public static void RunOnlyOnceTimedOut(VoidFunction func)
+		private static Timer update_timer;
+
+		private static void RunOnlyOnceTimedOut(VoidFunction func)
 		{
             func();
             update_timer.Dispose();
             update_timer = null;
 		}
 
-		static Dictionary<string, int> main_last_id = new Dictionary<string,int>();
-
+		// allows any number of callers to use this abstraction by identifying themselves by name
 		public static void RunOnlyOnceInMainLIFO(string name, VoidFunction func, uint timeout /* ms */)
 		{
 			int last_id = 0;
@@ -74,6 +74,8 @@
 			GLib.Timeout.Add(timeout, delegate { if (main_last_id[name] == last_id) func(); return false; } );
         }
 
+		static Dictionary<string, int> main_last_id = new Dictionary<string,int>();
+
 		public static Type load<Type>(string filename)
 		{
 			Type loaded = default(Type);



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