banshee r4222 - in trunk/banshee: . src/Dap/Banshee.Dap/Banshee.Dap



Author: gburt
Date: Sun Jul 20 18:12:29 2008
New Revision: 4222
URL: http://svn.gnome.org/viewvc/banshee?rev=4222&view=rev

Log:
2008-07-20  Gabriel Burt  <gabriel burt gmail com>

	* src/Dap/Banshee.Dap/Banshee.Dap/DapService.cs: Use Banshee.Kernel
	instead of ThreadAssist.SpawnFromMain.


Modified:
   trunk/banshee/ChangeLog
   trunk/banshee/src/Dap/Banshee.Dap/Banshee.Dap/DapService.cs

Modified: trunk/banshee/src/Dap/Banshee.Dap/Banshee.Dap/DapService.cs
==============================================================================
--- trunk/banshee/src/Dap/Banshee.Dap/Banshee.Dap/DapService.cs	(original)
+++ trunk/banshee/src/Dap/Banshee.Dap/Banshee.Dap/DapService.cs	Sun Jul 20 18:12:29 2008
@@ -141,33 +141,37 @@
         
         private void MapDevice (IDevice device)
         {
-            Banshee.Base.ThreadAssist.SpawnFromMain (delegate {
+            Banshee.Kernel.Scheduler.Schedule (new Banshee.Kernel.DelegateJob (delegate {
                 lock (this) {
-                    if (sources.ContainsKey (device.Uuid)) {
-                        return;
-                    }
-                    
-                    if (device is ICdromDevice || device is IDiscVolume) {
-                        return;
-                    }
-                    
-                    if (device is IVolume && (device as IVolume).ShouldIgnore) {
-                        return;
-                    }
-                    
-                    if (device.MediaCapabilities == null && !(device is IBlockDevice) && !(device is IVolume)) {
-                        return;
-                    }
-                    
-                    DapSource source = FindDeviceSource (device);
-                    if (source != null) {
-                        Log.DebugFormat ("Found DAP support ({0}) for device {1}", source.GetType ().FullName, source.Name);
-                        sources.Add (device.Uuid, source);
-                        ServiceManager.SourceManager.AddSource (source);
-                        source.NotifyUser ();
+                    try {
+                        if (sources.ContainsKey (device.Uuid)) {
+                            return;
+                        }
+                        
+                        if (device is ICdromDevice || device is IDiscVolume) {
+                            return;
+                        }
+                        
+                        if (device is IVolume && (device as IVolume).ShouldIgnore) {
+                            return;
+                        }
+                        
+                        if (device.MediaCapabilities == null && !(device is IBlockDevice) && !(device is IVolume)) {
+                            return;
+                        }
+                        
+                        DapSource source = FindDeviceSource (device);
+                        if (source != null) {
+                            Log.DebugFormat ("Found DAP support ({0}) for device {1}", source.GetType ().FullName, source.Name);
+                            sources.Add (device.Uuid, source);
+                            ServiceManager.SourceManager.AddSource (source);
+                            source.NotifyUser ();
+                        }
+                    } catch (Exception e) {
+                        Log.Exception (e);
                     }
                 }
-            });
+            }));
         }
         
         internal void UnmapDevice (string uuid)



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