changeset 1555:56536f498eb8 trunk

[svn] - sanity checking for saving
author nenolod
date Thu, 10 Aug 2006 19:04:17 -0700
parents 51c1bf500d3f
children ec4d858524fa
files ChangeLog audacious/playlist.c
diffstat 2 files changed, 15 insertions(+), 22 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Thu Aug 10 19:03:21 2006 -0700
+++ b/ChangeLog	Thu Aug 10 19:04:17 2006 -0700
@@ -1,3 +1,15 @@
+2006-08-11 02:03:21 +0000  William Pitcock <nenolod@nenolod.net>
+  revision [2022]
+  - some experimental shit
+  
+
+  Changes:        Modified:
+  +1 -0           trunk/audacious/Makefile  
+  +12 -48         trunk/audacious/playlist.c  
+  +4 -0           trunk/audacious/playlist.h  
+  +100 -0         trunk/audacious/playlist_pls.c  
+
+
 2006-08-11 01:49:44 +0000  William Pitcock <nenolod@nenolod.net>
   revision [2020]
   - saving now uses PlaylistContainer class.
--- a/audacious/playlist.c	Thu Aug 10 19:03:21 2006 -0700
+++ b/audacious/playlist.c	Thu Aug 10 19:04:17 2006 -0700
@@ -1287,28 +1287,6 @@
     PLAYLIST_UNLOCK();
 }
 
-static void
-playlist_save_pls(FILE * file)
-{
-    GList *node;
-
-    g_return_if_fail(file != NULL);
-
-    g_fprintf(file, "[playlist]\n");
-    g_fprintf(file, "NumberOfEntries=%d\n", playlist_get_length());
-
-    PLAYLIST_LOCK();
-    
-    for (node = playlist; node; node = g_list_next(node)) {
-        PlaylistEntry *entry = PLAYLIST_ENTRY(node->data);
-        
-        g_fprintf(file, "File%d=%s\n", g_list_position(playlist, node) + 1,
-                  entry->filename);
-    }
-    
-    PLAYLIST_UNLOCK();
-}
-
 gboolean
 playlist_save(const gchar * filename)
 {
@@ -1324,6 +1302,9 @@
     if ((plc = playlist_container_find(ext)) == NULL)
         return FALSE;
 
+    if (plc->plc_write == NULL)
+        return FALSE;
+
     plc->plc_write(filename, 0);
 
     return TRUE;