A small patch

Support specifying client working directory
Clean all compile warnings
This commit is contained in:
wh201906
2021-02-17 01:26:14 +08:00
parent 7f96c061dc
commit aa6b93984c
13 changed files with 312 additions and 197 deletions
+12 -2
View File
@@ -55,7 +55,11 @@ void PM3Process::connectPM3(const QString& path, const QString& port, const QStr
result = result.left(result.indexOf("\r\n"));
result = result.mid(3, result.lastIndexOf(" ") - 3);
emit PM3StatedChanged(true, result);
setSerialListener(port, true);
// if the arguments don't contain <port>, then disable the port listener
// useful when using offline sniff
if(args.indexOf(port) != -1)
setSerialListener(port, true);
}
else
kill();
@@ -132,5 +136,11 @@ void PM3Process::setProcEnv(const QStringList* env)
{
// qDebug() << "passed Env List" << *env;
this->setEnvironment(*env);
// qDebug() << "final Env List" << processEnvironment().toStringList();
// qDebug() << "final Env List" << processEnvironment().toStringList();
}
void PM3Process::setWorkingDir(const QString& dir)
{
// the working directory cannot be the default, or the client will failed to load the dll
this->setWorkingDirectory(dir);
}
+2
View File
@@ -9,6 +9,7 @@
#include <QtSerialPort/QSerialPortInfo>
#include <QtSerialPort/QSerialPort>
#include <QProcessEnvironment>
#include <QDir>
#include "util.h"
@@ -27,6 +28,7 @@ public slots:
qint64 write(QString data);
void reconnectPM3();
void setProcEnv(const QStringList* env);
void setWorkingDir(const QString& dir);
private slots:
void onTimeout();
void onReadyRead();