Commit afeec678f85fd29f750acd26544151a11f78a023

fix logic in FileCollectionLocation so all files are deleted, rather than just the first one (most likely, it was calling slotRemoveOperationFinished immediately after starting 1 job, which would result in the CollectionLocation destroying itself before the other jobs had a chance to run.) it also now deletes in parallel, rather than one at a time.
  
6868
6969 return removed;
7070}
71bool FileCollectionLocation::startNextRemoveJob()
71void FileCollectionLocation::startRemoveJobs()
7272{
7373 DEBUG_BLOCK
7474 while ( !m_removetracks.isEmpty() )
8989
9090 The::statusBar()->newProgressOperation( job, i18n( "Removing: %1", name ) );
9191 m_removejobs.insert( job, track );
92 return true;
9392 }
94 return false;
9593}
9694
9795void FileCollectionLocation::slotRemoveJobFinished(KJob* job)
112112 m_removejobs.remove( job );
113113 job->deleteLater();
114114
115 if( !startNextRemoveJob() )
116 {
115 if(m_removejobs.isEmpty()) {
117116 slotRemoveOperationFinished();
118117 }
119118}
124124 m_removetracks = sources;
125125
126126 debug() << "removing " << m_removetracks.size() << "tracks";
127 if( !startNextRemoveJob() ) //this signal needs to be called no matter what, even if there are no job finishes to call it
128 {
129 slotRemoveOperationFinished();
130 }
127 startRemoveJobs();
131128}
132129
133130#include "FileCollectionLocation.moc"
  
4040 public slots:
4141 void slotRemoveJobFinished( KJob *job );
4242 private:
43 bool startNextRemoveJob();
43 void startRemoveJobs();
4444
4545 QMap<KJob*, Meta::TrackPtr> m_removejobs;
4646 Meta::TrackList m_removetracks;