summaryrefslogtreecommitdiff
path: root/src/loot.h
diff options
context:
space:
mode:
authorisanae <14251494+isanae@users.noreply.github.com>2019-11-18 17:04:01 -0500
committerisanae <14251494+isanae@users.noreply.github.com>2019-11-18 17:04:01 -0500
commit2b5747c19d942974295be18042fbdde8ddc4cc78 (patch)
treee4688729fa185abe7d91027d14c90edddb103047 /src/loot.h
parent27dadd016422765acb774ed2ed9ddae480eda46d (diff)
handles changes in lootcli for a more formal communication protocol
Diffstat (limited to 'src/loot.h')
-rw-r--r--src/loot.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/loot.h b/src/loot.h
index 11bb4987..ab959f2e 100644
--- a/src/loot.h
+++ b/src/loot.h
@@ -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);