diff options
author | ConfuSomu | 2023-07-10 13:27:34 +0200 |
---|---|---|
committer | ConfuSomu | 2023-07-10 13:42:16 +0200 |
commit | 5befd0666aef0b96e3e4bd41ed704ccaa3ace5d5 (patch) | |
tree | 76402efb62ecf9bc1817910179afc7f71b646e32 /src/mainwindow.h | |
parent | 9b70e3c5a208a881188bc6468fe27933cbdb02f8 (diff) | |
download | ActorViewer-5befd0666aef0b96e3e4bd41ed704ccaa3ace5d5.tar ActorViewer-5befd0666aef0b96e3e4bd41ed704ccaa3ace5d5.tar.gz ActorViewer-5befd0666aef0b96e3e4bd41ed704ccaa3ace5d5.zip |
Implement basic multithreading support
A few CPU heavy operations, which are opening an archive and displaying
a selected Activity, have been moved to another thread to avoid having
long-running operations on the main thread.
Diffstat (limited to 'src/mainwindow.h')
-rw-r--r-- | src/mainwindow.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/mainwindow.h b/src/mainwindow.h index f1de2d7..abf9acc 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -3,6 +3,8 @@ #include <QMainWindow> #include <QListWidgetItem> #include <QLocale> +#include <QFutureWatcher> +#include <variant> #include "archive_parser.h" #include "types.h" @@ -47,6 +49,12 @@ private: void reset_view_filters(); void relist_statuses(); void open_file(const QString &filename); + void archive_thread_watcher_done(); + + void finish_listWidget_itemActivated(const QString& status_info); + void finish_open_file(const Archive::InitError& parse_error); + + QString open_file_filename; Ui::MainWindow *ui; @@ -54,6 +62,7 @@ private: bool view_filters_changed = false; Archive *data_archive = nullptr; + QFutureWatcher<std::variant<QString, Archive::InitError>> archive_thread_watcher; QLocale locale_context; }; |