Check OS info from GUI #4933
This commit is contained in:
parent
d4d5d83bb6
commit
2535f3466c
|
@ -32,7 +32,7 @@ QString CommandProcess::run()
|
||||||
QProcess process;
|
QProcess process;
|
||||||
process.setReadChannel(QProcess::StandardOutput);
|
process.setReadChannel(QProcess::StandardOutput);
|
||||||
process.start(m_Command, m_Arguments);
|
process.start(m_Command, m_Arguments);
|
||||||
bool success = process.waitForFinished();
|
bool success = process.waitForStarted();
|
||||||
|
|
||||||
QString output, error;
|
QString output, error;
|
||||||
if (success)
|
if (success)
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
#include "QUtility.h"
|
#include "QUtility.h"
|
||||||
|
|
||||||
#include "ProcessorArch.h"
|
#include "ProcessorArch.h"
|
||||||
#include "CommandProcess"
|
#include "CommandProcess.h"
|
||||||
|
|
||||||
#if defined(Q_OS_LINUX)
|
#if defined(Q_OS_LINUX)
|
||||||
#include <QProcess>
|
#include <QProcess>
|
||||||
|
@ -94,18 +94,20 @@ qProcessorArch getProcessorArch()
|
||||||
|
|
||||||
QString getOSInformation()
|
QString getOSInformation()
|
||||||
{
|
{
|
||||||
QString output;
|
QString result;
|
||||||
|
|
||||||
#if defined(Q_OS_LINUX)
|
#if defined(Q_OS_LINUX)
|
||||||
CommandProcess cp("/bin/cat", "/etc/os-release");
|
QStringList arguments;
|
||||||
|
arguments.append("/etc/os-release");
|
||||||
|
CommandProcess cp("/bin/cat", arguments);
|
||||||
QString output = cp.run();
|
QString output = cp.run();
|
||||||
|
|
||||||
QRegExp resultRegex(".*PRETTY_NAME=\".*\".*");
|
QRegExp resultRegex(".*PRETTY_NAME=\"([^\"]+)\".*");
|
||||||
if (resultRegex.exactMatch(output)) {
|
if (resultRegex.exactMatch(output)) {
|
||||||
QString OSInfo = resultRegex.cap(1);
|
QString OSInfo = resultRegex.cap(1);
|
||||||
output = OSInfo;
|
result = OSInfo;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return output;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
|
@ -94,6 +94,12 @@ QString WebClient::request(
|
||||||
{
|
{
|
||||||
QStringList args("--login-auth");
|
QStringList args("--login-auth");
|
||||||
// hash password in case it contains interesting chars.
|
// hash password in case it contains interesting chars.
|
||||||
QString credentials(email + ":" + hash(password) + ":" + hash(getFirstMacAddress()) + "\n");
|
QString credentials(email + ":" + hash(password) + ":" + hash(getFirstMacAddress()));
|
||||||
|
QString os= getOSInformation();
|
||||||
|
if (!os.isEmpty()) {
|
||||||
|
credentials.append(":").append(os);
|
||||||
|
}
|
||||||
|
credentials.append("\n");
|
||||||
|
|
||||||
return m_CoreInterface.run(args, credentials);
|
return m_CoreInterface.run(args, credentials);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue