diff options
author | Chris Xiong <chirs241097@gmail.com> | 2022-10-07 22:23:03 -0400 |
---|---|---|
committer | Chris Xiong <chirs241097@gmail.com> | 2022-10-07 22:23:03 -0400 |
commit | 0069cd015c713bca311adbdcd7c0578c64cdddf8 (patch) | |
tree | 2bb286ec85bff201b153bbc456b51291d7c5f558 | |
parent | e5fd0b57f73e0315212fdb098efc1a617fc02924 (diff) | |
download | deduper-0069cd015c713bca311adbdcd7c0578c64cdddf8.tar.xz |
Emit path with native separator from file scanner.
-rw-r--r-- | qdeduper/filescanner.cpp | 6 |
1 files 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<void(const fs::directory_entry&)> f) { for (auto &pe : paths) |