banshee r3850 - in trunk/banshee: . src/Backends/Banshee.Unix/Banshee.IO.Unix src/Clients/Nereid/Nereid src/Core/Banshee.Services/Banshee.Database src/Core/Banshee.Services/Banshee.ServiceStack src/Core/Banshee.Services/Banshee.Sources src/Core/Banshee.ThickClient/Banshee.Gui src/Dap/Banshee.Dap/Banshee.Dap



Author: gburt
Date: Wed Apr 30 01:48:23 2008
New Revision: 3850
URL: http://svn.gnome.org/viewvc/banshee?rev=3850&view=rev

Log:
2008-04-29  Gabriel Burt  <gabriel burt gmail com>

	* src/Backends/Banshee.Unix/Banshee.IO.Unix/Directory.cs: Comment style.

	* src/Core/Banshee.Services/Banshee.ServiceStack/Client.cs:
	* src/Clients/Nereid/Nereid/Client.cs: Use Log.InformationFormat instead of
	Log.Information (String.Format

	* src/Core/Banshee.Services/Banshee.Database/BansheeDbConnection.cs: Add a
	log statement.

	* src/Core/Banshee.Services/Banshee.Database/BansheeDbFormatMigrator.cs:
	Get rid of unnecessary thread, and move reload all from anonymous delegate
	to private method.

	* src/Core/Banshee.Services/Banshee.Sources/Source.cs:
	* src/Core/Banshee.ThickClient/Banshee.Gui/SourceActions.cs:
	* src/Dap/Banshee.Dap/Banshee.Dap/DapService.cs: Make OnUserNotifyUpdated
	protected and add public NotifyUser method.


Modified:
   trunk/banshee/ChangeLog
   trunk/banshee/src/Backends/Banshee.Unix/Banshee.IO.Unix/Directory.cs
   trunk/banshee/src/Clients/Nereid/Nereid/Client.cs
   trunk/banshee/src/Core/Banshee.Services/Banshee.Database/BansheeDbConnection.cs
   trunk/banshee/src/Core/Banshee.Services/Banshee.Database/BansheeDbFormatMigrator.cs
   trunk/banshee/src/Core/Banshee.Services/Banshee.ServiceStack/Client.cs
   trunk/banshee/src/Core/Banshee.Services/Banshee.Sources/Source.cs
   trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui/SourceActions.cs
   trunk/banshee/src/Dap/Banshee.Dap/Banshee.Dap/DapService.cs

Modified: trunk/banshee/src/Backends/Banshee.Unix/Banshee.IO.Unix/Directory.cs
==============================================================================
--- trunk/banshee/src/Backends/Banshee.Unix/Banshee.IO.Unix/Directory.cs	(original)
+++ trunk/banshee/src/Backends/Banshee.Unix/Banshee.IO.Unix/Directory.cs	Wed Apr 30 01:48:23 2008
@@ -51,7 +51,8 @@
                     throw new Exception ("Failed to allocate native directory string");
                 }
             
-                if (g_mkdir_with_parents (path_ptr, 493 /*0755 - C# doesn't do octal literals*/) == -1) {
+                // 493 == 0755 - C# doesn't do octal literals
+                if (g_mkdir_with_parents (path_ptr, 493) == -1) {
                     Mono.Unix.UnixMarshal.ThrowExceptionForLastError ();
                 }
             } catch (EntryPointNotFoundException) {

Modified: trunk/banshee/src/Clients/Nereid/Nereid/Client.cs
==============================================================================
--- trunk/banshee/src/Clients/Nereid/Nereid/Client.cs	(original)
+++ trunk/banshee/src/Clients/Nereid/Nereid/Client.cs	Wed Apr 30 01:48:23 2008
@@ -35,7 +35,7 @@
     {
         public static void Main ()
         {
-            Hyena.Log.Information (String.Format ("Running Banshee {0}", Banshee.ServiceStack.Application.Version));
+            Hyena.Log.InformationFormat ("Running Banshee {0}", Banshee.ServiceStack.Application.Version);
             // This could go into GtkBaseClient, but it's probably something we
             // should really only support at each client level
             string user_gtkrc = Path.Combine (Banshee.Base.Paths.ApplicationData, "gtkrc"); 

Modified: trunk/banshee/src/Core/Banshee.Services/Banshee.Database/BansheeDbConnection.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.Services/Banshee.Database/BansheeDbConnection.cs	(original)
+++ trunk/banshee/src/Core/Banshee.Services/Banshee.Database/BansheeDbConnection.cs	Wed Apr 30 01:48:23 2008
@@ -56,6 +56,8 @@
             // don't want this on because it breaks searching/smart playlists.  See BGO #526371
             //Execute ("PRAGMA case_sensitive_like=ON");
 
+            Log.DebugFormat ("Opened SQLite connection to {0}", DatabaseFile);
+
             migrator = new BansheeDbFormatMigrator (this);
             
             if (Banshee.Base.ApplicationContext.CommandLine.Contains ("debug-sql")) {

Modified: trunk/banshee/src/Core/Banshee.Services/Banshee.Database/BansheeDbFormatMigrator.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.Services/Banshee.Database/BansheeDbFormatMigrator.cs	(original)
+++ trunk/banshee/src/Core/Banshee.Services/Banshee.Database/BansheeDbFormatMigrator.cs	Wed Apr 30 01:48:23 2008
@@ -328,23 +328,11 @@
             Execute ("ALTER TABLE CoreSmartPlaylists ADD COLUMN CachedCount INTEGER");
 
             // This once, we need to reload all the sources at start up. Then never again, woo!
-            bool refreshed = false;
-            Application.ActiveClient.Started += delegate {
-                if (!refreshed) {
-                    refreshed = true;
-                    ThreadPool.QueueUserWorkItem (delegate {
-                        foreach (Source source in ServiceManager.SourceManager.Sources) {
-                            if (source is ITrackModelSource) {
-                                ((ITrackModelSource)source).Reload ();
-                            }
-                        }
-                    });
-                }
-            };
-
+            Application.ActiveClient.Started += ReloadAllSources;
             return true;
         }
 
+
 #pragma warning restore 0169
         
         private void InitializeFreshDatabase()
@@ -699,6 +687,19 @@
             job.Finish ();
             ServiceManager.SourceManager.MusicLibrary.NotifyTracksChanged ();
         }
+
+        private static bool refreshed = false;
+        private void ReloadAllSources (object o, EventArgs args)
+        {
+            if (!refreshed) {
+                refreshed = true;
+                foreach (Source source in ServiceManager.SourceManager.Sources) {
+                    if (source is ITrackModelSource) {
+                        ((ITrackModelSource)source).Reload ();
+                    }
+                }
+            }
+        }
         
 #endregion
 

Modified: trunk/banshee/src/Core/Banshee.Services/Banshee.ServiceStack/Client.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.Services/Banshee.ServiceStack/Client.cs	(original)
+++ trunk/banshee/src/Core/Banshee.Services/Banshee.ServiceStack/Client.cs	Wed Apr 30 01:48:23 2008
@@ -48,7 +48,7 @@
 
         protected void OnStarted ()
         {
-            Hyena.Log.Information (String.Format ("{0} Client Started", ClientId));
+            Hyena.Log.InformationFormat ("{0} Client Started", ClientId);
             EventHandler handler = Started;
             if (handler != null) {
                 handler (this, EventArgs.Empty);

Modified: trunk/banshee/src/Core/Banshee.Services/Banshee.Sources/Source.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.Services/Banshee.Sources/Source.cs	(original)
+++ trunk/banshee/src/Core/Banshee.Services/Banshee.Sources/Source.cs	Wed Apr 30 01:48:23 2008
@@ -403,7 +403,12 @@
             }
         }
 
-        public virtual void OnUserNotifyUpdated ()
+        public void NotifyUser ()
+        {
+            OnUserNotifyUpdated ();
+        }
+
+        protected void OnUserNotifyUpdated ()
         {
             if (this != ServiceManager.SourceManager.ActiveSource) {
                 EventHandler handler = UserNotifyUpdated;

Modified: trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui/SourceActions.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui/SourceActions.cs	(original)
+++ trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui/SourceActions.cs	Wed Apr 30 01:48:23 2008
@@ -165,7 +165,7 @@
             PlaylistSource playlist = new PlaylistSource ("New Playlist", ActivePrimarySource.DbId);
             playlist.Save ();
             playlist.PrimarySource.AddChildSource (playlist);
-            playlist.OnUserNotifyUpdated ();
+            playlist.NotifyUser ();
             //SourceView.BeginRenameSource (playlist);
         }
 

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	Wed Apr 30 01:48:23 2008
@@ -163,7 +163,7 @@
                     Log.DebugFormat ("Found DAP support ({0}) for device {1}", source.GetType ().FullName, source.Name);
                     sources.Add (device.Uuid, source);
                     ServiceManager.SourceManager.AddSource (source);
-                    source.OnUserNotifyUpdated ();
+                    source.NotifyUser ();
                 }
             }
         }



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