From d6663fe7b71db340b3c7a1d069c473f725caa3a8 Mon Sep 17 00:00:00 2001 From: Chris Xiong Date: Mon, 29 Aug 2022 12:19:25 -0400 Subject: Trying to support the superior operating system. Also reformat a bit of legacy code. Smells like mold. --- mingui/mingui.hpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'mingui/mingui.hpp') diff --git a/mingui/mingui.hpp b/mingui/mingui.hpp index 7ed0eb1..3a5dddc 100644 --- a/mingui/mingui.hpp +++ b/mingui/mingui.hpp @@ -1,6 +1,7 @@ #ifndef MINGUI_HPP #define MINGUI_HPP +#include #include #include #include @@ -11,6 +12,8 @@ class QHBoxLayout; class QLabel; class QStatusBar; +namespace fs = std::filesystem; + class MinGuiWidget : public QWidget { Q_OBJECT @@ -25,17 +28,17 @@ private: void mark_all(); void mark_none(); void mark_view_update(bool update_msg = true); - std::string common_prefix(const std::vector &fns); + fs::path::string_type common_prefix(const std::vector &fns); std::vector imgw; std::vector marks; - std::unordered_set marked; - std::vector current_set; + std::unordered_set marked; + std::vector current_set; protected: void keyPressEvent(QKeyEvent *e) override; void keyReleaseEvent(QKeyEvent *e) override; public: MinGuiWidget(); - void show_images(const std::vector &fns); + void show_images(const std::vector &fns); void update_distances(const std::map, double> &d); void update_permamsg(std::size_t cur, std::size_t size); void save_list(); @@ -55,7 +58,7 @@ private: protected: void mouseReleaseEvent(QMouseEvent *event) override; public: - ImageWidget(std::string f, std::string dispfn, std::size_t _idx, int max_width, int max_height, QWidget *par); + ImageWidget(fs::path f, fs::path::string_type dispfn, std::size_t _idx, int max_width, int max_height, QWidget *par); void set_marked(bool marked); Q_SIGNALS: void clicked(); -- cgit v1.2.3