diff options
author | Chris Xiong <chirs241097@gmail.com> | 2022-09-19 02:39:03 -0400 |
---|---|---|
committer | Chris Xiong <chirs241097@gmail.com> | 2022-09-19 02:39:03 -0400 |
commit | 41e9051f2d809c42c3dfecc2eb11ad544cbd27b7 (patch) | |
tree | e370e08b0e0a45c6eef38704aa2f2b2b0e6d8033 /qdeduper/filescanner.hpp | |
parent | 4b8d314f575d9e893d8dda7431194f8b470fc888 (diff) | |
download | deduper-41e9051f2d809c42c3dfecc2eb11ad544cbd27b7.tar.xz |
You break it, you fix it!
The GUI is now working again, with scanning built-in.
Diffstat (limited to 'qdeduper/filescanner.hpp')
-rw-r--r-- | qdeduper/filescanner.hpp | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/qdeduper/filescanner.hpp b/qdeduper/filescanner.hpp new file mode 100644 index 0000000..5d927a4 --- /dev/null +++ b/qdeduper/filescanner.hpp @@ -0,0 +1,30 @@ +#ifndef FILESCANNER_HPP +#define FILESCANNER_HPP + +#include <filesystem> +#include <string> +#include <utility> +#include <vector> +#include <QObject> + +namespace fs = std::filesystem; + +class FileScanner : public QObject +{ + Q_OBJECT + std::vector<std::string> mn; + std::vector<std::pair<fs::path, bool>> paths; + std::vector<fs::path> ret; + std::size_t maxmnlen; +public: + FileScanner(); + void add_magic_number(const std::string &m); + void add_path(const fs::path &p, bool recurse = false); + void scan(); + std::vector<fs::path> file_list(); +Q_SIGNALS: + void scan_done_prep(std::size_t nfiles); + void file_scanned(const fs::path &p, std::size_t n); +}; + +#endif |