Author: abock
Date: 2007-03-30 13:39:33 -0500 (Fri, 30 Mar 2007)
New Revision: 75225

Modified:
   trunk/ipod-sharp/ChangeLog
   trunk/ipod-sharp/src/TrackDatabase.cs
Log:
2007-03-30  Aaron Bockover  <[EMAIL PROTECTED]>

    * src/TrackDatabase.cs: do not copy iTunesDB if read only (HFS+)



Modified: trunk/ipod-sharp/ChangeLog
===================================================================
--- trunk/ipod-sharp/ChangeLog  2007-03-30 18:36:34 UTC (rev 75224)
+++ trunk/ipod-sharp/ChangeLog  2007-03-30 18:39:33 UTC (rev 75225)
@@ -1,3 +1,7 @@
+2007-03-30  Aaron Bockover  <[EMAIL PROTECTED]>
+
+       * src/TrackDatabase.cs: do not copy iTunesDB if read only (HFS+)
+
 2007-03-29  James Willcox  <[EMAIL PROTECTED]>
 
        * src/TrackDatabase.cs: add write support for this new album list

Modified: trunk/ipod-sharp/src/TrackDatabase.cs
===================================================================
--- trunk/ipod-sharp/src/TrackDatabase.cs       2007-03-30 18:36:34 UTC (rev 
75224)
+++ trunk/ipod-sharp/src/TrackDatabase.cs       2007-03-30 18:39:33 UTC (rev 
75225)
@@ -1749,7 +1749,7 @@
         internal TrackDatabase (Device device, bool createFresh) {
             this.device = device;
             
-            if(createFresh && File.Exists(TrackDbPath)) {
+            if(createFresh && File.Exists(TrackDbPath) && device.CanWrite) {
                 File.Copy (TrackDbPath, TrackDbBackupPath, true);
             }
 
@@ -2058,7 +2058,7 @@
                 SaveStarted (this, new EventArgs ());
 
             // Back up the current track db
-            if (File.Exists (TrackDbPath))
+            if (File.Exists (TrackDbPath) && device.CanWrite)
                 File.Copy (TrackDbPath, TrackDbBackupPath, true);
             
             try {
@@ -2124,7 +2124,7 @@
                 Mono.Unix.Native.Syscall.sync ();
             } catch (Exception e) {
                 // rollback the track db
-                if (File.Exists (TrackDbBackupPath))
+                if (File.Exists (TrackDbBackupPath) && device.CanWrite)
                     File.Copy (TrackDbBackupPath, TrackDbPath, true);
 
                 throw new DatabaseWriteException (e, "Failed to save 
database");

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to