From 41e9051f2d809c42c3dfecc2eb11ad544cbd27b7 Mon Sep 17 00:00:00 2001 From: Chris Xiong Date: Mon, 19 Sep 2022 02:39:03 -0400 Subject: You break it, you fix it! The GUI is now working again, with scanning built-in. --- qdeduper/sigdb_qt.hpp | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 qdeduper/sigdb_qt.hpp (limited to 'qdeduper/sigdb_qt.hpp') diff --git a/qdeduper/sigdb_qt.hpp b/qdeduper/sigdb_qt.hpp new file mode 100644 index 0000000..8a5178a --- /dev/null +++ b/qdeduper/sigdb_qt.hpp @@ -0,0 +1,41 @@ +#ifndef SIGDB_QT_HPP +#define SIGDB_QT_HPP + +#include +#include +#include +#include +#include + +#include + +#include "signature_db.hpp" + +namespace fs = std::filesystem; + +class SignatureDB : public QObject +{ + Q_OBJECT +private: + signature_db *sdb; + std::unordered_map fmap; + std::unordered_map frmap; + std::map, double> distmap; + std::vector> groups; +public: + SignatureDB(); + SignatureDB(const fs::path& dbpath); + ~SignatureDB(); + + void scan_files(const std::vector &files, int njobs); + size_t num_groups(); + std::vector get_group(size_t gid); + std::map, double> group_distances(size_t gid); + + fs::path get_image_path(size_t id); + size_t get_path_id(const fs::path& p); +Q_SIGNALS: + void image_scanned(size_t n); +}; + +#endif -- cgit v1.2.3