Qt: always set the current tab on startup

This commit is contained in:
Brad Parker 2018-07-28 18:46:51 -04:00
parent e579842620
commit 978edc7acf

View File

@ -535,15 +535,12 @@ static void* ui_companion_qt_init(void)
/* setting the last tab must come after setting the view type */ /* setting the last tab must come after setting the view type */
if (qsettings->contains("save_last_tab")) if (qsettings->contains("save_last_tab"))
{ {
if (qsettings->contains("last_tab")) int lastTabIndex = qsettings->value("last_tab", 0).toInt();
{
int lastTabIndex = qsettings->value("last_tab", 0).toInt();
if (lastTabIndex >= 0 && browserAndPlaylistTabWidget->count() > lastTabIndex) if (lastTabIndex >= 0 && browserAndPlaylistTabWidget->count() > lastTabIndex)
{ {
browserAndPlaylistTabWidget->setCurrentIndex(lastTabIndex); browserAndPlaylistTabWidget->setCurrentIndex(lastTabIndex);
mainwindow->onTabWidgetIndexChanged(lastTabIndex); mainwindow->onTabWidgetIndexChanged(lastTabIndex);
}
} }
} }
else else