From 0069cd015c713bca311adbdcd7c0578c64cdddf8 Mon Sep 17 00:00:00 2001 From: Chris Xiong Date: Fri, 7 Oct 2022 22:23:03 -0400 Subject: Emit path with native separator from file scanner. --- qdeduper/filescanner.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/qdeduper/filescanner.cpp b/qdeduper/filescanner.cpp index 547e86a..3120291 100644 --- a/qdeduper/filescanner.cpp +++ b/qdeduper/filescanner.cpp @@ -47,13 +47,15 @@ void FileScanner::scan() std::string buf(maxmnlen, '\0'); fst.read(buf.data(), maxmnlen); buf.resize(fst.gcount()); + auto path_nativesp = e.path(); + path_nativesp.make_preferred(); for (auto &magic : mn) if (!memcmp(magic.data(), buf.data(), magic.length())) { - ret.push_back(e.path()); + ret.push_back(path_nativesp); break; } - Q_EMIT file_scanned(e.path(), ++fcnt); + Q_EMIT file_scanned(path_nativesp, ++fcnt); }; auto for_all_paths = [opt, this](std::function f) { for (auto &pe : paths) -- cgit v1.2.3