Don't fetch magnatune library until service is expanded. Fixes issue 3440

This commit is contained in:
Alan Briolat 2013-01-20 23:31:47 +00:00 committed by David Sansome
parent f7cccb26fa
commit 465015fe3c
1 changed files with 3 additions and 3 deletions

View File

@ -129,6 +129,9 @@ void MagnatuneService::LazyPopulate(QStandardItem* item) {
switch (item->data(InternetModel::Role_Type).toInt()) { switch (item->data(InternetModel::Role_Type).toInt()) {
case InternetModel::Type_Service: case InternetModel::Type_Service:
library_model_->Init(); library_model_->Init();
if (total_song_count_ == 0 && !load_database_task_id_) {
ReloadDatabase();
}
model()->merged_model()->AddSubModel(item->index(), library_sort_model_); model()->merged_model()->AddSubModel(item->index(), library_sort_model_);
break; break;
@ -139,9 +142,6 @@ void MagnatuneService::LazyPopulate(QStandardItem* item) {
void MagnatuneService::UpdateTotalSongCount(int count) { void MagnatuneService::UpdateTotalSongCount(int count) {
total_song_count_ = count; total_song_count_ = count;
if (total_song_count_ == 0 && !load_database_task_id_) {
ReloadDatabase();
}
} }
void MagnatuneService::ReloadDatabase() { void MagnatuneService::ReloadDatabase() {