Bug 113020 - Playlists / podcasts are gone when restarting Amarok
Summary: Playlists / podcasts are gone when restarting Amarok
Status: RESOLVED FIXED
Alias: None
Product: amarok
Classification: Applications
Component: Playlists/Saved Playlists (show other bugs)
Version: 1.3-SVN
Platform: unspecified Linux
: NOR normal (vote)
Target Milestone: ---
Assignee: Amarok Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-09-21 19:44 UTC by M. Philippens
Modified: 2007-06-08 00:24 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
patch for playlistbrowser.cpp (2.29 KB, patch)
2005-09-22 20:49 UTC, Matthieu Bedouet
Details

Note You need to log in before you can comment on or make changes to this bug.
Description M. Philippens 2005-09-21 19:44:31 UTC
Version:           1.3-SVN (using KDE 3.4.91 (beta1, >= 20050910), compiled sources)
Compiler:          Target: i586-suse-linux
OS:                Linux (i686) release 2.6.13-9-smp

I've added several podcasts or playlists. They all show up in the playlist browser sidebar. After a restart of Amarok all the podcasts and playlists are gone.
 
In ~/.kde/share/apps/amarok/podcasts the entries for the podcasts are available, same in
~/.kde/share/apps/amarok/playlists for the the playlists.

A thing which I noticed is that ~/.kde/share/apps/amarok/podcastbrowser_save.xml & ~/.kde/share/apps/amarok/playlistbrowser_save.xml don't contain any information about the saved podcasts / playlists, they only contain the following:

<?xml version="1.0" encoding="utf-8"?>

I would expect the files should contain more.

BTW. Keep up the good work :)
Comment 1 Sebastian Gröhn 2005-09-21 22:36:02 UTC
I have the same problem, with all items in the playlist browser sidebar. I updated to v 1.3.1 a couple of days ago but the problem arose yesterday, so as far as I can see the upgrade is not the problem.
I run Debian Sid.
Comment 2 news.cw 2005-09-22 10:50:10 UTC
I have the same problem. It seems to be related to the latest Qt3 update in Debian SID. Once I installed the 3.3.5-1 build of Debian's Qt3 packages, all playlists were gone after restarting amaroK (tested with amaroK 1.3.1, 1.3.2 and an SVN snaphshot somewhere inbetween). It doesn't matter, whether amaroK is built against libqt3-mt-dev 3.3.4-8 or libqt3-mt-dev 3.3.5-1. amaroK always forgets about its playlists, whenever it runs with the Qt 3.3.5-1 libs installed. Reverting to 3.3.4-8 fixes the problem (after rescanning the collection).
Comment 3 Seb Ruiz 2005-09-22 14:04:07 UTC
Wow, wonder what happened there... I didnt think they would change the API as such.  I'll have a look.
Comment 4 Matthieu Bedouet 2005-09-22 20:49:23 UTC
Created attachment 12666 [details]
patch for playlistbrowser.cpp
Comment 5 Matthieu Bedouet 2005-09-22 20:51:24 UTC
QDomDocument behaviour has changed in qt3.3.5:
- QDom
        The default constructor for QDocDocument now creates an empty
        document that can be used to create elements.

appendChild doesn't work on empty QDomDocument objects, the node has to be imported first.
Comment 6 Mark Kretschmann 2005-09-22 21:38:25 UTC
SVN commit 463041 by markey:

FIX:  Playlists / Podcasts were gone when restarting amaroK (with Qt 3.3.5).
      Patch by Matthieu Bedouet <mbedouet@no-log.org>.

BUG: 113020



 M  +2 -0      ChangeLog  
 M  +10 -6     src/playlistbrowser.cpp  


--- trunk/extragear/multimedia/amarok/ChangeLog #463040:463041
@@ -15,6 +15,8 @@
       by dragging it. Patch by Eyal Lotem <eyal.lotem@gmail.com>. (BR 103990)
 
   BUGFIXES:
+    * Playlists / Podcasts were gone when restarting amaroK (with Qt 3.3.5).
+      Patch by Matthieu Bedouet <mbedouet@no-log.org>. (BR 113020)
     * amaroK could crash on startup, if on last exit sorting was enabled in
       the playlist. (BR 113042)
     * Adding entries to a playlist and saving it could duplicate some tracks,
--- trunk/extragear/multimedia/amarok/src/playlistbrowser.cpp #463040:463041
@@ -459,7 +459,8 @@
     streamB.setAttribute( "product", "amaroK" );
     streamB.setAttribute( "version", APP_VERSION );
     streamB.setAttribute( "formatversion", "1.1" );
-    doc.appendChild( streamB );
+    QDomNode streamsNode = doc.importNode( streamB, TRUE );
+    doc.appendChild( streamsNode );
 
     QTextStream stream( &file );
     stream.setEncoding( QTextStream::UnicodeUTF8 );
@@ -659,7 +660,8 @@
     smartB.setAttribute( "product", "amaroK" );
     smartB.setAttribute( "version", APP_VERSION );
     smartB.setAttribute( "formatversion", "1.1" );
-    doc.appendChild( smartB );
+    QDomNode smartplaylistsNode = doc.importNode( smartB, TRUE );
+    doc.appendChild( smartplaylistsNode );
 
     QTextStream smart( &file );
     smart.setEncoding( QTextStream::UnicodeUTF8 );
@@ -768,7 +770,8 @@
     dynamicB.setAttribute( "product", "amaroK" );
     dynamicB.setAttribute( "version", APP_VERSION );
     dynamicB.setAttribute( "formatversion", "1.1" );
-    doc.appendChild( dynamicB );
+    QDomNode dynamicsNode = doc.importNode( dynamicB, TRUE );
+    doc.appendChild( dynamicsNode );
 
     stream.setEncoding( QTextStream::UnicodeUTF8 );
     stream << "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n";
@@ -878,12 +881,12 @@
     podcastB.setAttribute( "product", "amaroK" );
     podcastB.setAttribute( "version", APP_VERSION );
     podcastB.setAttribute( "formatversion", "1.1" );
-    doc.appendChild( podcastB );
+    QDomNode podcastNode = doc.importNode( podcastB, TRUE );
+    doc.appendChild ( podcastNode );
 
     stream.setEncoding( QTextStream::UnicodeUTF8 );
     stream << "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n";
     stream << doc.toString();
-
 }
 
 void PlaylistBrowser::scanPodcasts()
@@ -1149,7 +1152,8 @@
     playlistsB.setAttribute( "product", "amaroK" );
     playlistsB.setAttribute( "version", APP_VERSION );
     playlistsB.setAttribute( "formatversion", "1.1" );
-    doc.appendChild( playlistsB );
+    QDomNode playlistsNode = doc.importNode( playlistsB, TRUE );
+    doc.appendChild( playlistsNode );
 
     QTextStream stream( &file );
     stream.setEncoding( QTextStream::UnicodeUTF8 );
Comment 7 Seb Ruiz 2005-09-23 01:30:36 UTC
Maybe we will have to do this for everything else as well then.

IE, equalizer presets, smart playlist, playlists, and everywhere else we use 
xml files

On Fri, 23 Sep 2005 05:38 am, Mark Kretschmann wrote:
[bugs.kde.org quoted mail]
Comment 8 yoko 2007-06-08 00:24:40 UTC
I just filed #146520 feel free to merge if you think it's the same issue. --yoko