mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-09 15:47:38 +02:00
* Set model on the view before startLoading().
This commit is contained in:
@@ -478,15 +478,17 @@ void
|
|||||||
NetworkActivityWidget::showWeekCharts()
|
NetworkActivityWidget::showWeekCharts()
|
||||||
{
|
{
|
||||||
Q_D( NetworkActivityWidget );
|
Q_D( NetworkActivityWidget );
|
||||||
|
|
||||||
d->activeView = WeekChart;
|
d->activeView = WeekChart;
|
||||||
if ( !d->weeklyChartsModel.isNull() )
|
if ( !d->weeklyChartsModel )
|
||||||
{
|
|
||||||
d->ui->tracksViewLeft->setPlaylistModel( d_func()->weeklyChartsModel );
|
|
||||||
d->ui->tracksViewLeft->setAutoResize( true );
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
d->weeklyChartsModel = new PlaylistModel( d->ui->tracksViewLeft );
|
d->weeklyChartsModel = new PlaylistModel( d->ui->tracksViewLeft );
|
||||||
|
}
|
||||||
|
d->ui->tracksViewLeft->setPlaylistModel( d_func()->weeklyChartsModel );
|
||||||
|
d->ui->tracksViewLeft->setAutoResize( true );
|
||||||
|
|
||||||
|
if ( d->weeklyChartsModel->rowCount( QModelIndex() ) == 0 )
|
||||||
|
{
|
||||||
d->weeklyChartsModel->startLoading();
|
d->weeklyChartsModel->startLoading();
|
||||||
fetchWeekCharts();
|
fetchWeekCharts();
|
||||||
}
|
}
|
||||||
@@ -499,14 +501,15 @@ NetworkActivityWidget::showMonthCharts()
|
|||||||
Q_D( NetworkActivityWidget );
|
Q_D( NetworkActivityWidget );
|
||||||
|
|
||||||
d->activeView = MonthChart;
|
d->activeView = MonthChart;
|
||||||
if ( !d->monthlyChartsModel.isNull() )
|
if ( !d->monthlyChartsModel )
|
||||||
{
|
|
||||||
d->ui->tracksViewLeft->setPlaylistModel( d_func()->monthlyChartsModel );
|
|
||||||
d->ui->tracksViewLeft->setAutoResize( true );
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
d->monthlyChartsModel = new PlaylistModel( d->ui->tracksViewLeft );
|
d->monthlyChartsModel = new PlaylistModel( d->ui->tracksViewLeft );
|
||||||
|
}
|
||||||
|
d->ui->tracksViewLeft->setPlaylistModel( d_func()->monthlyChartsModel );
|
||||||
|
d->ui->tracksViewLeft->setAutoResize( true );
|
||||||
|
|
||||||
|
if ( d->monthlyChartsModel->rowCount( QModelIndex() ) == 0 )
|
||||||
|
{
|
||||||
d->monthlyChartsModel->startLoading();
|
d->monthlyChartsModel->startLoading();
|
||||||
fetchMonthCharts();
|
fetchMonthCharts();
|
||||||
}
|
}
|
||||||
@@ -519,14 +522,15 @@ NetworkActivityWidget::showYearCharts()
|
|||||||
Q_D( NetworkActivityWidget );
|
Q_D( NetworkActivityWidget );
|
||||||
|
|
||||||
d->activeView = YearChart;
|
d->activeView = YearChart;
|
||||||
if ( !d->yearlyChartsModel.isNull() )
|
if ( !d->yearlyChartsModel )
|
||||||
{
|
|
||||||
d->ui->tracksViewLeft->setPlaylistModel( d->yearlyChartsModel );
|
|
||||||
d->ui->tracksViewLeft->setAutoResize( true );
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
d->yearlyChartsModel = new PlaylistModel( d->ui->tracksViewLeft );
|
d->yearlyChartsModel = new PlaylistModel( d->ui->tracksViewLeft );
|
||||||
|
}
|
||||||
|
d->ui->tracksViewLeft->setPlaylistModel( d->yearlyChartsModel );
|
||||||
|
d->ui->tracksViewLeft->setAutoResize( true );
|
||||||
|
|
||||||
|
if ( d->yearlyChartsModel->rowCount( QModelIndex() ) == 0 )
|
||||||
|
{
|
||||||
d->yearlyChartsModel->startLoading();
|
d->yearlyChartsModel->startLoading();
|
||||||
fetchYearCharts();
|
fetchYearCharts();
|
||||||
}
|
}
|
||||||
@@ -539,14 +543,15 @@ NetworkActivityWidget::showOverallCharts()
|
|||||||
Q_D( NetworkActivityWidget );
|
Q_D( NetworkActivityWidget );
|
||||||
|
|
||||||
d->activeView = OverallChart;
|
d->activeView = OverallChart;
|
||||||
if ( !d->overallChartsModel.isNull() )
|
if ( !d->overallChartsModel )
|
||||||
{
|
|
||||||
d->ui->tracksViewLeft->setPlaylistModel( d->overallChartsModel );
|
|
||||||
d->ui->tracksViewLeft->setAutoResize( true );
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
d->overallChartsModel = new PlaylistModel( d->ui->tracksViewLeft );
|
d->overallChartsModel = new PlaylistModel( d->ui->tracksViewLeft );
|
||||||
|
}
|
||||||
|
d->ui->tracksViewLeft->setPlaylistModel( d->overallChartsModel );
|
||||||
|
d->ui->tracksViewLeft->setAutoResize( true );
|
||||||
|
|
||||||
|
if ( d->overallChartsModel->rowCount( QModelIndex() ) == 0 )
|
||||||
|
{
|
||||||
d->overallChartsModel->startLoading();
|
d->overallChartsModel->startLoading();
|
||||||
fetchOverallCharts();
|
fetchOverallCharts();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user