mirror of
https://github.com/clementine-player/Clementine
synced 2024-12-16 11:19:18 +01:00
Minor modifications thanks to David' comments. Adding some comments to explain the new process: hope it's clearer now
This commit is contained in:
parent
65ef047c38
commit
f7e614684d
@ -53,8 +53,14 @@ public:
|
||||
void set_timeout(int msec) { timeout_ = msec; }
|
||||
|
||||
Result Load(const QUrl& url);
|
||||
|
||||
// For async load, to effectively load songs
|
||||
// To effectively load the songs:
|
||||
// when we call Load() on a directory, it will return WillLoadAsync, load the
|
||||
// files with only filenames and emit LoadFinished(). When LoadFinished() is
|
||||
// received by songloaderinserter, it will insert songs (incompletely loaded)
|
||||
// in playlist, and call EffectiveSongsLoad() in a background thread to
|
||||
// perform the real load of the songs. Next, UpdateItems() will be called on
|
||||
// playlist and replace the partially-loaded items by the new ones, fully
|
||||
// loaded.
|
||||
void EffectiveSongsLoad();
|
||||
|
||||
signals:
|
||||
|
@ -106,7 +106,7 @@ void SongLoaderInserter::PendingLoadFinished(bool success) {
|
||||
|
||||
void SongLoaderInserter::PartiallyFinished() {
|
||||
// Insert songs (that haven't been completelly loaded) to allow user to see
|
||||
// and playing them while not loaded completely
|
||||
// and play them while not loaded completely
|
||||
if (destination_) {
|
||||
destination_->InsertSongsOrLibraryItems(songs_, row_, play_now_, enqueue_);
|
||||
}
|
||||
@ -120,9 +120,10 @@ void SongLoaderInserter::EffectiveLoad() {
|
||||
if(destination_) {
|
||||
destination_->UpdateItems(loader->songs());
|
||||
}
|
||||
loader->deleteLater();
|
||||
}
|
||||
task_manager_->SetTaskFinished(async_load_id_);
|
||||
|
||||
deleteLater();
|
||||
}
|
||||
|
||||
void SongLoaderInserter::Finished() {
|
||||
|
Loading…
Reference in New Issue
Block a user