CollectionScanner::CollectionScanner( const QStringList& folders,
                                      bool recursive,
                                      bool incremental,
                                      bool importPlaylists,
                                      bool restart )
        : KApplication( /*allowStyles*/ false, /*GUIenabled*/ false )
        , m_importPlaylists( importPlaylists )
        , m_folders( folders )
        , m_recursively( recursive )
        , m_incremental( incremental )
        , m_restart( restart )
        , m_logfile( Amarok::saveLocation( QString::null ) + "collection_scan.log"  )
        , m_pause( false )
{
    DcopCollectionScannerHandler* dcsh = new DcopCollectionScannerHandler();
    connect( dcsh, SIGNAL(pauseRequest()), this, SLOT(pause()) );
    connect( dcsh, SIGNAL(unpauseRequest()), this, SLOT(resume()) );
    kapp->setName( QString( "amarokcollectionscanner" ).ascii() );
    if( !restart )
        QFile::remove( m_logfile );

    QTimer::singleShot( 0, this, SLOT( doJob() ) );
}
 void DcopCollectionScannerHandler::pause()
 {
     //do nothing for now
     emit pauseRequest();
 }