summaryrefslogtreecommitdiff
path: root/src/mainwindow.cpp
diff options
context:
space:
mode:
authorisanae <14251494+isanae@users.noreply.github.com>2020-02-18 17:22:29 -0500
committerGitHub <noreply@github.com>2020-02-18 17:22:29 -0500
commit8c2814c9dc0d92e1ab015cde33eee8dcf880e265 (patch)
tree19b00758324fac115b466c51c3fe6f17ccd42375 /src/mainwindow.cpp
parentcfb05d72be19ce0413f1de776eb3b2c150807e83 (diff)
parent8e3ab9fb6614e93239662cab8b0bb726285a255e (diff)
Merge pull request #1000 from Al12rs/startup_performance
Startup performance
Diffstat (limited to 'src/mainwindow.cpp')
-rw-r--r--src/mainwindow.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index de1be9fe..8f2dd250 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");
@@ -5282,6 +5291,10 @@ void MainWindow::initDownloadView()
void MainWindow::updateDownloadView()
{
+ // this means downlaodTab initialization hasnt happened yet
+ if (ui->downloadView->model() == nullptr) {
+ return;
+ }
// set the view attribute and default row sizes
if (m_OrganizerCore.settings().interface().compactDownloads()) {
ui->downloadView->setProperty("downloadView", "compact");