diff options
author | Chris Xiong <chirs241097@gmail.com> | 2022-09-19 03:04:11 -0400 |
---|---|---|
committer | Chris Xiong <chirs241097@gmail.com> | 2022-09-19 03:04:11 -0400 |
commit | 3aca10232a1cf1f8abbebcc39c46ba2779feed9a (patch) | |
tree | 3e59d89452f979183b4caf489ab50f2d873d99e9 /qdeduper | |
parent | e3c8b5ee7351fe062fe6a2b1322656ecde015796 (diff) | |
download | deduper-3aca10232a1cf1f8abbebcc39c46ba2779feed9a.tar.xz |
Everything in concurrent::run is in another thread...
Diffstat (limited to 'qdeduper')
-rw-r--r-- | qdeduper/mingui.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/qdeduper/mingui.cpp b/qdeduper/mingui.cpp index 413ed27..c10be0c 100644 --- a/qdeduper/mingui.cpp +++ b/qdeduper/mingui.cpp @@ -348,10 +348,10 @@ void DeduperMainWindow::scan_dirs(std::vector<std::pair<fs::path, bool>> paths) std::for_each(paths.begin(), paths.end(), [fs](auto p){fs->add_path(p.first, p.second);}); fs->add_magic_number("\x89PNG\r\n"); fs->add_magic_number("\xff\xd8\xff"); - QObject::connect(fs, &FileScanner::scan_done_prep, [this](auto n) { + QObject::connect(fs, &FileScanner::scan_done_prep, this, [this](auto n) { this->pd->setMaximum(n - 1); - }); - QObject::connect(fs, &FileScanner::file_scanned, [this](const fs::path &p, size_t c) { + }, Qt::ConnectionType::QueuedConnection); + QObject::connect(fs, &FileScanner::file_scanned, this, [this](const fs::path &p, size_t c) { static auto lt = std::chrono::steady_clock::now(); using namespace std::literals; if (std::chrono::steady_clock::now() - lt > 100ms) @@ -360,7 +360,7 @@ void DeduperMainWindow::scan_dirs(std::vector<std::pair<fs::path, bool>> paths) this->pd->setLabelText(QString("Looking for files to scan: %1").arg(fsstr_to_qstring(p))); this->pd->setValue(c); } - }); + }, Qt::ConnectionType::QueuedConnection); fs->scan(); this->pd->setMaximum(fs->file_list().size() - 1); this->pd->setLabelText("Scanning..."); |