Processing diff /src/steleman/kde-3.4.3/amarok-1.3.1/./amarok/src/analyzers/blockanalyzer.cpp.kde.orig /src/steleman/kde-3.4.3/amarok-1.3.5/./amarok/src/analyzers/blockanalyzer.cpp
***********************************
7a8
> #include "actionclasses.h"   //mousePressEvent
12a14
> #include <kiconloader.h>     //mousePressEvent
437a440,445
>         #if defined HAVE_XMMS || defined HAVE_LIBVISUAL
>         menu.insertSeparator();
>         menu.insertItem( SmallIconSet( "visualizations" ), i18n("&Visualizations"),
>             0 );
>         #endif
> 
440c448,450
<         if( id != -1 ) {
---
>         if( id == 0 )
>             amaroK::Menu::instance()->slotActivated( amaroK::Menu::ID_SHOW_VIS_SELECTOR );
>         else if( id != -1 ) {
***********************************
Processing diff /src/steleman/kde-3.4.3/amarok-1.3.1/./amarok/src/analyzers/baranalyzer.cpp.kde.orig /src/steleman/kde-3.4.3/amarok-1.3.5/./amarok/src/analyzers/baranalyzer.cpp
***********************************
***********************************
Processing diff /src/steleman/kde-3.4.3/amarok-1.3.1/./amarok/src/analyzers/glanalyzer2.cpp.kde.orig /src/steleman/kde-3.4.3/amarok-1.3.5/./amarok/src/analyzers/glanalyzer2.cpp
***********************************
240c240
< 	drawDot( 0, 0, 10 >? (10.0 * frame.energy) );
---
> 	drawDot( 0, 0, kMax(10.0,(10.0 * frame.energy)) );
242c242
< 	drawDot( 6, 0, 10 >? (5.0 * frame.energy) );
---
> 	drawDot( 6, 0, kMax(10.0, (5.0 * frame.energy)) );
244c244
< 	drawDot( -6, 0, 10 >? (5.0 * frame.energy) );
---
> 	drawDot( -6, 0, kMax(10.0, (5.0 * frame.energy)) );
***********************************
Processing diff /src/steleman/kde-3.4.3/amarok-1.3.1/./amarok/src/analyzers/boomanalyzer.cpp.kde.orig /src/steleman/kde-3.4.3/amarok-1.3.5/./amarok/src/analyzers/boomanalyzer.cpp
***********************************
***********************************
Processing diff /src/steleman/kde-3.4.3/amarok-1.3.1/./amarok/src/engine/xine/xine-engine.cpp.kde.orig /src/steleman/kde-3.4.3/amarok-1.3.5/./amarok/src/engine/xine/xine-engine.cpp
***********************************
11a12,13
> #define DEBUG_PREFIX "xine-engine"
> 
50c52
< };
---
> }
203a206
>        setEqualizerParameters( m_intPreamp, m_equalizerGains );
385d387
<     debug() << "eq setting " << *it << endl;
388d389
<     debug() << "eq setting " << *it << endl;
390d390
<     debug() << "eq setting " << *it << endl;
392d391
<     debug() << "eq setting " << *it << endl;
394d392
<     debug() << "eq setting " << *it << endl;
396d393
<     debug() << "eq setting " << *it << endl;
398d394
<     debug() << "eq setting " << *it << endl;
400d395
<     debug() << "eq setting " << *it << endl;
402d396
<     debug() << "eq setting " << *it << endl;
404d397
<     debug() << "eq setting " << *it << endl;
413,415c406,430
<     //TODO should free the file_extensions char*
<     static QStringList list = QStringList::split( ' ', xine_get_file_extensions( m_xine ) );
< 
---
>     static QStringList list;
>     if(list.isEmpty())
>     {
>         char* exts = xine_get_file_extensions( m_xine );
>         list = QStringList::split( ' ', exts );
>         delete [] exts; exts = NULL;
>         //images
>         list.remove("png");
>         list.remove("jpg");
>         list.remove("jpeg");
>         list.remove("gif");
>         list.remove("ilbm");
>         list.remove("iff");
>         //subtitles
>         list.remove("asc");
>         list.remove("txt");
>         list.remove("sub");
>         list.remove("srt");
>         list.remove("smi");
>         list.remove("ssa");
> //HACK we also check for m4a because xine plays them but
> //for some reason doesn't return the extension
>         if(!list.contains("m4a"))
>             list << "m4a";
>     }
419,422c434
<     //HACK we also check for m4a because xine plays them but
<     //     for some reason doesn't return the extension
< 
<     return ext != "txt" && (list.contains( ext ) || ext =="m4a");
---
>     return list.contains( ext );
552c564
<         Engine::SimpleMetaBundle bundle;
---
>         debug() << "Metadata received." << endl;
553a566
>         Engine::SimpleMetaBundle bundle;
***********************************
Processing diff /src/steleman/kde-3.4.3/amarok-1.3.1/./amarok/src/engine/gst/equalizer/gstequalizer.h.kde.orig /src/steleman/kde-3.4.3/amarok-1.3.5/./amarok/src/engine/gst/equalizer/gstequalizer.h
***********************************
***********************************
Processing diff /src/steleman/kde-3.4.3/amarok-1.3.1/./amarok/src/engine/gst/equalizer/iir_cf.h.kde.orig /src/steleman/kde-3.4.3/amarok-1.3.5/./amarok/src/engine/gst/equalizer/iir_cf.h
***********************************
***********************************
Processing diff /src/steleman/kde-3.4.3/amarok-1.3.1/./amarok/src/amarokcore/crashhandler.cpp.kde.orig /src/steleman/kde-3.4.3/amarok-1.3.5/./amarok/src/amarokcore/crashhandler.cpp
***********************************
73d72
<             QString path = amaroK::saveLocation() + "backtrace";
80a80,82
>             body += i18n( "\n\n\n\n\n\n"
>                     "The information below is to help the developers identify the problem, "
>                     "please do not modify it.\n\n\n\n" );
82c84,86
<             body += "Engine:     %1\n"
---
> 
>             body += "======== DEBUG INFORMATION  =======\n"
>                     "Engine:     %1\n"
95a100
>             body += "\n";
171,179c176,181
<             {   /// write a file to contain the backtrace
<                 //TODO using Qt is dodgy as may depend on corrupted QApplication instance
<                 QFile file( path );
<                 file.open( IO_WriteOnly );
<                 QTextStream( &file )
<                         << "==== file `which amarokapp` =======\n" << fileCommandOutput << "\n\n"
<                         << "==== (gdb) bt =====================\n" << bt << "\n\n"
<                         << "==== kdBacktrace() ================\n" << kdBacktrace();
<             }
---
>             body += "==== file `which amarokapp` =======\n";
>             body += fileCommandOutput + "\n\n";
>             body += "==== (gdb) bt =====================\n";
>             body += bt + "\n\n";
>             body += "==== kdBacktrace() ================\n";
>             body += kdBacktrace();
189c191
<                     /*attachURLs*/  QStringList( path ),
---
>                     /*attachURLs*/  QStringList(),
***********************************
Processing diff /src/steleman/kde-3.4.3/amarok-1.3.1/./amarok/src/amarokcore/amarokdcophandler.cpp.kde.orig /src/steleman/kde-3.4.3/amarok-1.3.5/./amarok/src/amarokcore/amarokdcophandler.cpp
***********************************
5a6,7
>                           (C) 2005 Ian Monroe
>                           (C) 2005 Seb Ruiz
30a33
> #include "playlistbrowser.h"
235a239,243
>     QString DcopPlayerHandler::type()
>     {
>         return EngineController::instance()->bundle().type();
>     }
> 
460,461d467
< 
< 
557a564,616
> // class DcopPlaylistBrowserHandler
> /////////////////////////////////////////////////////////////////////////////////////
> 
>     DcopPlaylistBrowserHandler::DcopPlaylistBrowserHandler()
>         : DCOPObject( "playlistbrowser" )
>         , QObject( kapp )
>     {}
> 
>     void DcopPlaylistBrowserHandler::addPodcast( const QString &url )
>     {
>         PlaylistBrowser::instance()->addPodcast( url );
>     }
> 
>     void DcopPlaylistBrowserHandler::scanPodcasts()
>     {
>         PlaylistBrowser::instance()->scanPodcasts();
>     }
> 
>     void DcopPlaylistBrowserHandler::addPlaylist( const QString &url )
>     {
>         PlaylistBrowser::instance()->addPlaylist( url );
>     }
> 
> /////////////////////////////////////////////////////////////////////////////////////
> // class DcopContextBrowserHandler
> /////////////////////////////////////////////////////////////////////////////////////
> 
>     DcopContextBrowserHandler::DcopContextBrowserHandler()
>         : DCOPObject( "contextbrowser" )
>         , QObject( kapp )
>     {}
> 
>     void DcopContextBrowserHandler::showHome()
>     {
>         ContextBrowser::instance()->showHome();
>     }
> 
>     void DcopContextBrowserHandler::showCurrentTrack()
>     {
>         ContextBrowser::instance()->showCurrentTrack();
>     }
> 
>     void DcopContextBrowserHandler::showLyrics()
>     {
>         ContextBrowser::instance()->showLyrics();
>     }
> 
>     void DcopContextBrowserHandler::showWiki()
>     {
>         ContextBrowser::instance()->showWikipedia();
>     }
> 
> /////////////////////////////////////////////////////////////////////////////////////
611a671,675
>     void DcopCollectionHandler::migrateFile( const QString &oldURL, const QString &newURL )
>     {
>         CollectionDB::instance()->migrateFile( oldURL, newURL );
>     }
> 
655a720,746
>     QString DcopScriptHandler::readConfig(const QString& key)
>     {
>         QString cleanKey = key;
>         KConfigSkeletonItem* configItem = AmarokConfig::self()->findItem(cleanKey.remove(' '));
>         if (configItem)
>             return configItem->property().toString();
>         else
>             return QString::null;
>     }
> 
>     QStringList DcopScriptHandler::readListConfig(const QString& key)
>     {
>         QString cleanKey = key;
>         KConfigSkeletonItem* configItem = AmarokConfig::self()->findItem(cleanKey.remove(' '));
>         QStringList stringList;
>         if(configItem)
>         {
>             QValueList<QVariant> variantList = configItem->property().toList();
>             QValueList<QVariant>::Iterator it = variantList.begin();
>             while(it != variantList.end())
>             {
>                 stringList << (*it).toString();
>                 ++it;
>             }
>         }
>         return stringList;
>     }
***********************************
Processing diff /src/steleman/kde-3.4.3/amarok-1.3.1/./amarok/src/ipod/itunesdb/itunesdbparser.cpp.kde.orig /src/steleman/kde-3.4.3/amarok-1.3.5/./amarok/src/ipod/itunesdb/itunesdbparser.cpp
***********************************
128,129c128
<             uint datalen = blocklen - 40;
<             QByteArray buffer( datalen+2 );
---
>             uint ucs2len = ( blocklen - 40 ) / sizeof( Q_UINT16 );
133,137d131
<             seekRelative(stream, 24);    // skip stuff
<             stream.readRawBytes(buffer.data(), datalen);
<             buffer[datalen] = 0;
<             buffer[datalen + 1] = 0;
< 
140a135,145
>             unsigned short* buffer = new unsigned short[ucs2len+1];
> 
>             seekRelative(stream, 24);    // skip stuff
>             for ( int i = 0; i < ucs2len; ++i ) {
>               Q_UINT16 h;
>               stream >> h;
>               buffer[i] = h;
>             }
> 
>             buffer[ucs2len]= 0;
> 
142c147,149
<                 listitem->setItemProperty( QString::fromUcs2( (unsigned short *)buffer.data()), (ItemProperty)type);
---
>                 listitem->setItemProperty( QString::fromUcs2(buffer), (ItemProperty)type);
> 
>             delete [] buffer;
145d151
< 
***********************************
Processing diff /src/steleman/kde-3.4.3/amarok-1.3.1/./amarok/src/ipod/itunesdb.cpp.kde.orig /src/steleman/kde-3.4.3/amarok-1.3.5/./amarok/src/ipod/itunesdb.cpp
***********************************
62c62
< bool ITunesDB::writeDatabase(const QString& filename) const {
---
> bool ITunesDB::writeDatabase(const QString& filename) {
67c67
<     ItunesDBWriter writer((ItunesDBDataSource&)*this);
---
>     ItunesDBWriter writer(this);
***********************************
Processing diff /src/steleman/kde-3.4.3/amarok-1.3.1/./amarok/src/vis/libvisual/libvisual.cpp.kde.orig /src/steleman/kde-3.4.3/amarok-1.3.5/./amarok/src/vis/libvisual/libvisual.cpp
***********************************
***********************************
Processing diff /src/steleman/kde-3.4.3/amarok-1.3.1/./amarok/src/osd.h.kde.orig /src/steleman/kde-3.4.3/amarok-1.3.5/./amarok/src/osd.h
***********************************
***********************************
Processing diff /src/steleman/kde-3.4.3/amarok-1.3.1/./amarok/src/metabundle.h.kde.orig /src/steleman/kde-3.4.3/amarok-1.3.5/./amarok/src/metabundle.h
***********************************
***********************************
Processing diff /src/steleman/kde-3.4.3/amarok-1.3.1/./amarok/src/app.cpp.kde.orig /src/steleman/kde-3.4.3/amarok-1.3.5/./amarok/src/app.cpp
***********************************
26d25
< 
42a42
> #include "threadweaver.h"
66a67
> #include <qtimer.h>              //showHyperThreadingWarning()
68a70,77
> // For the HyperThreading fix
> #ifdef __linux__
>     #include <features.h>
>     #if defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2,3)
>         #include <errno.h>
>         #include <sched.h>
>     #endif //__GLIBC_PREREQ && __GLIBC_PREREQ(2,3)
> #endif //__linux__
83a93,94
>     new amaroK::DcopPlaylistBrowserHandler();
>     new amaroK::DcopContextBrowserHandler();
142a154,155
>     fixHyperThreading();
> 
185a199,201
>     CollectionDB::instance()->stopScan();
>     ThreadWeaver::deleteInstance(); //waits for jobs to finish
> 
203a220
>     static char cwd[PATH_MAX];
205a223,229
>     if ( args->isSet( "cwd" ) )
>     {
>         strncpy(cwd, args->getOption( "cwd" ), sizeof(cwd) );
>         cwd[sizeof(cwd)-1] = '\0';
>         KCmdLineArgs::setCwd( cwd );
>     }
> 
282a307
>             { "cwd <directory>", I18N_NOOP( "Base for relative filenames/URLs" ), 0 },
349a375,447
> 
> void App::fixHyperThreading()
> {
>     // Workaround for stability issues with HyperThreading CPU's, @see BUG 99199.
>     // First we detect the presence of HyperThreading. If active, we bind amarokapp
>     // to the first CPU only (hard affinity).
>     //
>     // @see http://www-128.ibm.com/developerworks/linux/library/l-affinity.html
>     // @see http://www.linuxjournal.com/article/6799
>     // (articles on processor affinity with the linux kernel)
> 
>     DEBUG_BLOCK
> 
>     #ifdef __linux__ 
>     debug() << "SCHEDAFFINITY_SUPPORT enabled. Testing to see if HT fix should be enabled..." << endl;
>     QString line;
>     uint cpuCount = 0;
>     QFile cpuinfo( "/proc/cpuinfo" );
>     if ( cpuinfo.open( IO_ReadOnly ) ) {
>         while ( cpuinfo.readLine( line, 20000 ) != -1 ) {
>             if ( line.startsWith( "flags" ) ) {
>                 const QString flagsLine = line.section( ":", 1 );
>                 const QStringList flags = QStringList::split( " ", flagsLine );
>                 if ( flags.contains( "ht" ) ) ++cpuCount;
>             }
>         }
>     }
>     // If multiple CPUs are listed with the HT flag, we got HyperThreading enabled
>     if ( cpuCount > 1 ) {
>         debug() << "CPU with active HyperThreading detected. Enabling WORKAROUND.\n";
> 
>         // If the library is new enough try and call sched_setaffinity.
>         #if defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2,3) 
>         cpu_set_t mask;
>         CPU_ZERO( &mask ); // Initializes all the bits in the mask to zero
>         CPU_SET( 0, &mask ); // Sets only the bit corresponding to cpu
>         #ifdef SCHEDAFFINITY_SUPPORT
>         if ( sched_setaffinity( 0, sizeof(mask), &mask ) == -1 ) 
>         #else  //SCHEDAFFINITY_SUPPORT
>         if ( sched_setaffinity( 0, &mask ) == -1 )
>         #endif //SCHEDAFFINITY_SUPPORT
>         {
>             warning() << "sched_setaffinity() call failed with error code: " << errno << endl;
>             QTimer::singleShot( 0, this, SLOT( showHyperThreadingWarning() ) );
>             return;
>         }
>         #else //defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2,3)
>              warning()<<"glibc too old (<2.3) for sched_setaffinity" << endl;
>         QTimer::singleShot( 0, this, SLOT( showHyperThreadingWarning() ) );
>         #endif //defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2,3)
>     }
>     else { debug() << "Fix not enabled" << endl; }
>     #else //__linux__
>     debug() << "SCHEDAFFINITY_SUPPORT disabled since this isn't Linux" << endl;
>     #endif //__linux__
> }
> 
> 
> void App::showHyperThreadingWarning() // SLOT
> {
>     const QString text =
>         i18n( "<p>You are using a processor with the <i>HyperThreading</i> "
>               "feature enabled. Please note that amaroK may be unstable with this "
>               "configuration.</p>"
>               "<p>If you are experiencing problems, use the Linux kernel option 'NOHT', "
>               "or disable <i>HyperThreading</i> in your BIOS setup.</p>"
>               "<p>More information can be found in the README file. For further assistance "
>               "join us at #amarok on irc.freenode.net.</p>" );
> 
>     KMessageBox::information( 0, text, i18n( "Warning" ), "showHyperThreadingWarning" );
> }
> 
> 
372c470
<         const QCString qcs = m_codec->fromUnicode( ts.toCString( true ) );
---
>         const QCString qcs = m_codec->fromUnicode( TStringToQString(ts) );
382a481,487
> 
>     ID3v1StringHandler( QTextCodec *codec )
>             : m_codec( codec )
>     {
>         debug() << "codec: " << m_codec << endl;
>         debug() << "codec-name: " << m_codec->name() << endl;
>     }
394a500,501
>     TrackToolTip::instance()->removeFromWidget( m_pTray );
> 
416a524,528
> 
>             //make tray icon behave properly after selecting to show or hide player window
>             m_pTray->engineStateChanged(EngineController::instance()->engine()->state(), EngineController::instance()->engine()->state());
>             m_pTray->engineNewMetaData(EngineController::instance()->bundle(), false);
> 
424a537,538
>         m_pTray->engineStateChanged(EngineController::instance()->engine()->state(), EngineController::instance()->engine()->state());
>         m_pTray->engineNewMetaData(EngineController::instance()->bundle(), false);
426a541,544
>         //Set the caption correctly.
>         if ( !EngineController::instance()->bundle().prettyTitle().isEmpty() )
>             m_pPlaylistWindow->setCaption( "amaroK - " + EngineController::instance()->bundle().veryNiceTitle() );
>         else
427a546,547
> 
> 
441a562
>     TrackToolTip::instance()->addToWidget( m_pTray );
446c567,568
<     if( AmarokConfig::recodeID3v1Tags() && AmarokConfig::recodeEncoding() > 0 )
---
>     if( AmarokConfig::recodeID3v1Tags() )
>     if( AmarokConfig::recodeEncoding() > 0 )
447a570,572
>     else
>         // otherwise the locale encoding is used
>         TagLib::ID3v1::Tag::setStringHandler( new ID3v1StringHandler( QTextCodec::codecForLocale() ) );
675c800
<             EngineController::instance()->increaseVolume( e->delta() / 18 );
---
>             EngineController::instance()->increaseVolume( e->delta() / amaroK::VOLUME_SENSITIVITY );
719c844
<         QToolTip::add( m_pTray, i18n( "amaroK - rediscover your music" ) );
---
>         TrackToolTip::instance()->clear();
744d868
< 
751c875
<     TrackToolTip::add( m_pTray, bundle, EngineController::instance()->engine()->position() );
---
>     TrackToolTip::instance()->setTrack( bundle );
756c880
<     TrackToolTip::add( m_pTray, EngineController::instance()->bundle(), position );
---
>     TrackToolTip::instance()->setPos( position );
872,873d995
<     // TODO Offer the option to refresh the images, instead of deleting
< 
902c1024
<                 "Please note that this only affects covers downloaded using the Cover Manager's fetch covers feature and the covers downloaded using the context menu in the Context Browser, not manually added covers." ) );
---
>                 "Please note that this only affects covers downloaded using the Cover Manager's fetch covers feature and the covers downloaded using the context menu in the Context Browser, not manually added covers." ), KDE::StatusBar::Information );
***********************************
Processing diff /src/steleman/kde-3.4.3/amarok-1.3.1/./amarok/src/app.h.kde.orig /src/steleman/kde-3.4.3/amarok-1.3.5/./amarok/src/app.h
***********************************
40d39
< 
52d50
< 
58a57,59
>     private slots:
>         void showHyperThreadingWarning();
> 
68a70,72
>         /** Workaround for HyperThreading CPU's, @see BUG 99199 */
>         void fixHyperThreading();
> 
***********************************
Processing diff /src/steleman/kde-3.4.3/amarok-1.3.1/./amarok/src/browserbar.cpp.kde.orig /src/steleman/kde-3.4.3/amarok-1.3.5/./amarok/src/browserbar.cpp
***********************************
96c96
<     config->writeEntry( "CurrentPane", m_currentIndex != -1 ? currentBrowser()->name() : QString::null );
---
>     config->writeEntry( "CurrentPane", m_currentIndex != -1 ? QString(currentBrowser()->name()) : QString::null );
219a220
>     connect( tab, SIGNAL(initiateDrag ( int ) ), this, SLOT( showBrowser( int )) );
333,334d333
<         debug() << "HELLO\n";
< 
***********************************
Processing diff /src/steleman/kde-3.4.3/amarok-1.3.1/./amarok/src/equalizergraph.cpp.kde.orig /src/steleman/kde-3.4.3/amarok-1.3.5/./amarok/src/equalizergraph.cpp
***********************************
164c164
<     float u[n * sizeof(float)];
---
>     QMemArray<float> u(n * sizeof(float));
***********************************
Processing diff /src/steleman/kde-3.4.3/amarok-1.3.1/./amarok/src/mediabrowser.cpp.kde.orig /src/steleman/kde-3.4.3/amarok-1.3.5/./amarok/src/mediabrowser.cpp
***********************************
24a25
> #include <qtimer.h>
296c297
<     if ( childCount() == 0 )
---
>     if ( !m_parent->m_connectButton->isOn() )
423c424
<     m_connectButton->setOn( m_deviceList->childCount() != 0 );
---
>     m_connectButton->setOn( m_device->isConnected() ||  m_deviceList->childCount() != 0 );
431a433,455
>     connect( m_transferList, SIGNAL( rightButtonPressed( QListViewItem*, const QPoint&, int ) ),
>              this,   SLOT( slotShowContextMenu( QListViewItem*, const QPoint&, int ) ) );}
> 
> void
> MediaDeviceView::slotShowContextMenu( QListViewItem* item, const QPoint& point, int )
> {
>     if ( item )
>     {
>         KPopupMenu menu( this );
> 
>         enum Actions { REMOVE_SELECTED, CLEAR_ALL };
> 
>         menu.insertItem( SmallIconSet( "edittrash" ), i18n( "&Remove From Queue" ), REMOVE_SELECTED );
>         menu.insertItem( SmallIconSet( "view_remove" ), i18n( "&Clear Queue" ), CLEAR_ALL );
> 
>         switch( menu.exec( point ) )
>         {
>             case REMOVE_SELECTED:
>                 m_device->removeSelected();
>                 break;
>             case CLEAR_ALL:
>                 m_device->clearItems();
>                 break;
432a457,458
>     }
> }
505c531
<         m_parent->m_transferButton->setDisabled( false );
---
>         m_parent->m_transferButton->setEnabled( m_parent->m_device->isConnected() || m_parent->m_deviceList->childCount() != 0 );
507c533
<         amaroK::StatusBar::instance()->longMessage( i18n( "Track already exists on iPod: " + url.path().local8Bit() ) );
---
>         amaroK::StatusBar::instance()->longMessage( i18n( "Track already exists on iPod: " + url.path().local8Bit() ), KDE::StatusBar::Sorry );
515c541
<             addURL( (*it).path() );
---
>             addURL( *it );
608a635,658
> MediaDevice::clearItems()
> {
>     m_parent->m_transferList->clear();
>     m_transferURLs.clear();
>     m_parent->m_stats->setText( i18n( "0 tracks in queue" ) );
>     m_parent->m_transferButton->setEnabled( false );
> }
> 
> void
> MediaDevice::removeSelected()
> {
>     QPtrList<QListViewItem>  selected = m_parent->m_transferList->selectedItems();
> 
>     for( QListViewItem *item = selected.first(); item; item = selected.next() )
>     {
>         m_transferURLs.remove( item->text( 0 ) );
>         m_parent->m_transferList->takeItem( item );
>         delete item;
>     }
>     m_parent->m_transferButton->setEnabled( m_parent->m_transferList->childCount() != 0 );
>     m_parent->m_stats->setText( i18n( "1 track in queue", "%n tracks in queue", m_parent->m_transferList->childCount() ) );
> }
> 
> void
759c809,816
<     int button = KMessageBox::warningContinueCancel( m_parent->m_parent,
---
> 
>     //Enable after string freeze.
>     //m_parent->m_stats->setText( i18n( "1 track to be deleted", "%n tracks to be deleted", count ) );
>     m_parent->m_progress->setProgress( 0 );
>     m_parent->m_progress->setTotalSteps( count );
>     m_parent->m_progress->show();
> 
>     int button = KMessageBox::warningContinueCancel( m_parent,
768a826
> 
771,772c829,832
<             QFile::remove( (*it).path() );
< 
---
>         {
>             m_parent->m_progress->setProgress( m_parent->m_progress->progress() + 1 );
>             KIO::del( *it, false, false );
>         }
782a843,845
>     QTimer::singleShot( 1500, m_parent->m_progress, SLOT(hide()) );
>     //Enable after string freeze
>     //m_parent->m_stats->setText( i18n( "1 track in queue", "%n tracks in queue", m_parent->m_transferList->childCount() ) );
851c914,915
<     if ( m_parent->m_connectButton->isOn() ){
---
>     if ( m_parent->m_connectButton->isOn() )
>     {
860c924
<         if( m_parent->m_deviceList->childCount() != 0 )
---
>         if( isConnected() || m_parent->m_deviceList->childCount() != 0 )
862a927,935
>             if ( m_parent->m_transferList->childCount() != 0 )
>             {
>                 m_parent->m_transferButton->setEnabled( true );
>                 //Enable after string freeze
>                 //m_parent->m_stats->setText( i18n( "Checking device for duplicate files." ) );
>                 KURL::List urls;
>                 urls = m_transferURLs;
>                 clearItems();
>                 addURLs( urls );
863a937
>         }
865a940
>             m_parent->m_connectButton->setOn( false );
869d943
<             m_parent->m_connectButton->setOn( false );
872c946,947
<     else{
---
>     else
>     {
883a959
> 
886a963
> 
891a969
> 
895,896c973
<         KMessageBox::error( m_parent->m_parent,
<             text, i18n( "Media Device Browser" ) );
---
>         KMessageBox::information( m_parent->m_parent, text, i18n( "Media Device Browser" ) );
***********************************
Processing diff /src/steleman/kde-3.4.3/amarok-1.3.1/./amarok/src/contextbrowser.cpp.kde.orig /src/steleman/kde-3.4.3/amarok-1.3.5/./amarok/src/contextbrowser.cpp
***********************************
21a22
> #include "mediabrowser.h"
87c88
<         : QTabWidget( 0, name )
---
>         : KTabWidget( 0, name )
467a469,471
>     if( state != Engine::Paused /*pause*/ && oldState != Engine::Paused /*resume*/)
>     {
>         // Pause shouldn't clear everything
472a477
>     }
528c533
<     QTabWidget::paletteChange( pal );
---
>     KTabWidget::paletteChange( pal );
531a537,539
> //////////////////////////////////////////////////////////////////////////////////////////
> // PROTECTED SLOTS
> //////////////////////////////////////////////////////////////////////////////////////////
532a541,564
> //parts of this function from ktabwidget.cpp, copyright (C) 2003 Zack Rusin and Stephan Binner
> //fucking setCurrentTab() isn't virtual so we have to override this instead =(
> void ContextBrowser::wheelDelta( int delta )
> {
>     if ( count() < 2 || delta == 0 )
>         return;
> 
>     int index = currentPageIndex(), start = index;
>     do
>     {
>         if( delta < 0 )
>             index = (index + 1) % count();
>         else
>         {
>             index = index - 1;
>             if( index < 0 )
>                 index = count() - 1;
>         }
>         if( index == start ) // full circle, none enabled
>             return;
>     } while( !isTabEnabled( page( index ) ) );
>     setCurrentPage( index );
> }
> 
553c585
<     enum { SHOW, FETCH, CUSTOM, DELETE, APPEND, ASNEXT, MAKE, INFO, MANAGER, TITLE };
---
>     enum { SHOW, FETCH, CUSTOM, DELETE, APPEND, ASNEXT, MAKE, MEDIA_DEVICE, INFO, MANAGER, TITLE };
596c628
< 
---
>         menu.insertItem( SmallIconSet( "fileopen" ), i18n( "&Load" ), MAKE );
599c631,632
<         menu.insertItem( SmallIconSet( "player_playlist_2" ), i18n( "&Make Playlist" ), MAKE );
---
>         if( MediaDevice::instance()->isConnected() )
>             menu.insertItem( SmallIconSet( "usbpendrive_unmount" ), i18n( "Add to Media Device &Transfer Queue" ), MEDIA_DEVICE );
622a656,657
>             menu.changeItem( INFO,   i18n("Edit Album &Information..." ) );
>             menu.changeItem( ASNEXT, i18n("&Queue Album") );
640a676,677
>             menu.changeItem( INFO,   i18n("Edit Album &Information..." ) );
>             menu.changeItem( ASNEXT, i18n("&Queue Album") );
701a739,742
>     case MEDIA_DEVICE:
>         MediaDevice::instance()->addURLs( urls );
>         break;
> 
972c1013
<                                         "<span class='album-song-title'>" + albumValues[j] + "</span>&nbsp;"
---
>                                         "<span class='album-song-title'>" + escapeHTML( albumValues[j] ) + "</span>&nbsp;"
1098,1099c1139,1140
<                             "<span class='song-title'>" + lastplayed[i] + "</span><br />"
<                             "<span class='song-artist'>" + lastplayed[i + 2] + "</span>"
---
>                             "<span class='song-title'>" + escapeHTML( lastplayed[i] ) + "</span><br />"
>                             "<span class='song-artist'>" + escapeHTML( lastplayed[i + 2] ) + "</span>"
1106c1147
<                     "</span><span class='song-album'>" + lastplayed[i + 3] + "</span>"
---
>                     "</span><span class='song-album'>" + escapeHTML( lastplayed[i + 3] ) + "</span>"
1152,1153c1193,1194
<                                             "<span class='song-title'>" + fave[i] + "</span><br /> "
<                                             "<span class='song-artist'>" + fave[i + 3] + "</span>" );
---
>                                             "<span class='song-title'>" + escapeHTML( fave[i] ) + "</span><br /> "
>                                             "<span class='song-artist'>" + escapeHTML( fave[i + 3] ) + "</span>" );
1158c1199
<                                          "</span><span class='song-album'>"+ fave[i + 4] +"</span>" );
---
>                                          "</span><span class='song-album'>"+ escapeHTML( fave[i + 4] ) +"</span>" );
1198,1199c1239,1240
<                         "<span class='song-title'>" + newest[i] + "</span><br />"
<                         "<span class='song-artist'>" + newest[i + 2] + "</span>"
---
>                         "<span class='song-title'>" + escapeHTML( newest[i] ) + "</span><br />"
>                         "<span class='song-artist'>" + escapeHTML( newest[i + 2] ) + "</span>"
1206c1247
<                 "</span><span class='song-album'>" + newest[i + 3] + "</span>"
---
>                 "</span><span class='song-album'>" + escapeHTML( newest[i + 3] ) + "</span>"
1620c1661
<     if ( !CollectionDB::instance()->isFileInCollection( currentTrack.url().path() ) )
---
>     if ( currentTrack.url().isLocalFile() && !CollectionDB::instance()->isFileInCollection( currentTrack.url().path() ) )
1661c1702
<                             "<span class='album-song-title'>" + it.data().getTitle() + "</span>"
---
>                             "<span class='album-song-title'>" + escapeHTML( it.data().getTitle() ) + "</span>"
1665c1706
<                             "<span class='album-song-title'>" + it.data().getArtist() + "</span>"
---
>                             "<span class='album-song-title'>" + escapeHTML( it.data().getArtist() ) + "</span>"
1734c1775
<                             "<span class='album-song-title'>"+ values[i + 2] + "</span>"
---
>                             "<span class='album-song-title'>"+ escapeHTML( values[i + 2] ) + "</span>"
1737c1778
<                 "</span><span class='album-song-title'>" + values[i + 1] + "</span>"
---
>                 "</span><span class='album-song-title'>" + escapeHTML( values[i + 1] ) + "</span>"
1787c1828
<                             "<span class='album-song-title'>" + values[i] + "</span>"
---
>                             "<span class='album-song-title'>" + escapeHTML( values[i] ) + "</span>"
1921c1962
<                                 "<span class='album-song-title'>" + albumValues[j] + "</span>&nbsp;"
---
>                                 "<span class='album-song-title'>" + escapeHTML( albumValues[j] ) + "</span>&nbsp;"
2046c2087
<                         "<span class='album-song-title'>" + albumValues[j + 5] + i18n(" - ") + albumValues[j] + "</span>&nbsp;"
---
>                         "<span class='album-song-title'>" + escapeHTML( albumValues[j + 5] ) + i18n(" - ") + escapeHTML( albumValues[j] ) + "</span>&nbsp;"
2336c2377
< // <chris at chris.de>, <seb100 at optusnet.com.au>
---
> // <chris at chris.de>, <me at sebruiz.net>
2345c2386
<         showPage( m_homePage->view() );
---
>         showPage( m_lyricsTab );
2355a2397,2444
> 
>     //remove all matches to the regExp and the song production type.
>     //NOTE: use i18n'd and english equivalents since they are very common int'lly.
>     QString replaceMe = " \\([^}]*%1[^}]*\\)";
>     QStringList production;
>     production << i18n( "live" ) << i18n( "acoustic" ) << i18n( "cover" ) << i18n( "mix" )
>                << i18n( "edit" ) << i18n( "medley" ) << i18n( "unplugged" ) << i18n( "bonus" )
>                << QString( "live" ) << QString( "acoustic" ) << QString( "cover" ) << QString( "mix" )
>                << QString( "edit" ) << QString( "medley" ) << QString( "unplugged" ) << QString( "bonus" );
> 
>     QString title  = EngineController::instance()->bundle().title();
> 
>     if ( title.isEmpty() ) {
>         /* If title is empty, try to use pretty title.
>            The fact that it often (but not always) has artist name together, can be bad,
>            but at least the user will get nice suggestions. */
>         title = EngineController::instance()->bundle().prettyTitle();
>     }
> 
>     for ( uint x = 0; x < production.count(); ++x )
>     {
>         QRegExp re = replaceMe.arg( production[x] );
>         re.setCaseSensitive( false );
>         title.remove( re );
>     }
> 
>     if ( !hash.isEmpty() && hash != QString( "reload" ) )
>         m_lyricCurrentUrl = QString( "http://lyrc.com.ar/en/tema1en.php?hash=%1" )
>                   .arg( hash );
>     else
>         m_lyricCurrentUrl = QString( "http://lyrc.com.ar/en/tema1en.php?artist=%1&songname=%2" )
>                 .arg(
>                 KURL::encode_string_no_slash( EngineController::instance()->bundle().artist() ),
>                 KURL::encode_string_no_slash( title ) );
> 
>     debug() << "Using this url: " << m_lyricCurrentUrl << endl;
> 
>     m_lyricAddUrl = QString( "http://lyrc.com.ar/en/add/add.php?grupo=%1&tema=%2&disco=%3&ano=%4" ).arg(
>             KURL::encode_string_no_slash( EngineController::instance()->bundle().artist() ),
>             KURL::encode_string_no_slash( title ),
>             KURL::encode_string_no_slash( EngineController::instance()->bundle().album() ),
>             KURL::encode_string_no_slash( EngineController::instance()->bundle().year() ) );
>     m_lyricSearchUrl = QString( "http://www.google.com/search?ie=UTF-8&q=lyrics %1 %2" )
>         .arg( KURL::encode_string_no_slash( '"'+EngineController::instance()->bundle().artist()+'"', 106 /*utf-8*/ ),
>               KURL::encode_string_no_slash( '"'+title+'"', 106 /*utf-8*/ ) );
> 
>     m_lyricsToolBar->getButton( LYRICS_BROWSER )->setEnabled(false);
> 
2377d2465
<         return;
2397,2437d2484
<     }
< 
<     //remove all matches to the regExp and the song production type.
<     //NOTE: use i18n'd and english equivalents since they are very common int'lly.
<     QString replaceMe = " \\([^}]*%1[^}]*\\)";
<     QStringList production;
<     production << i18n( "live" ) << i18n( "acoustic" ) << i18n( "cover" ) << i18n( "mix" )
<                << i18n( "edit" ) << i18n( "medley" ) << i18n( "unplugged" ) << i18n( "bonus" )
<                << QString( "live" ) << QString( "acoustic" ) << QString( "cover" ) << QString( "mix" )
<                << QString( "edit" ) << QString( "medley" ) << QString( "unplugged" ) << QString( "bonus" );
< 
<     QString title  = EngineController::instance()->bundle().title();
< 
<     for ( uint x = 0; x < production.count(); ++x )
<     {
<         QRegExp re = replaceMe.arg( production[x] );
<         re.setCaseSensitive( false );
<         title.remove( re );
<     }
< 
<     if ( !hash.isEmpty() && hash != QString( "reload" ) )
<         m_lyricCurrentUrl = QString( "http://lyrc.com.ar/en/tema1en.php?hash=%1" )
<                   .arg( hash );
<     else
<         m_lyricCurrentUrl = QString( "http://lyrc.com.ar/en/tema1en.php?artist=%1&songname=%2" )
<                 .arg(
<                 KURL::encode_string_no_slash( EngineController::instance()->bundle().artist() ),
<                 KURL::encode_string_no_slash( title ) );
< 
<     debug() << "Using this url: " << m_lyricCurrentUrl << endl;
< 
<     m_lyrics = QString::null;
<     m_lyricAddUrl = QString( "http://lyrc.com.ar/en/add/add.php?grupo=%1&tema=%2&disco=%3&ano=%4" ).arg(
<             KURL::encode_string_no_slash( EngineController::instance()->bundle().artist() ),
<             KURL::encode_string_no_slash( title ),
<             KURL::encode_string_no_slash( EngineController::instance()->bundle().album() ),
<             KURL::encode_string_no_slash( EngineController::instance()->bundle().year() ) );
<     m_lyricSearchUrl = QString( "http://www.google.com/search?ie=UTF-8&q=lyrics %1 %2" )
<         .arg( KURL::encode_string_no_slash( '"'+EngineController::instance()->bundle().artist()+'"', 106 /*utf-8*/ ),
<               KURL::encode_string_no_slash( '"'+title+'"', 106 /*utf-8*/ ) );
< 
2444a2492
> }
2450,2451c2498,2524
<     if ( !job->error() == 0 ) {
<         kdWarning() << "[LyricsFetcher] KIO error! errno: " << job->error() << endl;
---
>     if ( !job->error() == 0 )
>     {
>         m_lyricsPage->begin();
>         m_HTMLSource="";
>         m_lyricsPage->setUserStyleSheet( m_styleSheet );
> 
>         m_HTMLSource.append(
>                 "<html>"
>                 "<div id='lyrics_box' class='box'>"
>                     "<div id='lyrics_box-header' class='box-header'>"
>                         "<span id='lyrics_box-header-title' class='box-header-title'>"
>                         + i18n( "Error" ) +
>                         "</span>"
>                     "</div>"
>                     "<div id='lyrics_box-body' class='box-body'><p>"
>                         + i18n( "Lyrics could not be retrieved because the server was not reachable." ) +
>                     "</p></div>"
>                 "</div>"
>                 "</html>"
>                         );
>         m_lyricsPage->write( m_HTMLSource );
>         m_lyricsPage->end();
>         m_dirtyLyricsPage = false;
>         m_lyricJob = NULL;
>         saveHtmlData(); // Send html code to file
> 
>         warning() << "[LyricsFetcher] KIO error! errno: " << job->error() << endl;
2507a2581
>     m_lyricsToolBar->getButton( LYRICS_BROWSER )->setEnabled(true);
2579c2653
<         showPage( m_homePage->view() );
---
>         showPage( m_wikiTab );
2757,2758c2831,2855
<     if ( !job->error() == 0 ) {
<         kdWarning() << "[WikiFetcher] KIO error! errno: " << job->error() << endl;
---
>     if ( !job->error() == 0 )
>     {
>         m_wikiPage->begin();
>         m_HTMLSource="";
>         m_wikiPage->setUserStyleSheet( m_styleSheet );
> 
>     m_HTMLSource.append(
>             "<div id='wiki_box' class='box'>"
>                 "<div id='wiki_box-header' class='box-header'>"
>                     "<span id='wiki_box-header-title' class='box-header-title'>"
>                     + i18n( "Error" ) +
>                     "</span>"
>                 "</div>"
>                 "<div id='wiki_box-body' class='box-body'><p>"
>                     + i18n( "Artist information could not be retrieved because the server was not reachable." ) +
>                 "</p></div>"
>             "</div>"
>                         );
>         m_wikiPage->write( m_HTMLSource );
>         m_wikiPage->end();
>         m_dirtyWikiPage = false;
>         m_wikiPage = NULL;
>         saveHtmlData(); // Send html code to file
> 
>         warning() << "[WikiFetcher] KIO error! errno: " << job->error() << endl;
***********************************
Processing diff /src/steleman/kde-3.4.3/amarok-1.3.1/./amarok/src/mediabrowser.h.kde.orig /src/steleman/kde-3.4.3/amarok-1.3.5/./amarok/src/mediabrowser.h
***********************************
104a105,107
>     private slots:
>         void slotShowContextMenu( QListViewItem* item, const QPoint& point, int );
> 
130a134
>         bool        isConnected() { return m_ipod->isStillConnected(); }
133a138
> 
139a145
>         void clearItems();
140a147,151
>         void deleteFiles( const KURL::List& urls );
>         void deleteFromIPod( MediaItem* item );
>         void ipodConnection();
>         int  mount();
>         void removeSelected();
143d153
<         int mount();
146,148d155
<         void deleteFiles( const KURL::List& urls );
<         void deleteFromIPod( MediaItem* item );
<         void ipodConnection();
163d169
< 
165a172
> 
***********************************
Processing diff /src/steleman/kde-3.4.3/amarok-1.3.1/./amarok/src/smartplaylisteditor.h.kde.orig /src/steleman/kde-3.4.3/amarok-1.3.5/./amarok/src/smartplaylisteditor.h
***********************************
***********************************
Processing diff /src/steleman/kde-3.4.3/amarok-1.3.1/./amarok/src/collectiondb.h.kde.orig /src/steleman/kde-3.4.3/amarok-1.3.5/./amarok/src/collectiondb.h
***********************************
167c167
<         DbConnectionPool();
---
>         DbConnectionPool( bool temporary );
190a191,192
> 
>         bool m_isTemporary;
209c211,212
<         void coverFetched( const QString &artist, const QString &album );
---
>         void coverChanged( const QString &artist, const QString &album ); //whenever a cover changes
>         void coverFetched( const QString &artist, const QString &album ); //only when fetching from amazon
216a220,222
>         CollectionDB( bool temporary = false );
>         ~CollectionDB();
> 
219,223c225,229
<         QString escapeString( const QString &string ) { return m_dbConnPool->escapeString(string); }
<         QString boolT() { if (m_dbConnPool->getDbConnectionType() == DbConnection::postgresql) return "'t'"; else return "1"; }
<         QString boolF() { if (m_dbConnPool->getDbConnectionType() == DbConnection::postgresql) return "'f'"; else return "0"; }
<         QString textColumnType() { if ( m_dbConnPool->getDbConnectionType() == DbConnection::postgresql ) return "TEXT"; else return "VARCHAR(255)"; }
<         QString textColumnType(int length){ if ( m_dbConnPool->getDbConnectionType() == DbConnection::postgresql ) return "TEXT"; else return QString("VARCHAR(%1)").arg(length); }
---
>         const QString escapeString( const QString &string ) { return m_dbConnPool->escapeString(string); }
>         const QString boolT() { if (m_dbConnPool->getDbConnectionType() == DbConnection::postgresql) return "'t'"; else return "1"; }
>         const QString boolF() { if (m_dbConnPool->getDbConnectionType() == DbConnection::postgresql) return "'f'"; else return "0"; }
>         const QString textColumnType() { if ( m_dbConnPool->getDbConnectionType() == DbConnection::postgresql ) return "TEXT"; else return "VARCHAR(255)"; }
>         const QString textColumnType(int length){ if ( m_dbConnPool->getDbConnectionType() == DbConnection::postgresql ) return "TEXT"; else return QString("VARCHAR(%1)").arg(length); }
225,226c231,233
<         QString longTextColumnType() { if ( m_dbConnPool->getDbConnectionType() == DbConnection::postgresql ) return "TEXT"; else return "TEXT"; }
<         QString randomFunc() { if ( m_dbConnPool->getDbConnectionType() == DbConnection::postgresql ) return "random()"; else return "RAND()"; }
---
>         const QString longTextColumnType() { if ( m_dbConnPool->getDbConnectionType() == DbConnection::postgresql ) return "TEXT"; else return "TEXT"; }
>         const QString randomFunc() { if ( m_dbConnPool->getDbConnectionType() == DbConnection::postgresql ) return "random()"; else return "RAND()"; }
> 
289a297
>         void migrateFile( const QString &oldURL, const QString &newURL );
309c317
<         QStringList albumTracks( const QString &artist_id, const QString &album_id );
---
>         QStringList albumTracks( const QString &artist_id, const QString &album_id, const bool isValue = false );
344,346d351
<         CollectionDB();
<         ~CollectionDB();
< 
398a404
>         bool m_isTemporary;
432a439,440
>         void setGoogleFilter( int defaultTables, QString query );
> 
***********************************
Processing diff /src/steleman/kde-3.4.3/amarok-1.3.1/./amarok/src/collectiondb.cpp.kde.orig /src/steleman/kde-3.4.3/amarok-1.3.5/./amarok/src/collectiondb.cpp
***********************************
75c75
< CollectionDB::CollectionDB()
---
> CollectionDB::CollectionDB( bool temporary )
76a77
>         , m_isTemporary( temporary )
97c98,100
<     // TODO: Should write to config in dtor, but it crashes...
---
>     if ( !temporary )
>     {
>         // TODO Should write to config in dtor, but it crashes...
106a110
> }
108d111
< 
114,118d116
< 
< //     This crashes so it's done at the end of ctor.
< //     KConfig* const config = amaroK::config( "Collection Browser" );
< //     config->writeEntry( "Database Version", DATABASE_VERSION );
< //     config->writeEntry( "Database Stats Version", DATABASE_STATS_VERSION );
295,298c293,296
<         query( QString( "CREATE SEQUENCE album_seq;" ), conn );
<         query( QString( "CREATE SEQUENCE artist_seq;" ), conn );
<         query( QString( "CREATE SEQUENCE genre_seq;" ), conn );
<         query( QString( "CREATE SEQUENCE year_seq;" ), conn );
---
>         query( QString( "CREATE %1 SEQUENCE album_seq%2;" ).arg( conn ? "TEMPORARY" : "").arg( conn ? "_temp" : ""), conn );
>         query( QString( "CREATE %1 SEQUENCE artist_seq%2;" ).arg( conn ? "TEMPORARY" : "").arg( conn ? "_temp" : ""), conn );
>         query( QString( "CREATE %1 SEQUENCE genre_seq%2;" ).arg( conn ? "TEMPORARY" : "").arg( conn ? "_temp" : ""), conn );
>         query( QString( "CREATE %1 SEQUENCE year_seq%2;" ).arg( conn ? "TEMPORARY" : "").arg( conn ? "_temp" : ""), conn );
300,303c298,301
<         albumAutoIncrement = QString("DEFAULT nextval('album_seq')");
<         artistAutoIncrement = QString("DEFAULT nextval('artist_seq')");
<         genreAutoIncrement = QString("DEFAULT nextval('genre_seq')");
<         yearAutoIncrement = QString("DEFAULT nextval('year_seq')");
---
>         albumAutoIncrement = QString("DEFAULT nextval('album_seq%1')").arg( conn ? "_temp" : "");
>         artistAutoIncrement = QString("DEFAULT nextval('artist_seq%1')").arg( conn ? "_temp" : "");
>         genreAutoIncrement = QString("DEFAULT nextval('genre_seq%1')").arg( conn ? "_temp" : "");
>         yearAutoIncrement = QString("DEFAULT nextval('year_seq%1')").arg( conn ? "_temp" : "");
417,421c415,418
<         if (conn == NULL) {
<             query( QString( "DROP SEQUENCE album_seq;" ), conn );
<             query( QString( "DROP SEQUENCE artist_seq;" ), conn );
<             query( QString( "DROP SEQUENCE genre_seq;" ), conn );
<             query( QString( "DROP SEQUENCE year_seq;" ), conn );
---
>             query( QString( "DROP SEQUENCE album_seq%1;" ).arg( conn ? "_temp" : ""), conn );
>             query( QString( "DROP SEQUENCE artist_seq%1;" ).arg( conn ? "_temp" : ""), conn );
>             query( QString( "DROP SEQUENCE genre_seq%1;" ).arg( conn ? "_temp" : ""), conn );
>             query( QString( "DROP SEQUENCE year_seq%1;" ).arg( conn ? "_temp" : ""), conn );
424d420
< }
433c429
<     if ( m_dbConnPool->getDbConnectionType() == DbConnection::mysql )
---
>     if ( m_dbConnPool->getDbConnectionType() == DbConnection::mysql || m_dbConnPool->getDbConnectionType() == DbConnection::postgresql)
667c663
< CollectionDB::albumTracks( const QString &artist_id, const QString &album_id )
---
> CollectionDB::albumTracks( const QString &artist_id, const QString &album_id, const bool isValue )
668a665,672
>     if ( isValue)
>     {
>         return query( QString( "SELECT tags.url FROM tags INNER JOIN artist ON artist.id=tags.artist INNER JOIN album ON "
>                         "album.id=tags.album WHERE (album.name = \"%1\" ) AND (artist.name = \"%2\" ) ORDER BY tags.track;" )
>                         .arg( album_id )
>                         .arg( artist_id ) );
>     }
> 
748c752,754
<     return img.save( largeCoverDir.filePath( key ), "PNG");
---
>     const bool b = img.save( largeCoverDir.filePath( key ), "PNG");
>     emit coverChanged( artist, album );
>     return b;
1169c1175
<     while( values.count() != 10 )
---
>     while( values.count() < 10 )
1427a1434,1457
> CollectionDB::migrateFile( const QString &oldURL, const QString &newURL )
> {
>     query( QString( "DELETE FROM tags WHERE url = '%1';" )
>         .arg( escapeString( newURL ) ) );
> 
>     query( QString( "DELETE FROM statistics WHERE url = '%1';" )
>         .arg( escapeString( newURL ) ) );
> 
>     query( QString( "UPDATE tags SET url = '%1' WHERE url = '%2';" )
>         .arg( escapeString( newURL ) )
>         .arg( escapeString( oldURL ) ) );
> 
>     query( QString( "UPDATE statistics SET url = '%1' WHERE url = '%2';" )
>         .arg( escapeString( newURL ) )
>         .arg( escapeString( oldURL ) ) );
> 
>     query( QString( "DELETE FROM tags WHERE url = '%1';" )
>         .arg( escapeString( oldURL ) ) );
> 
>     query( QString( "DELETE FROM statistics WHERE url = '%1';" )
>         .arg( escapeString( oldURL ) ) );
> }
> 
> void
1849c1879,1880
<         CollectionDB::instance()->query( QString( "DELETE FROM related_artists WHERE artist = '%1';" ).arg( escapedArtist ) );
---
>         // Create a temporary CollectionDB object, to prevent threading problems
>         CollectionDB db( true );
1850a1882,1883
>         db.query( QString( "DELETE FROM related_artists WHERE artist = '%1';" ).arg( escapedArtist ) );
> 
1853c1886
<             CollectionDB::instance()->insert( sql
---
>             db.insert( sql
1888d1920
< 
1892c1924
<     m_dbConnPool = new DbConnectionPool();
---
>     m_dbConnPool = new DbConnectionPool( m_isTemporary );
2400c2432,2434
<     curvalSql = QString("SELECT currval('%1_seq');").arg(_table);
---
>     /* this does not work with postgres
>     curvalSql = QString("SELECT currval('%1_seq');").arg(_table); */
>     curvalSql = QString("SELECT last_value FROM %1_seq;").arg(_table);
2475,2476c2509
< {
< }
---
> {}
2483c2516,2518
< DbConnectionPool::DbConnectionPool() : m_semaphore( POOL_SIZE )
---
> DbConnectionPool::DbConnectionPool( bool temporary )
>     : m_isTemporary( temporary )
>     , m_semaphore( POOL_SIZE )
2538c2573
<     bool vacuum = true;
---
>     bool vacuum = !m_isTemporary;
2694a2730,2733
> void
> QueryBuilder::setGoogleFilter( int defaultTables, QString query )
> {
>     if( query.contains( "\"" ) % 2 == 1 ) query += "\""; //make an even number of "s
2695a2735,2909
>     //something like thingy"bla"stuff -> thingy "bla" stuff
>     bool odd = false;
>     for( int pos = query.find( "\"" );
>          pos >= 0 && pos <= (int)query.length();
>          pos = query.find( "\"", pos + 1 ) )
>     {
>         query = query.insert( odd ? ++pos : pos++, " " );
>         odd = !odd;
>     }
>     query = query.simplifyWhiteSpace();
> 
>     int x; //position in string of the end of the next element
>     bool OR = false, minus = false; //whether the next element is to be OR, and/or negated
>     QString tmp, s = "", field = ""; //the current element, a tempstring, and the field: of the next element
>     QStringList tmpl; //list of elements of which at least one has to match (OR)
>     QValueList<QStringList> allof; //list of all the tmpls, of which all have to match
>     while( !query.isEmpty() )  //seperate query into parts which all have to match
>     {
>         if( query.startsWith( " " ) )
>             query = query.mid( 1 ); //cuts off the first character
>         if( query.startsWith( "\"" ) ) //take stuff in "s literally (basically just ends up ignoring spaces)
>         {
>             query = query.mid( 1 );
>             x = query.find( "\"" );
>         }
>         else
>             x = query.find( " " );
>         if( x < 0 )
>             x = query.length();
>         s = query.left( x ); //get the element
>         query = query.mid( x + 1 ); //move on
> 
>         if( !field.isEmpty() || ( s != "-" && s != "AND" && s != "OR" &&
>                                   !s.endsWith( ":" ) && !s.endsWith( ":>" ) && !s.endsWith( ":<" ) ) )
>         {
>             if( !OR && !tmpl.isEmpty() ) //add the OR list to the AND list
>             {
>                 allof += tmpl;
>                 tmpl.clear();
>             }
>             else
>                 OR = false;
>             tmp = field + s;
>             if( minus )
>             {
>                 tmp = "-" + tmp;
>                 minus = false;
>             }
>             tmpl += tmp;
>             tmp = field = "";
>         }
>         else if( s.endsWith( ":" ) || s.endsWith( ":>" ) || s.endsWith( ":<" ) )
>             field = s;
>         else if( s == "OR" )
>             OR = true;
>         else if( s == "-" )
>             minus = true;
>         else
>             OR = false;
>     }
>     if( !tmpl.isEmpty() )
>         allof += tmpl;
> 
>     const uint allofcount = allof.count();
>     for( uint i = 0; i < allofcount; ++i ) //check each part for matchiness
>     {
>         beginOR();
>         uint count = allof[i].count();
>         for( uint ii = 0; ii < count; ++ii )
>         {
>             field = QString::null;
>             s = allof[i][ii];
>             bool neg = s.startsWith( "-" );
>             if ( neg )
>                 s = s.mid( 1 ); //cut off the -
>             x = s.find( ":" ); //where the field ends and the thing-to-match begins
>             if( x > 0 )
>             {
>                 field = s.left( x ).lower();
>                 s = s.mid( x + 1 );
>             }
> 
>             int mode = modeNormal;
>             if( !field.isEmpty() && s.startsWith( ">" ) )
>             {
>                 s = s.mid( 1 );
>                 mode = modeGreater;
>             }
>             else if( !field.isEmpty() && s.startsWith( "<" ) )
>             {
>                 s = s.mid( 1 );
>                 mode = modeLess;
>             }
> 
>             int table = -1, value = -1;
>             if( field == "artist" )
>                 table = tabArtist;
>             else if( field == "album" )
>                 table = tabAlbum;
>             else if( field == "title" )
>                 table = tabSong;
>             else if( field == "genre" )
>                 table = tabGenre;
>             else if( field == "year" )
>                 table = tabYear;
>             else if( field == "score" )
>             {
>                 table = tabStats;
>                 value = valScore;
>             }
>             else if( field == "directory" )
>             {
>                 table = tabSong;
>                 value = valDirectory;
>             }
>             else if( field == "length" )
>             {
>                 table = tabSong;
>                 value = valLength;
>             }
>             else if( field == "playcount" )
>             {
>                 table = tabStats;
>                 value = valPlayCounter;
>             }
>             else if( field == "samplerate" )
>             {
>                 table = tabSong;
>                 value = valSamplerate;
>             }
>             else if( field == "track" )
>             {
>                 table = tabSong;
>                 value = valTrack;
>             }
>             else if( field == "filename" || field == "url" )
>             {
>                 table = tabSong;
>                 value = valURL;
>             }
>             else if( field == "bitrate" )
>             {
>                 table = tabSong;
>                 value = valBitrate;
>             }
>             else if( field == "comment" )
>             {
>                 table = tabSong;
>                 value = valComment;
>             }
>             else if( field == "lyrics" )
>             {
>                 table = tabSong;
>                 value = valLyrics;
>             }
> 
>             if( neg )
>             {
>                 if( value >= 0 )
>                     excludeFilter( table, value, s, mode );
>                 else
>                     excludeFilter( table >= 0 ? table : defaultTables, s );
>             }
>             else
>             {
>                 if( value >= 0 )
>                     addFilter( table, value, s, mode );
>                 else
>                     addFilter( table >= 0 ? table : defaultTables, s );
>             }
>         }
>         endOR();
>     }
> }
> 
3138a3353
>         m_query += ";";
***********************************
Processing diff /src/steleman/kde-3.4.3/amarok-1.3.1/./amarok/src/threadweaver.h.kde.orig /src/steleman/kde-3.4.3/amarok-1.3.5/./amarok/src/threadweaver.h
***********************************
95a96
>     static void deleteInstance();
373c374
<         DISABLE_GENERATED_MEMBER_FUNCTIONS_4( DependentJob );
---
>         DISABLE_GENERATED_MEMBER_FUNCTIONS_4( DependentJob )
384c385
<     static ThreadWeaver instance;
---
>     static ThreadWeaver* instance = new ThreadWeaver();
386c387
<     return &instance;
---
>     return instance;
388a390,395
> inline void
> ThreadWeaver::deleteInstance()
> {
>     delete instance();
> }
> 
***********************************
Processing diff /src/steleman/kde-3.4.3/amarok-1.3.1/./amarok/src/playerwindow.h.kde.orig /src/steleman/kde-3.4.3/amarok-1.3.5/./amarok/src/playerwindow.h
***********************************
***********************************
Processing diff /src/steleman/kde-3.4.3/amarok-1.3.1/./amarok/src/playlistbrowseritem.h.kde.orig /src/steleman/kde-3.4.3/amarok-1.3.5/./amarok/src/playlistbrowseritem.h
***********************************
50a51,53
> 
>         virtual int compare( QListViewItem*, int, bool ) const; //reimplemented
> 
58c61
<         PartyEntry( QListViewItem *parent, QListViewItem *after, QDomElement xmlDefinition );
---
>         PartyEntry( QListViewItem *parent, QListViewItem *after, const QDomElement &xmlDefinition );
104,105c107,108
<         PlaylistCategory( QListView *parent, QListViewItem *after, QDomElement xmlDefinition, bool isFolder=false);
<         PlaylistCategory( PlaylistCategory *parent, QListViewItem *after, QDomElement xmlDefinition );
---
>         PlaylistCategory( QListView *parent, QListViewItem *after, const QDomElement &xmlDefinition, bool isFolder=false);
>         PlaylistCategory( PlaylistCategory *parent, QListViewItem *after, const QDomElement &xmlDefinition );
121c124
<         void setXml( QDomElement xml );
---
>         void setXml( const QDomElement &xml );
138c141
<         PlaylistEntry( QListViewItem *parent, QListViewItem *after, QDomElement xmlDefinition );
---
>         PlaylistEntry( QListViewItem *parent, QListViewItem *after, const QDomElement &xmlDefinition );
161c164,166
<         void        removeTrack( QListViewItem *item );
---
>         // isLast is used to avoid saving the playlist to disk every time a track is removed
>         // when removing a list of tracks from the playlist
>         void        removeTrack( QListViewItem *item, bool isLast = true );
214,216d218
< 
< 
< 
222c224
<         PodcastItem( QListViewItem *parent, QListViewItem *after, QDomElement xml );
---
>         PodcastItem( QListViewItem *parent, QListViewItem *after, const QDomElement &xml, const int feedType );
226c228
<         const bool hasXml( const QDomNode &xml );
---
>         const bool hasXml( const QDomNode &xml, const int feedType );
227a230
>         QListViewItem *itemChannel() { return m_parent; }
239a243
>         void  setLocalUrlBase( const QString &s );
243a248,250
>     signals:
>         void downloadFinished();
> 
249a257,258
>         enum FeedType{ RSS=0, ATOM=1 };
> 
252a262
>         QListViewItem *m_parent;                   //podcast channel it belongs to
266a277
>         uint        m_iconCounter;
281c292
<                         QDomNode channelSettings, QDomDocument xml );
---
>                         const QDomNode &channelSettings, const QDomDocument &xml );
282a294,295
>         enum MediaFetch{ STREAM=0, AUTOMATIC=1 };
> 
290a304,305
>         void  setSettings( const QString &save, const bool autoFetch, const int fetchType,
>                            const bool purgeItems, const int purgeCount );
291a307
> 
292a309
>         const KURL xmlUrl();
294c311
<         const int timeout() { return m_interval; }
---
> 
295a313,317
>         const int  mediaFetch() { return m_mediaFetch; }
>         const bool hasPurge() { return m_purgeItems; }
>         const int  purgeCount() { return m_purgeCount; }
>         const KURL &saveLocation() { return m_saveLocation; }
>         const int  timeout() { return m_interval; }
297c319
<         void setXml( QDomNode xml );
---
>         void setXml( const QDomNode &xml, const int feedType );
303a326,327
>         void abortFetch();
>         void downloadChildQueue();
308c332
<         enum MediaFetch{ STREAM=0, DOWNLOAD=1, AVAILABLE=2 };
---
>         enum FeedType{ RSS=0, ATOM=1 };
310a335
>         void downloadChildren();
316c341
<         KURL        m_url;                         //xml url
---
>         KURL        m_url;                         //remote xml url
317a343
>         KURL        m_saveLocation;
326a353
>         uint        m_iconCounter;
337d363
<         PodcastItem         *m_first;
340a367
>         QPtrList<PodcastItem> m_podcastDownloadQueue;
347c374
<         StreamEntry( QListViewItem *parent, QListViewItem *after, QDomElement xmlDefinition );
---
>         StreamEntry( QListViewItem *parent, QListViewItem *after, const QDomElement &xmlDefinition );
374c401
<         StreamEditor( QWidget *parent, QString title, QString url, const char *name=0 );
---
>         StreamEditor( QWidget *parent, const QString &title, const QString &url, const char *name=0 );
391c418
<         SmartPlaylist( QListViewItem *parent, QListViewItem *after, const QDomElement xmlDefinition );
---
>         SmartPlaylist( QListViewItem *parent, QListViewItem *after, const QDomElement &xmlDefinition );
395c422
<         QString query() { return sqlForTags; }
---
>         QString query();
398,399d424
<         QString sqlForTags;
< 
401c426
<         void setXml( QDomElement xml );
---
>         void setXml( const QDomElement &xml );
409a435,436
>         QString m_sqlForTags;
> 
***********************************
Processing diff /src/steleman/kde-3.4.3/amarok-1.3.1/./amarok/src/configdialog.cpp.kde.orig /src/steleman/kde-3.4.3/amarok-1.3.5/./amarok/src/configdialog.cpp
***********************************
20c20
< #include "DbSetup.h"
---
> #include "dbsetup.h"
102c102
<     m_opt1->kcfg_RecodeEncoding->insertItem( QString::null );
---
>     m_opt1->kcfg_RecodeEncoding->insertItem( i18n("Locale Encoding") );
320a321
>     const bool crossfadeOn = m_opt4->kcfg_Crossfade->isOn();
323,324c324,327
<     m_opt4->kcfg_CrossfadeLength->setEnabled( hasCrossfade );
<     m_opt4->crossfadeLengthLabel->setEnabled( hasCrossfade );
---
>     m_opt4->kcfg_CrossfadeLength->setEnabled( hasCrossfade && crossfadeOn );
>     m_opt4->crossfadeLengthLabel->setEnabled( hasCrossfade && crossfadeOn );
>     //will enable after 1.3.4 string freeze is over
>     //m_opt4->kcfg_CrossfadeManualOnly->setEnabled( hasCrossfade && crossfadeOn );
325a329,331
>     if (!hasCrossfade)
>     {
>         m_opt4->radioButtonNormalPlayback->setChecked( true );
326a333,334
> 
> }
***********************************
Processing diff /src/steleman/kde-3.4.3/amarok-1.3.1/./amarok/src/playlistbrowser.cpp.kde.orig /src/steleman/kde-3.4.3/amarok-1.3.5/./amarok/src/playlistbrowser.cpp
***********************************
14a15
> #include "mediabrowser.h"
96,97c97,98
<     renameButton   = new KAction( i18n("Rename"), "editclear", 0, this, SLOT( renameSelectedItem() ), m_ac, "Rename" );
<     removeButton   = new KAction( i18n("Remove"), "edittrash", 0, this, SLOT( removeSelectedItems() ), m_ac, "Remove" );
---
>     renameButton   = new KAction( i18n("Rename"), "editclear", 0, this, SLOT( renameSelectedItem() ), m_ac );
>     removeButton   = new KAction( i18n("Remove"), "edittrash", 0, this, SLOT( removeSelectedItems() ), m_ac );
164,166d164
<     m_streamsCategory  = loadStreams();
<     loadCoolStreams();
< 
171a170,173
>     m_dynamicCategory = loadDynamics();
>     m_streamsCategory = loadStreams();
>     loadCoolStreams();
> 
175,176d176
<     m_dynamicCategory = loadDynamics();
< 
189d188
<             item->setPixmap( 1, SmallIcon("favorites") );
190a190,193
>             if ( item->rtti() == PlaylistEntry::RTTI )
>                 static_cast<PlaylistEntry*>( item )->setDynamic( true );
>             if ( item->rtti() == SmartPlaylist::RTTI )
>                 static_cast<SmartPlaylist*>( item )->setDynamic( true );
362a366,367
>     QListViewItem *after = m_dynamicCategory;
> 
365c370
<         return new PlaylistCategory(m_listview, m_playlistCategory , i18n("Radio Streams") );
---
>         return new PlaylistCategory(m_listview, after , i18n("Radio Streams") );
370c375,377
<             return new PlaylistCategory(m_listview, m_playlistCategory, e );
---
>             PlaylistCategory* p = new PlaylistCategory(m_listview, after, e );
>             p->setText(0, i18n("Radio Streams") );
>             return p;
373c380
<             PlaylistCategory* p = new PlaylistCategory(m_listview, m_playlistCategory, i18n("Radio Streams") );
---
>             PlaylistCategory* p = new PlaylistCategory(m_listview, after, i18n("Radio Streams") );
451,452d457
<     if( !file.open( IO_WriteOnly ) ) return;
< 
458c463,464
<     doc.appendChild( streamB );
---
>     QDomNode streamsNode = doc.importNode( streamB, true );
>     doc.appendChild( streamsNode );
459a466,470
>     QString temp( doc.toString() );
> 
>     // Only open the file after all data is ready. If it crashes, data is not lost!
>     if ( !file.open( IO_WriteOnly ) ) return;
> 
463c474
<     stream << doc.toString();
---
>     stream << temp;
499a511
>     QListViewItem *after = m_playlistCategory;
506c518
<         return new PlaylistCategory(m_listview, m_streamsCategory , i18n("Smart Playlists") );
---
>         return new PlaylistCategory(m_listview, after, i18n("Smart Playlists") );
511c523,525
<             return new PlaylistCategory(m_listview, m_streamsCategory, e );
---
>             PlaylistCategory* p = new PlaylistCategory(m_listview, after, e );
>             p->setText( 0, i18n("Smart Playlists") );
>             return p;
514c528
<             PlaylistCategory* p = new PlaylistCategory(m_listview, m_streamsCategory , i18n("Smart Playlists") );
---
>             PlaylistCategory* p = new PlaylistCategory(m_listview, after , i18n("Smart Playlists") );
642d655
<         item->sqlForTags = dialog.query();
652c665
<     if( !m_smartCategory || !file.open( IO_WriteOnly ) ) return;
---
>     if( !m_smartCategory ) return;
659c672,673
<     doc.appendChild( smartB );
---
>     QDomNode smartplaylistsNode = doc.importNode( smartB, true );
>     doc.appendChild( smartplaylistsNode );
660a675,679
>     QString temp( doc.toString() );
> 
>     // Only open the file after all data is ready. If it crashes, data is not lost!
>     if ( !file.open( IO_WriteOnly ) ) return;
> 
664c683
<     smart << doc.toString();
---
>     smart << temp;
728c747
<         after = m_streamsCategory;
---
>         after = m_playlistCategory;
742c761,763
<             return new PlaylistCategory( m_listview, after , e );
---
>             PlaylistCategory* p = new PlaylistCategory( m_listview, after , e );
>             p->setText( 0, i18n("Dynamic Playlists") );
>             return p;
758a780
>     QTextStream stream( &file );
760,761d781
<     if( !file.open( IO_WriteOnly ) ) return;
< 
763,766c783,788
<     QDomElement partyB = doc.createElement( "partybrowser" );
<     partyB.setAttribute( "product", "amaroK" );
<     partyB.setAttribute( "version", APP_VERSION );
<     doc.appendChild( partyB );
---
>     QDomElement dynamicB = m_dynamicCategory->xml();
>     dynamicB.setAttribute( "product", "amaroK" );
>     dynamicB.setAttribute( "version", APP_VERSION );
>     dynamicB.setAttribute( "formatversion", "1.1" );
>     QDomNode dynamicsNode = doc.importNode( dynamicB, true );
>     doc.appendChild( dynamicsNode );
768c790
<     PlaylistCategory *currentCat=0;
---
>     QString temp( doc.toString() );
770c792,793
<     #define m_dynamicCategory static_cast<QListViewItem *>(m_dynamicCategory)
---
>     // Only open the file after all data is ready. If it crashes, data is not lost!
>     if ( !file.open( IO_WriteOnly ) ) return;
772,844d794
<     QListViewItem *it = m_dynamicCategory->firstChild();
<     for( int count = 0; count < m_dynamicCategory->childCount(); count++ )
<     {
<         QDomElement i;
< 
<         if( !isCategory( it ) )
<             currentCat = static_cast<PlaylistCategory*>(it->parent() );
< 
<         if( isDynamic( it ) )
<         {
<             PartyEntry *item = (PartyEntry*)it;
< 
<             i = doc.createElement("party");
<             i.setAttribute( "name", item->text(0) );
< 
<             QDomElement attr = doc.createElement( "cycleTracks" );
<             QDomText t = doc.createTextNode( item->isCycled() ? "true" : "false" );
<             attr.appendChild( t );
<             i.appendChild( attr );
< 
<             attr = doc.createElement( "markHistory" );
<             t = doc.createTextNode( item->isMarked() ? "true" : "false" );
<             attr.appendChild( t );
<             i.appendChild( attr );
< 
<             attr = doc.createElement( "upcoming" );
<             t = doc.createTextNode( QString::number( item->upcoming() ) );
<             attr.appendChild( t );
<             i.appendChild( attr );
< 
<             attr = doc.createElement( "previous" );
<             t = doc.createTextNode( QString::number( item->previous() ) );
<             attr.appendChild( t );
<             i.appendChild( attr );
< 
<             attr = doc.createElement( "appendCount" );
<             t = doc.createTextNode( QString::number( item->appendCount() ) );
<             attr.appendChild( t );
<             i.appendChild( attr );
< 
<             attr = doc.createElement( "appendType" );
<             t = doc.createTextNode( QString::number( item->appendType() ) );
<             attr.appendChild( t );
<             i.appendChild( attr );
< 
<             QString list;
<             if( item->appendType() == 2 )
<             {
<                 QStringList items = item->items();
<                 for( uint c = 0; c < items.count(); c++ )
<                 {
<                     PlaylistBrowserEntry *saveMe = findItem( *(items.at(c)), 0 );
<                     debug() << "Saving item (" << item->text(0) << ") with " << saveMe->text(0) << endl;
<                     list.append( saveMe->text(0) );
<                     if ( c < items.count()-1 )
<                         list.append( ',' );
<                 }
<             }
< 
<             attr = doc.createElement( "items" );
<             t = doc.createTextNode( list );
<             attr.appendChild( t );
<             i.appendChild( attr );
<         }
< 
<         partyB.appendChild( i );
< 
<         it = it->nextSibling();
<     }
< 
<     #undef m_dynamicCategory
< 
<     QTextStream stream( &file );
847c797
<     stream << doc.toString();
---
>     stream << temp;
852d801
<     debug() << "Removing dynamic entries" << endl;
877d825
<         debug() << "Loading entries" << endl;
921a870,871
>     QListViewItem *after = m_streamsCategory;
> 
924c874
<         return new PlaylistCategory( m_listview, m_playlistCategory, i18n("Podcasts") );
---
>         return new PlaylistCategory( m_listview, after, i18n("Podcasts") );
927,928d876
<         PlaylistCategory* p = new PlaylistCategory(m_listview, m_playlistCategory, i18n("Podcasts") );
< 
934,935c882,884
<         QListViewItem *last = 0;
<         QDomNode n = d.namedItem( "category" ).namedItem("podcast");
---
>         e = d.namedItem( "category" ).toElement();
>         PlaylistCategory *p = new PlaylistCategory( m_listview, after, e );
>         p->setText( 0, i18n("Podcasts") );
937,958d885
<         for( ; !n.isNull();  n = n.nextSibling() )
<         {
<             KURL url( n.namedItem( "url").toElement().text() );
< 
<             QString xmlLocation = amaroK::saveLocation( "podcasts/" );
<             xmlLocation        += n.namedItem( "cache" ).toElement().text();
< 
<             QDomDocument xml;
<             QFile xmlFile( xmlLocation );
<             QTextStream stream( &xmlFile );
<             stream.setEncoding( QTextStream::UnicodeUTF8 );
< 
<             if( !xmlFile.open( IO_ReadOnly ) || !xml.setContent( stream.read() ) )
<                 continue;
< 
<             last = new PodcastChannel( p, last, url, n, xml );
<             #define item static_cast<PodcastChannel*>(last)
<             if( item->autoScan() )
<                 m_podcastItemsToScan.append( item );
<             #undef  item
<         }
< 
971,972d897
<     if( !file.open( IO_WriteOnly ) ) return;
< 
978c903,904
<     doc.appendChild( podcastB );
---
>     QDomNode podcastNode = doc.importNode( podcastB, true );
>     doc.appendChild ( podcastNode );
979a906,910
>     QString temp( doc.toString() );
> 
>     // Only open the file after all data is ready. If it crashes, data is not lost!
>     if ( !file.open( IO_WriteOnly ) ) return;
> 
982,983c913
<     stream << doc.toString();
< 
---
>     stream << temp;
1005a936,941
>         addPodcast( name, parent );
>     }
> }
> 
> void PlaylistBrowser::addPodcast( const QString &url, QListViewItem *parent )
> {
1008c944
<         PodcastChannel *pc = new PodcastChannel( parent, 0, KURL( name ) );
---
>     PodcastChannel *pc = new PodcastChannel( parent, 0, KURL( url ) );
1025d960
< }
1029c964
<     int time = m_podcastTimerInterval / ( 60 * 60 * 1000 );
---
>     double time = static_cast<double>(m_podcastTimerInterval / ( 60 * 60 * 1000 ));
1031c966
<     int interval = KInputDialog::getInteger( i18n("Download Interval"),
---
>     double interval = KInputDialog::getDouble( i18n("Download Interval"),
1033c968
<                                             1, 1000, 1, 10, // min, max, step, base
---
>                                             0.5, 100.0, .5, 1, // min, max, step, base
1034a970
>     int milliseconds = static_cast<int>(interval*60.0*60.0*1000.0);
1037c973
<         if( interval != m_podcastTimerInterval )
---
>         if( milliseconds != m_podcastTimerInterval )
1039c975
<             m_podcastTimerInterval = interval * 60 * 60 * 1000;
---
>             m_podcastTimerInterval = milliseconds;
1042a979
> }
1043a981,1004
> bool PlaylistBrowser::deletePodcasts( QPtrList<PodcastChannel> items )
> {
>     if ( items.isEmpty() ) return false;
> 
>     int button = KMessageBox::warningContinueCancel( this, i18n( "<p>You have selected 1 podcast to be <b>irreversibly</b> deleted. "
>                                                                  "All downloaded episodes will also be deleted.",
>                                                                  "<p>You have selected %n podcasts to be <b>irreversibly</b> deleted. "
>                                                                  "All downloaded episodes will also be deleted.",
>                                                                  items.count() ),
>                                                      QString::null,
>                                                      KStdGuiItem::del() );
> 
>     if ( button == KMessageBox::Continue )
>     {
>         KURL::List urls;
>         foreachType( QPtrList<PodcastChannel>, items )
>         {
>             for( QListViewItem *ch = (*it)->firstChild(); ch; ch = ch->nextSibling() )
>             {
>                 #define ch static_cast<PodcastItem*>(ch)
>                 if( ch->hasDownloaded() )
>                 {
>                     //delete downloaded media
>                     urls.append( ch->localUrl() );
1044a1006,1016
>                 #undef  ch
>             }
>             //delete downloaded xml
>             urls.append( (*it)->xmlUrl() );
>         }
>         // TODO We need to check which files have been deleted successfully
>         KIO::del( urls );
>         return true;
>     }
>     return false;
> }
1045a1018,1067
> void PlaylistBrowser::downloadSelectedPodcasts()
> {
>     QListViewItemIterator it( m_listview, QListViewItemIterator::Selected );
> 
>     for( ; it.current(); ++it )
>     {
>         if( isPodcastItem( *it ) )
>         {
>             #define item static_cast<PodcastItem*>(*it)
>             if( !item->hasDownloaded() )
>                 m_podcastDownloadQueue.append( item );
>             #undef  item
>         }
>     }
>     downloadPodcastQueue();
> }
> 
> void PlaylistBrowser::downloadPodcastQueue() //SLOT
> {
>     if( m_podcastDownloadQueue.isEmpty() ) return;
> 
>     PodcastItem *first = m_podcastDownloadQueue.first();
>     first->downloadMedia();
>     m_podcastDownloadQueue.removeFirst();
> 
>     connect( first, SIGNAL( downloadFinished() ), this, SLOT( downloadPodcastQueue() ) );
> }
> 
> void PlaylistBrowser::setGlobalPodcastSettings( PodcastChannel *item )
> {
>     debug() << "Playlistbrowser is modifying global podcastsettings" << endl;
>     const QString save   = item->saveLocation().path();
>     const bool autoFetch = item->autoScan();
>     const int mediaType  = item->mediaFetch();
>     const bool purge     = item->hasPurge();
>     const int purgeCount = item->purgeCount();
> 
>     QListViewItem *channel = m_podcastCategory->firstChild();
> 
>     for( ; channel; channel = channel->itemBelow() )
>     {
>         if( !isPodcastChannel( channel ) || channel == item )
>             continue;
>         #define channel static_cast<PodcastChannel*>(channel)
>         debug() << "Settings are being saved for: " << channel->title() << endl;
>         channel->setSettings( save, autoFetch, mediaType, purge, purgeCount );
>         #undef  channel
>     }
> }
> 
1075c1097,1099
<             return new PlaylistCategory(m_listview, 0 , e );
---
>             PlaylistCategory* p = new PlaylistCategory(m_listview, 0 , e );
>             p->setText( 0, i18n("Playlists") );
>             return p;
1167c1191
< bool PlaylistBrowser::savePlaylist( const QString &path, const QValueList<KURL> &urls,
---
> bool PlaylistBrowser::savePlaylist( const QString &path, const QValueList<KURL> &in_urls,
1184a1209,1218
>     KURL::List urls;
>     for( int i = 0, n = in_urls.count(); i < n; ++i )
>     {
>         const KURL &url = in_urls[i];
>         if( url.isLocalFile() && QFileInfo( url.path() ).isDir() )
>             urls += recurse( url );
>         else
>             urls += url;
>     }
> 
1187c1221
<         const KURL url = urls[i];
---
>         const KURL &url = urls[i];
1188a1223,1224
>         if( !titles.isEmpty() && !seconds.isEmpty() )
>         {
1193a1230
>         }
1205a1243
>     file.close(); // Flushes the file, before we read it
1228,1229d1265
<     if( !file.open( IO_WriteOnly ) ) return;
< 
1235c1271,1272
<     doc.appendChild( playlistsB );
---
>     QDomNode playlistsNode = doc.importNode( playlistsB, true );
>     doc.appendChild( playlistsNode );
1236a1274,1278
>     QString temp( doc.toString() );
> 
>     // Only open the file after all data is ready. If it crashes, data is not lost!
>     if ( !file.open( IO_WriteOnly ) ) return;
> 
1240c1282
<     stream << doc.toString();
---
>     stream << temp;
1242a1285,1333
> bool PlaylistBrowser::deletePlaylists( QPtrList<PlaylistEntry> items )
> {
>     KURL::List urls;
>     foreachType( QPtrList<PlaylistEntry>, items )
>     {
>         urls.append( (*it)->url() );
>     }
>     if( !urls.isEmpty() )
>         return deletePlaylists( urls );
> 
>     return false;
> }
> 
> bool PlaylistBrowser::deletePlaylists( KURL::List items )
> {
>     if ( items.isEmpty() ) return false;
> 
>     int button = KMessageBox::warningContinueCancel( this, i18n( "<p>You have selected 1 playlist to be <b>irreversibly</b> deleted.",
>                                                                  "<p>You have selected %n playlists to be <b>irreversibly</b> deleted.",
>                                                                  items.count() ),
>                                                      QString::null,
>                                                      KStdGuiItem::del() );
> 
>     if ( button == KMessageBox::Continue )
>     {
>         // TODO We need to check which files have been deleted successfully
>         KIO::del( items );
>         return true;
>     }
>     return false;
> }
> 
> void PlaylistBrowser::savePlaylist( PlaylistEntry *item )
> {
>     bool append = false;
> 
>     if( item->trackList().count() == 0 ) //the playlist hasn't been loaded so we append the dropped tracks
>         append = true;
> 
>     //save the modified playlist in m3u or pls format
>     const QString ext = fileExtension( item->url().path() );
>     if( ext.lower() == "m3u" )
>         saveM3U( item, append );
>     else
>         savePLS( item, append );
> 
>     item->setModified( false );    //don't show the save icon
> }
> 
1255c1346
< bool PlaylistBrowser::createPlaylist( bool current )
---
> bool PlaylistBrowser::createPlaylist( QListViewItem *parent, bool current )
1257a1349,1351
>     debug() << "Creating playlist" << endl;
>     if( path.isEmpty() )
>         return false;
1259,1260c1353,1355
<     if( !path.isEmpty() )
<     {
---
>     if( !parent )
>         parent = static_cast<QListViewItem *>( m_playlistCategory );
> 
1271c1366,1369
<             m_lastPlaylist = new PlaylistEntry( static_cast<QListViewItem*>(m_playlistCategory), 0, path );
---
>         debug() << "not current!" << endl;
>         m_lastPlaylist = new PlaylistEntry( parent, 0, path );
>         parent->setOpen( true );
>         parent->sortChildItems( 0, true );
1278,1280d1375
<     else
<         return false;
< }
1291c1386
<         Playlist::instance()->insertMedia( item->tracksURL(), Playlist::Replace );
---
>         Playlist::instance()->insertMedia( item->url(), Playlist::Replace );
1339,1340c1434,1435
<         if( !item->sqlForTags.isEmpty() )
<             Playlist::instance()->insertMediaSql( item->sqlForTags, Playlist::Clear );
---
>         if( !item->query().isEmpty() )
>             Playlist::instance()->insertMediaSql( item->query(), Playlist::Clear );
1453a1549,1553
>     QPtrList<PlaylistEntry> playlistsToDelete;
>     QPtrList<PlaylistCategory> playlistFoldersToDelete;
>     QPtrList<PodcastChannel> podcastsToDelete;
>     QPtrList<PlaylistCategory> podcastFoldersToDelete;
>     QPtrList<PlaylistTrackItem> tracksToDelete;
1460a1561,1562
>     /// @note the variable keepItem is used to tell us if there is a more sinister operation which is needed,
>     /// being deleting from disk - this includes deleting playlists and deleting all downloaded podcast media.
1463,1467c1565
<         if( isPlaylist( item ) )      playlistsChanged = true;
<         if( isCategory( item ) )      playlistsChanged = true;
<         if( isStream( item ) )        streamsChanged = true;
<         if( isSmartPlaylist( item ) ) smartPlaylistsChanged = true;
<         if( isDynamic( item ) )       dynamicsChanged = true;
---
>         bool keepItem = false;
1469c1567,1606
<         if( isPlaylistTrackItem( item ) ) {
---
>         if( isPlaylist( item ) )
>         {
>             keepItem = playlistsChanged = true;
>             playlistsToDelete.append( static_cast<PlaylistEntry*>(item) );
>         }
> 
>         /// @note when we delete a category, we have to check if it contains either playlists or podcasts which
>         /// need deleting to occur.  We set keepItem = true to delete the folder after we have deleted the
>         /// playlists/podcasts, and only then do we remove the folder.
>         else if( isCategory( item ) )
>         {
>             if( isPlaylist( item->firstChild() ))
>             {
>                 for( QListViewItem *ch = item->firstChild(); ch; ch = ch->nextSibling() )
>                 {
>                     keepItem = playlistsChanged = true;
>                     playlistsToDelete.append( static_cast<PlaylistEntry*>(ch) );
>                     playlistFoldersToDelete.append( static_cast<PlaylistCategory*>(item) );
>                 }
>             }
>             if( isPodcastChannel( item->firstChild() ) )
>             {
>                 for( QListViewItem *ch = item->firstChild(); ch; ch = ch->nextSibling() )
>                 {
>                     keepItem = podcastsChanged = true;
>                     podcastsToDelete.append( static_cast<PodcastChannel*>(ch) );
>                     podcastFoldersToDelete.append( static_cast<PlaylistCategory*>(item) );
>                 }
>             }
>         }
>         else if( isStream( item ) )        streamsChanged = true;
>         else if( isSmartPlaylist( item ) ) smartPlaylistsChanged = true;
>         else if( isDynamic( item ) )       dynamicsChanged = true;
> 
>         if( isPlaylistTrackItem( item ) )
>         {
>             //we are going to be deleting the parent playlist, dont bother removing it
>             if( playlistsToDelete.find( static_cast<PlaylistEntry*>(item->parent()) ) != -1 )
>                 continue;
> 
1472c1609
<             PlaylistEntry *playlist = (PlaylistEntry *)item->parent();
---
>             PlaylistEntry *playlist = static_cast<PlaylistEntry*>(item->parent());
1475c1612,1617
<         else if( isPodcastChannel( item ) ) {
---
>         else if( isPodcastChannel( item ) )
>         {
>             //we are going to be deleting the parent podcast, dont bother removing it
>             if( podcastsToDelete.find( static_cast<PodcastChannel*>(item->parent()) ) != -1 )
>                 continue;
> 
1478c1620
<             delete item;
---
>             podcastsToDelete.append( static_cast<PodcastChannel*>(item) );
1480c1622,1623
<         else {
---
>         else if( !keepItem )
>         {
1486d1628
<     if( playlistsChanged )      savePlaylists();
1490a1633,1642
> 
>     // used for deleting playlists first, then folders.
>     if( playlistsChanged )
>     {
>         if( deletePlaylists( playlistsToDelete ) )
>         {
>             foreachType( QPtrList<PlaylistEntry>, playlistsToDelete )
>             {
>                 m_dynamicEntries.remove(*it);
>                 delete (*it);
1492a1645,1651
>             foreachType( QPtrList<PlaylistCategory>, playlistFoldersToDelete )
>             {
>                 delete (*it);
>             }
>             savePlaylists();
>         }
>     }
1493a1653,1669
>     if( podcastsChanged )
>     {
>         if( deletePodcasts( podcastsToDelete ) )
>         {
>             foreachType( QPtrList<PodcastChannel>, podcastsToDelete )
>             {
>                 delete (*it);
>             }
>             foreachType( QPtrList<PlaylistCategory>, podcastFoldersToDelete )
>             {
>                 delete (*it);
>             }
>             savePodcasts();
>         }
>     }
> }
> 
1536c1712
<         QString newPath = fileDirPath( oldPath ) + newName + fileExtension( oldPath );
---
>         QString newPath = fileDirPath( oldPath ) + newName + "." + fileExtension( oldPath );
1550,1598d1725
< void PlaylistBrowser::deleteSelectedPlaylists() //SLOT
< {
<     KURL::List urls;
< 
<     //delete currentItem, no matter if selected or not
<     m_listview->setSelected( m_listview->currentItem(), true );
< 
<     QListViewItemIterator it( m_listview, QListViewItemIterator::Selected );
<     for( ; it.current(); ++it ) {
<         if( isPlaylist( *it ) )
<             urls.append( ((PlaylistEntry *)*it)->url() );
<         else    //we want to delete only playlists
<             m_listview->setSelected( it.current(), false );
<     }
< 
<     if ( urls.isEmpty() ) return;
< 
<     int button = KMessageBox::warningContinueCancel( this, i18n( "<p>You have selected 1 playlist to be <b>irreversibly</b> deleted.",
<                                                                  "<p>You have selected %n playlists to be <b>irreversibly</b> deleted.",
<                                                                  urls.count() ),
<                                                      QString::null,
<                                                      KStdGuiItem::del() );
< 
<     if ( button == KMessageBox::Continue )
<     {
<         // TODO We need to check which files have been deleted successfully
<         KIO::DeleteJob* job = KIO::del( urls );
<         connect( job, SIGNAL( result( KIO::Job* ) ), SLOT( removeSelectedItems() ) );
<     }
< }
< 
< void PlaylistBrowser::savePlaylist( PlaylistEntry *item )
< {
<     bool append = false;
< 
<     if( item->trackList().count() == 0 ) //the playlist hasn't been loaded so we append the dropped tracks
<         append = true;
< 
<     //save the modified playlist in m3u or pls format
<     const QString ext = fileExtension( item->url().path() );
<     if( ext.lower() == "m3u" )
<         saveM3U( item, append );
<     else
<         savePLS( item, append );
< 
<     item->setModified( false );    //don't show the save icon
< }
< 
< 
1647a1775,1781
> #include <kdirlister.h>
> #include <qeventloop.h>
> #include "playlistloader.h"
> //this function (C) Copyright 2003-4 Max Howell, (C) Copyright 2004 Mark Kretschmann
> KURL::List PlaylistBrowser::recurse( const KURL &url )
> {
>     typedef QMap<QString, KURL> FileMap;
1648a1783,1809
>     KDirLister lister( false );
>     lister.setAutoUpdate( false );
>     lister.setAutoErrorHandlingEnabled( false, 0 );
>     lister.openURL( url );
> 
>     while( !lister.isFinished() )
>         kapp->eventLoop()->processEvents( QEventLoop::ExcludeUserInput );
> 
>     KFileItemList items = lister.items(); //returns QPtrList, so we MUST only do it once!
>     KURL::List urls;
>     FileMap files;
>     for( KFileItem *item = items.first(); item; item = items.next() ) {
>         if( item->isFile() ) { files[item->name()] = item->url(); continue; }
>         if( item->isDir() ) urls += recurse( item->url() );
>     }
> 
>     foreachType( FileMap, files )
>         // users often have playlist files that reflect directories
>         // higher up, or stuff in this directory. Don't add them as
>         // it produces double entries
>         if( !PlaylistFile::isPlaylistFile( (*it).fileName() ) )
>             urls += *it;
> 
>     return urls;
> }
> 
> 
1811c1972
<         enum Id { LOAD, ADD, DYNADD, DYNSUB, SAVE, RESTORE, RENAME, REMOVE, DELETE };
---
>         enum Id { LOAD, ADD, DYNADD, DYNSUB, SAVE, RESTORE, RENAME, DELETE };
1832d1992
<         menu.insertItem( SmallIconSet("edittrash"), i18n( "R&emove" ), REMOVE );
1836d1995
<         menu.setAccel( Key_Delete, REMOVE );
1845c2004
<                 Playlist::instance()->insertMedia( item->tracksURL() );
---
>                 Playlist::instance()->insertMedia( item->url() );
1862c2021
<             case REMOVE:
---
>             case DELETE:
1865,1867d2023
<             case DELETE:
<                 deleteSelectedPlaylists();
<                 break;
1883c2039
<                 menu.insertItem( SmallIconSet( "edit_add" ), i18n( "Add to From Dynamic Mode" ), DYNADD );
---
>                 menu.insertItem( SmallIconSet( "edit_add" ), i18n( "Add to Dynamic Mode" ), DYNADD );
1901c2057
<                 Playlist::instance()->insertMediaSql( static_cast<SmartPlaylist *>(item)->sqlForTags, Playlist::Append );
---
>                 Playlist::instance()->insertMediaSql( static_cast<SmartPlaylist *>(item)->query(), Playlist::Append );
1971c2127
<         enum Actions { LOAD, ADD, REMOVE, INFO, RESCAN, CONFIG};
---
>         enum Actions { LOAD, ADD, DELETE, INFO, RESCAN, CONFIG};
1974c2130
<         menu.insertItem( SmallIconSet( "edittrash" ), i18n( "R&emove" ), REMOVE );
---
>         menu.insertItem( SmallIconSet( "editdelete" ), i18n( "&Delete" ), DELETE );
2008c2164
<             case REMOVE:
---
>             case DELETE:
2036c2192
<         enum Actions { LOAD, INFO, GET };
---
>         enum Actions { LOAD, QUEUE, INFO, GET, MEDIA_DEVICE };
2037a2194
>         menu.insertItem( SmallIconSet( "2rightarrow" ), i18n( "&Queue" ), QUEUE );
2042,2043c2199
<         if( item->hasDownloaded() )
<             menu.setItemEnabled( GET, false );
---
>         menu.setItemEnabled( GET, !item->hasDownloaded() );
2044a2201,2206
>         if( MediaDevice::instance()->isConnected() )
>         {
>             menu.insertItem( SmallIconSet( "usbpendrive_unmount" ), i18n( "Add to Media Device &Transfer Queue" ), MEDIA_DEVICE );
>             menu.setItemEnabled( MEDIA_DEVICE, item->hasDownloaded() );
>         }
> 
2050a2213,2219
>             case QUEUE:
>                 if( item->hasDownloaded() )
>                     Playlist::instance()->insertMedia( item->localUrl(), Playlist::Queue );
>                 else
>                     Playlist::instance()->insertMedia( item->url(), Playlist::Queue );
>                 break;
> 
2056c2225
<                 item->downloadMedia();
---
>                 downloadSelectedPodcasts();
2057a2227,2230
> 
>             case MEDIA_DEVICE:
>                 MediaDevice::instance()->addURLs( item->localUrl() );
>                 break;
2063c2236
<         enum Actions { RENAME, REMOVE, CREATE, PLAYLIST, SMART, STREAM, PODCAST, REFRESH, INTERVAL };
---
>         enum Actions { RENAME, REMOVE, CREATE, PLAYLIST, SMART, STREAM, DYNAMIC, PODCAST, REFRESH, INTERVAL };
2086a2260,2262
>         else if( parentCat == static_cast<QListViewItem*>(m_dynamicCategory) )
>             menu.insertItem( SmallIconSet("edit_add"), i18n("Save Dynamic Configuration..."), DYNAMIC );
> 
2090d2265
<             menu.insertSeparator();
2091a2267
>             if( parentCat == item )
2093d2268
< 
2095a2271
>         menu.insertSeparator();
2122a2299,2302
>             case DYNAMIC:
>                 addDynamic( item );
>                 break;
> 
2130a2311
>                     if( isPodcastChannel( tracker ) )
2146a2328
>                 if( tracker == item->firstChild() && !isCategory( tracker ) ) tracker = 0;
2148c2330
<                 new PlaylistCategory( item, tracker, name, true );
---
>                (new PlaylistCategory( item, tracker, name, true ))->startRename( 0 );
2219a2402,2404
>     , m_animationTimer( new QTimer() )
>     , m_loading1( new QPixmap( locate("data", "amarok/images/loading1.png" ) ) )
>     , m_loading2( new QPixmap( locate("data", "amarok/images/loading2.png" ) ) )
2235,2238d2419
<     //<loading animation>
<     m_loading1 = new QPixmap( locate("data", "amarok/images/loading1.png" ) );
<     m_loading2 = new QPixmap( locate("data", "amarok/images/loading2.png" ) );
<     m_animationTimer = new QTimer();
2240d2420
<     //</loading animation>
2292c2472
<     e->accept( e->source() != viewport() && KURLDrag::canDecode( e ) );
---
>     e->accept( e->source() == viewport() || KURLDrag::canDecode( e ) );
2341,2342c2521,2524
<     if( e->source() == viewport() )
<         e->ignore();    //TODO add support to move tracks
---
>     if( e->source() == this )
>     {
>         moveSelectedItems( item ); // D&D sucks, do it ourselves
>     }
2353a2536,2548
>                 QListViewItem *parent = item;
> 
>                 bool isPlaylistFolder = false;
>                 while( parent )
>                 {
>                     if( parent == PlaylistBrowser::instance()->m_playlistCategory )
>                     {
>                         isPlaylistFolder = true;
>                         break;
>                     }
>                     parent = parent->parent();
>                 }
> 
2359,2360c2554
<                 else if( isCategory( item ) &&
<                          item == PlaylistBrowser::instance()->m_playlistCategory )
---
>                 else if( isCategory( item ) && isPlaylistFolder )
2363c2557
<                     if ( pb->createPlaylist( false ) )
---
>                     if ( pb->createPlaylist( item, false ) )
2446a2641,2643
>         }
>     }
> }
2447a2645,2662
> void PlaylistBrowserView::moveSelectedItems( QListViewItem *newParent )
> {
>     if( !newParent || isDynamic( newParent ) || isPodcastChannel( newParent ) ||
>          isSmartPlaylist( newParent ) || isPodcastItem( newParent ) )
>         return;
> 
>     if( newParent == PlaylistBrowser::instance()->m_coolStreams ||
>         newParent == PlaylistBrowser::instance()->m_smartDefaults )
>         return;
> 
>     QPtrList<QListViewItem> selected;
>     QListViewItemIterator it( this, QListViewItemIterator::Selected );
>     for( ; it.current(); ++it )
>     {
>         if( !(*it)->parent() ) //must be a base category we are draggin'
>             continue;
> 
>         selected.append( *it );
2449a2665,2675
>     for( QListViewItem *item = selected.first(); item; item = selected.next() )
>     {
>         QListViewItem *itemParent = item->parent();
>         if( isPlaylistTrackItem( item ) )
>         {
>             if( !isPlaylist( newParent ) )
>                 continue;
>             else
>             {
>                 itemParent->takeItem( item );
>                 newParent->insertItem( item );
2450a2677,2679
>         }
>         else if( !isCategory( newParent ) )
>             continue;
2451a2681,2683
>         QListViewItem *base = newParent;
>         while( base->parent() )
>             base = base->parent();
2452a2685,2693
>         if( base == PlaylistBrowser::instance()->m_playlistCategory && isPlaylist( item )   ||
>             base == PlaylistBrowser::instance()->m_streamsCategory && isStream( item )      ||
>             base == PlaylistBrowser::instance()->m_smartCategory && isSmartPlaylist( item ) ||
>             base == PlaylistBrowser::instance()->m_dynamicCategory && isDynamic( item )     ||
>             base == PlaylistBrowser::instance()->m_podcastCategory && isPodcastChannel( item ) )
>         {
>             itemParent->takeItem( item );
>             newParent->insertItem( item );
>             newParent->sortChildItems( 0, true );
2453a2695,2696
>     }
> }
2455d2697
< 
2476a2719
>         case SHIFT+Key_Delete:    //delete
2485,2488d2727
<         case SHIFT+Key_Delete:    //delete
<             PlaylistBrowser::instance()->deleteSelectedPlaylists();
<             break;
< 
2507c2746
<             urls += ((PlaylistEntry*)*it)->tracksURL();
---
>             urls += ((PlaylistEntry*)*it)->url();
2545c2784
<             if( !item->sqlForTags.isEmpty() )
---
>             if( !item->query().isEmpty() )
2547c2786
<                 QTextDrag *textdrag = new QTextDrag( item->sqlForTags, 0 );
---
>                 QTextDrag *textdrag = new QTextDrag( item->query(), 0 );
2561a2801,2804
> /////////////////////////////////////////////////////////////////////////////
> //    CLASS PlaylistDialog
> ////////////////////////////////////////////////////////////////////////////
> 
2575c2818
<                    KGuiItem( i18n( "Custom location..." ), SmallIconSet( "folder" ) ) )
---
>                    KGuiItem( i18n( "Save to location..." ), SmallIconSet( "folder" ) ) )
***********************************
Processing diff /src/steleman/kde-3.4.3/amarok-1.3.1/./amarok/src/actionclasses.cpp.kde.orig /src/steleman/kde-3.4.3/amarok-1.3.5/./amarok/src/actionclasses.cpp
***********************************
7a8
> #include "amarokconfig.h"
302a304,311
>     else if( e->button() == Qt::RightButton ) {
>         #if defined HAVE_XMMS || defined HAVE_LIBVISUAL
>         KPopupMenu menu;
>         menu.insertItem( SmallIconSet( "visualizations" ), i18n("&Visualizations"), Menu::ID_SHOW_VIS_SELECTOR );
> 
>         if( menu.exec( mapToGlobal( e->pos() ) ) == Menu::ID_SHOW_VIS_SELECTOR )
>             Menu::instance()->slotActivated( Menu::ID_SHOW_VIS_SELECTOR );
>         #endif
303a313
> }
321c331
<     delete (amaroK::Slider*) m_slider; //just in case, remember, we only support one plugging!
---
>     delete (amaroK::VolumeSlider*) m_slider; //just in case, remember, we only support one plugging!
323c333
<     m_slider = new amaroK::Slider( Qt::Vertical, w, amaroK::VOLUME_MAX );
---
>     m_slider = new amaroK::VolumeSlider( w, amaroK::VOLUME_MAX );
326d335
<     m_slider->setMinimumHeight( 35 );
464,465c473
< {
< }
---
> {}
485a494
>         button->setEnabled( false ); // Required, otherwise the button is always enabled at startup
***********************************
Processing diff /src/steleman/kde-3.4.3/amarok-1.3.1/./amarok/src/enginecontroller.h.kde.orig /src/steleman/kde-3.4.3/amarok-1.3.5/./amarok/src/enginecontroller.h
***********************************
72a73
>     void trackFinished() { next(false); };
***********************************
