From 1d41325a9685cf677f8eeaa4940f032931fd8780 Mon Sep 17 00:00:00 2001 From: Chris Xiong Date: Wed, 21 Sep 2022 00:11:13 -0400 Subject: STOP CALLING GUI SH*T IN OTHER THREADS!!! --- qdeduper/mingui.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qdeduper/mingui.cpp b/qdeduper/mingui.cpp index f2de718..ba802c7 100644 --- a/qdeduper/mingui.cpp +++ b/qdeduper/mingui.cpp @@ -442,8 +442,8 @@ void DeduperMainWindow::scan_dirs(std::vector> paths) this->fsc = nullptr; return; } - this->pd->setMaximum(fs->file_list().size() - 1); - this->pd->setLabelText("Scanning..."); + int flsize = fs->file_list().size() - 1; + QMetaObject::invokeMethod(this->pd, [flsize, this] {this->pd->setMaximum(flsize);}, Qt::ConnectionType::QueuedConnection); this->sdb = new SignatureDB(); QObject::connect(this->sdb, &SignatureDB::image_scanned, this, [this](size_t n) { static auto lt = std::chrono::steady_clock::now(); -- cgit v1.2.3