properly handle a currently running hashing task

Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
This commit is contained in:
Rachel Powers
2022-11-11 15:45:40 -07:00
parent 5909af9878
commit 3f6cc17818
4 changed files with 94 additions and 36 deletions

View File

@ -39,9 +39,11 @@ protected:
private:
Ui::BlockedModsDialog *ui;
QList<BlockedMod> &mods;
QFileSystemWatcher watcher;
shared_qobject_ptr<ConcurrentTask> hashing_task;
QList<BlockedMod> &m_mods;
QFileSystemWatcher m_watcher;
shared_qobject_ptr<ConcurrentTask> m_hashing_task;
QSet<QString> m_pending_hash_paths;
bool m_rehash_pending;
void openAll();
void addDownloadFolder();
@ -49,10 +51,13 @@ private:
void directoryChanged(QString path);
void setupWatch();
void scanPaths();
void scanPath(QString path);
void scanPath(QString path, bool start_task);
void addHashTask(QString path);
void buildHashTask(QString path);
void checkMatchHash(QString hash, QString path);
void validateMatchedMods();
void runHashTask();
void hashTaskFinished();
bool checkValidPath(QString path);
bool allModsMatched();