banshee r3530 - in trunk/banshee: . src/Core/Banshee.Core/Banshee.Base src/Core/Banshee.Services/Banshee.ServiceStack



Author: abock
Date: Tue Mar 25 01:20:40 2008
New Revision: 3530
URL: http://svn.gnome.org/viewvc/banshee?rev=3530&view=rev

Log:
2008-03-24  Aaron Bockover  <abock gnome org>

    * src/Core/Banshee.Services/Banshee.ServiceStack/Application.cs: Use
    InstalledApplicationData to build the catalog path for gettext and
    initialize it (whoops) (BGO #523047)

    * src/Core/Banshee.Core/Banshee.Base/Paths.cs: Added
    InstalledApplicationPrefix, InstalledApplicationDataRoot, and 
    InstalledApplicationData properties that are detected at runtime based
    on the path of the entry assembly (used to figure out datadir, basically,
    without having to hardcode the paths at compile time)



Modified:
   trunk/banshee/ChangeLog
   trunk/banshee/src/Core/Banshee.Core/Banshee.Base/   (props changed)
   trunk/banshee/src/Core/Banshee.Core/Banshee.Base/Paths.cs
   trunk/banshee/src/Core/Banshee.Services/Banshee.ServiceStack/Application.cs

Modified: trunk/banshee/src/Core/Banshee.Core/Banshee.Base/Paths.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.Core/Banshee.Base/Paths.cs	(original)
+++ trunk/banshee/src/Core/Banshee.Core/Banshee.Base/Paths.cs	Tue Mar 25 01:20:40 2008
@@ -135,5 +135,30 @@
         public static string CachedLibraryLocation {
             get { return cached_library_location ?? LibraryLocation; }
         }
+        
+        private static string installed_application_prefix = null;
+        public static string InstalledApplicationPrefix {
+            get {
+                if (installed_application_prefix == null) {
+                    installed_application_prefix = Path.GetDirectoryName (
+                        System.Reflection.Assembly.GetEntryAssembly ().Location);
+                    DirectoryInfo entry_directory = new DirectoryInfo (installed_application_prefix);
+                    
+                    if (entry_directory != null && entry_directory.Parent != null && entry_directory.Parent.Parent != null) {
+                        installed_application_prefix = entry_directory.Parent.Parent.FullName;
+                    }
+                }
+                
+                return installed_application_prefix;
+            }
+        }
+        
+        public static string InstalledApplicationDataRoot {
+            get { return Path.Combine (InstalledApplicationPrefix, "share"); }
+        }
+        
+        public static string InstalledApplicationData {
+            get { return Path.Combine (InstalledApplicationDataRoot, "banshee-1"); }
+        }
     }
 }

Modified: trunk/banshee/src/Core/Banshee.Services/Banshee.ServiceStack/Application.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.Services/Banshee.ServiceStack/Application.cs	(original)
+++ trunk/banshee/src/Core/Banshee.Services/Banshee.ServiceStack/Application.cs	Tue Mar 25 01:20:40 2008
@@ -57,6 +57,9 @@
         public static void Run ()
         {
             Banshee.Base.PlatformHacks.TrapMonoJitSegv ();
+            
+            Catalog.Init ("banshee-1", System.IO.Path.Combine (
+                Banshee.Base.Paths.InstalledApplicationDataRoot, "locale"));
 
             ServiceManager.Run ();
             



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