diff options
author | Rachel Powers <508861+Ryex@users.noreply.github.com> | 2022-10-25 01:19:19 -0700 |
---|---|---|
committer | Rachel Powers <508861+Ryex@users.noreply.github.com> | 2022-11-01 04:24:11 -0700 |
commit | 1598d6582473f1bb6aa02fd9b4dabc8210771e56 (patch) | |
tree | 42dcb5df3a1629af1c1a7a0205545a835234e7d8 /launcher/ui/dialogs/BlockedModsDialog.h | |
parent | 028e086960402f685e07163def36d6b5eee1b796 (diff) | |
download | PrismLauncher-1598d6582473f1bb6aa02fd9b4dabc8210771e56.tar.gz PrismLauncher-1598d6582473f1bb6aa02fd9b4dabc8210771e56.tar.bz2 PrismLauncher-1598d6582473f1bb6aa02fd9b4dabc8210771e56.zip |
watch filesystem, compute and match hashes
Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
Diffstat (limited to 'launcher/ui/dialogs/BlockedModsDialog.h')
-rw-r--r-- | launcher/ui/dialogs/BlockedModsDialog.h | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/launcher/ui/dialogs/BlockedModsDialog.h b/launcher/ui/dialogs/BlockedModsDialog.h index 4be020ec..f1ea99ca 100644 --- a/launcher/ui/dialogs/BlockedModsDialog.h +++ b/launcher/ui/dialogs/BlockedModsDialog.h @@ -1,7 +1,14 @@ #pragma once #include <QDialog> +#include <QString> +#include <QList> +#include <QFileSystemWatcher> + +#include "modplatform/helpers/HashUtils.h" + +#include "tasks/ConcurrentTask.h" struct BlockedMod { QString name; @@ -20,15 +27,27 @@ class BlockedModsDialog : public QDialog { Q_OBJECT public: - BlockedModsDialog(QWidget *parent, const QString &title, const QString &text, const QList<BlockedMod> &mods); + BlockedModsDialog(QWidget *parent, const QString &title, const QString &text, QList<BlockedMod> &mods); ~BlockedModsDialog() override; private: Ui::BlockedModsDialog *ui; - const QList<BlockedMod> &mods; + QList<BlockedMod> &mods; + QFileSystemWatcher watcher; + shared_qobject_ptr<ConcurrentTask> hashing_task; + QSet<QString> checked_paths; + void openAll(); void update(); + void directoryChanged(QString path); + void setupWatch(); + void scanPaths(bool init); + void scanPath(QString path, bool init); + void checkMatchHash(QString hash, QString path); + + bool checkValidPath(QString path); + bool allModsMatched(); }; |