Commit 9c09f3a1d9c616ec9f5bef8dbd3cbe40c85db1b5

  • Tree SHA1: ccb7cd2
  • Parent SHA1: f3bc31b (Merge commit 'refs/merge-requests/145' of git://gitorious.org/amarok/amarok into nanno_merges)
  • raw diff | raw patch
fix crash in biassolver if there is no primarycollection
hook up to the collectionadded signal once so we try again when the next collection is added

BUG: 229783
  
828828{
829829 DEBUG_BLOCK
830830
831 disconnect( CollectionManager::instance(), SIGNAL(collectionAdded(Amarok::Collection*,CollectionStatus)), this, SLOT(updateUniverse()) );
832
831833 /* TODO: Using multiple collections.
832834 * One problem with just using MetaQueryMaker is that we can't store uids as
833835 * QByteArrays unless we keep separate lists for each collection. If we do
850850 {
851851 if( !s_universeCollection )
852852 s_universeCollection = CollectionManager::instance()->primaryCollection();
853
853 if( !s_universeCollection ) // WTF we really can't get a primarycollection?
854 { // whenever a collection is added lets check again, so we catch the loading of the primary colletion
855 connect( CollectionManager::instance(), SIGNAL(collectionAdded(Amarok::Collection*,CollectionStatus)), this, SLOT(updateUniverse()) );
856 return;
857 }
858
854859 s_universeQuery = s_universeCollection->queryMaker();
855860 s_universeQuery->setQueryType( QueryMaker::Custom );
856861 s_universeQuery->addReturnValue( Meta::valUniqueId );
  
132132 void universeResults( QString collectionId, QStringList );
133133 void universeUpdated();
134134
135
136 /**
137 * Query for the universe set (the set of all tracks in the
138 * collection being considered).
139 */
140 void updateUniverse();
141
135142 private:
136143 /**
137144 * Try to produce an optimal playlist using a genetic algorithm, and
226226 * produce offspring.
227227 */
228228 QList<int> generateMatingPopulation( const QList<TrackListEnergyPair>& );
229
230 /**
231 * Query for the universe set (the set of all tracks in the
232 * collection being considered).
233 */
234 void updateUniverse();
235229
236230 Meta::TrackList m_solution;
237231