diff options
| author | isanae <14251494+isanae@users.noreply.github.com> | 2019-11-18 17:04:01 -0500 |
|---|---|---|
| committer | isanae <14251494+isanae@users.noreply.github.com> | 2019-11-18 17:04:01 -0500 |
| commit | 2b5747c19d942974295be18042fbdde8ddc4cc78 (patch) | |
| tree | e4688729fa185abe7d91027d14c90edddb103047 /src/loot.h | |
| parent | 27dadd016422765acb774ed2ed9ddae480eda46d (diff) | |
handles changes in lootcli for a more formal communication protocol
Diffstat (limited to 'src/loot.h')
| -rw-r--r-- | src/loot.h | 12 |
1 files changed, 9 insertions, 3 deletions
@@ -3,9 +3,13 @@ #include "envmodule.h" #include <log.h> +#include <lootcli/lootcli.h> #include <windows.h> #include <QWidget> +Q_DECLARE_METATYPE(lootcli::Progress); +Q_DECLARE_METATYPE(MOBase::log::Levels); + class OrganizerCore; class Loot : public QObject @@ -22,10 +26,9 @@ public: signals: void output(const QString& s); - void progress(const QString& s); + void progress(const lootcli::Progress p); + void log(MOBase::log::Levels level, const QString& s); void information(const QString& mod, const QString& info); - void errorMessage(const QString& s); - void error(const QString& s); void finished(); private: @@ -35,12 +38,15 @@ private: QString m_outPath; env::HandlePtr m_lootProcess; env::HandlePtr m_stdout; + std::string m_outputBuffer; std::string readFromPipe(); void lootThread(); bool waitForCompletion(); + void processStdout(const std::string &lootOut); + void processMessage(const lootcli::Message& m); void processOutputFile(); bool processOutputPlugin(const QJsonValue& pluginValue); |
