[banshee/gtk3] Dap.Mtp: convert static field 'empty_file' to non-static



commit 0af3b111aab36d00007aec6a67ef841327333c2c
Author: Andres G. Aragoneses <knocte gmail com>
Date:   Tue Dec 18 22:45:38 2012 +0000

    Dap.Mtp: convert static field 'empty_file' to non-static
    
    This field being static meant that its initialization was needed when
    inspecting the class via Reflection, which caused a crash when using
    the GSettingsSchemaExtractor:
    
    Found SchemaEntry: Banshee.Dap.Mtp.MtpSource.NeverSyncAlbumArtSchema
    
    Unhandled Exception:
    System.TypeInitializationException: An exception was thrown by the type initializer for Banshee.Dap.Mtp.MtpSource ---> System.ArgumentException: First component must not be null or empty
    Parameter name: first
      at Hyena.Paths.Combine (System.String first, System.String[] components) [0x0006c] in /home/andres1210/Code/bansheeGTK3/src/Hyena/Hyena/Hyena/Paths.cs:89
      at Banshee.Dap.Mtp.MtpSource..cctor () [0x00000] in /home/andres1210/Code/bansheeGTK3/src/Dap/Banshee.Dap.Mtp/Banshee.Dap.Mtp/MtpSource.cs:266
      --- End of inner exception stack trace ---
      at (wrapper managed-to-native) System.Reflection.MonoField:GetValueInternal (System.Reflection.MonoField,object)
      at System.Reflection.MonoField.GetValue (System.Object obj) [0x0006a] in /home/andres1210/Code/mono/mcs/class/corlib/System.Reflection/MonoField.cs:125
      at GSettingsSchemaExtractorProgram.Extract (IEnumerable`1 types) [0x000ad] in /home/andres1210/Code/bansheeGTK3/build/GSettingsSchemaExtractor.cs:78
      at GSettingsSchemaExtractorProgram.Extract (System.IO.DirectoryInfo dir) [0x000ae] in /home/andres1210/Code/bansheeGTK3/build/GSettingsSchemaExtractor.cs:48
      at GSettingsSchemaExtractorProgram.Main (System.String[] args) [0x0004f] in /home/andres1210/Code/bansheeGTK3/build/GSettingsSchemaExtractor.cs:27
    [ERROR] FATAL UNHANDLED EXCEPTION: System.TypeInitializationException: An exception was thrown by the type initializer for Banshee.Dap.Mtp.MtpSource ---> System.ArgumentException: First component must not be null or empty
    Parameter name: first
      at Hyena.Paths.Combine (System.String first, System.String[] components) [0x0006c] in /home/andres1210/Code/bansheeGTK3/src/Hyena/Hyena/Hyena/Paths.cs:89
      at Banshee.Dap.Mtp.MtpSource..cctor () [0x00000] in /home/andres1210/Code/bansheeGTK3/src/Dap/Banshee.Dap.Mtp/Banshee.Dap.Mtp/MtpSource.cs:266
      --- End of inner exception stack trace ---
      at (wrapper managed-to-native) System.Reflection.MonoField:GetValueInternal (System.Reflection.MonoField,object)
      at System.Reflection.MonoField.GetValue (System.Object obj) [0x0006a] in /home/andres1210/Code/mono/mcs/class/corlib/System.Reflection/MonoField.cs:125
      at GSettingsSchemaExtractorProgram.Extract (IEnumerable`1 types) [0x000ad] in /home/andres1210/Code/bansheeGTK3/build/GSettingsSchemaExtractor.cs:78
      at GSettingsSchemaExtractorProgram.Extract (System.IO.DirectoryInfo dir) [0x000ae] in /home/andres1210/Code/bansheeGTK3/build/GSettingsSchemaExtractor.cs:48
      at GSettingsSchemaExtractorProgram.Main (System.String[] args) [0x0004f] in /home/andres1210/Code/bansheeGTK3/build/GSettingsSchemaExtractor.cs:27

 .../Banshee.Dap.Mtp/Banshee.Dap.Mtp/MtpSource.cs   |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/src/Dap/Banshee.Dap.Mtp/Banshee.Dap.Mtp/MtpSource.cs b/src/Dap/Banshee.Dap.Mtp/Banshee.Dap.Mtp/MtpSource.cs
index 766f066..652776d 100644
--- a/src/Dap/Banshee.Dap.Mtp/Banshee.Dap.Mtp/MtpSource.cs
+++ b/src/Dap/Banshee.Dap.Mtp/Banshee.Dap.Mtp/MtpSource.cs
@@ -263,7 +263,7 @@ namespace Banshee.Dap.Mtp
             get { return !(IsAdding || IsDeleting); }
         }
 
-        private static SafeUri empty_file = new SafeUri (Paths.Combine (Paths.ApplicationCache, "mtp.mp3"));
+        private SafeUri empty_file = new SafeUri (Paths.Combine (Paths.ApplicationCache, "mtp.mp3"));
         protected override void OnTracksDeleted ()
         {
             // Hack to get the disk usage indicate to be accurate, which seems to



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