From 877224b6e1d7b831267dbfd78d382c1a074f074d Mon Sep 17 00:00:00 2001 From: Albert S Date: Tue, 23 Aug 2022 17:35:50 +0200 Subject: [PATCH] gui: mainwindow: Only trigger preview generation when in tab Indirectly generation would fire when we set combobox index programitcally. So it's slot should only trigger the generation when the user is viewing the preview tab --- gui/mainwindow.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/gui/mainwindow.cpp b/gui/mainwindow.cpp index e3e106a..f23828f 100644 --- a/gui/mainwindow.cpp +++ b/gui/mainwindow.cpp @@ -198,7 +198,14 @@ void MainWindow::connectSignals() connect(ui->btnSaveSettings, &QPushButton::clicked, this, &MainWindow::saveSettings); connect(ui->btnOpenFailed, &QPushButton::clicked, this, &MainWindow::exportFailedPaths); connect( - ui->comboPreviewFiles, qOverload(&QComboBox::currentIndexChanged), this, [&]() { makePreviews(1); }, + ui->comboPreviewFiles, qOverload(&QComboBox::currentIndexChanged), this, + [&]() + { + if(this->previewTabActive()) + { + makePreviews(1); + } + }, Qt::QueuedConnection); connect(&ipcPreviewClient, &IPCPreviewClient::previewReceived, this, &MainWindow::previewReceived, Qt::QueuedConnection);