diff options
| author | AL <26797547+Al12rs@users.noreply.github.com> | 2020-02-16 15:42:49 +0100 |
|---|---|---|
| committer | AL <26797547+Al12rs@users.noreply.github.com> | 2020-02-16 15:54:40 +0100 |
| commit | c4059f0dfe636a137085e1cf86ffc13a3142c59a (patch) | |
| tree | c6472c5f5abfdba72b84e0fba94b654b6d97d3bc /src/mainwindow.cpp | |
| parent | 60c86e7cee8b3accd8c9654b9a5e60d76a406923 (diff) | |
Avoid refreshing the profile again when initializing the pforilebox
Diffstat (limited to 'src/mainwindow.cpp')
| -rw-r--r-- | src/mainwindow.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index de1be9fe..d42eabac 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -1659,6 +1659,15 @@ void MainWindow::on_profileBox_currentIndexChanged(int index) m_OrganizerCore.saveCurrentLists(); } + // Avoid doing any refresh if currentProfile is already set but previous index was -1 + // as it means that this is happening during initialization so everything has already been set. + if (previousIndex == -1 + && m_OrganizerCore.currentProfile() != nullptr + && m_OrganizerCore.currentProfile()->exists() + && ui->profileBox->currentText() == m_OrganizerCore.currentProfile()->name()){ + return; + } + // ensure the new index is valid if (index < 0 || index >= ui->profileBox->count()) { log::debug("invalid profile index, using last profile"); |
