diff --git a/README.md b/README.md index 3e82d9c..2fd29bd 100644 --- a/README.md +++ b/README.md @@ -82,7 +82,7 @@ If you only want devices from the loaded backend you can call QList devices = backend->scanDevices( excludeReadOnly ); ``` -where bool option `excludeReadOnly` specifies whether to exclude +where `bool` option `excludeReadOnly` specifies whether to exclude read only devices. #### KPMcore device scanner diff --git a/src/util/externalcommand.cpp b/src/util/externalcommand.cpp index 6e3607a..b38b1f2 100644 --- a/src/util/externalcommand.cpp +++ b/src/util/externalcommand.cpp @@ -116,7 +116,7 @@ bool ExternalCommand::run(int timeout) void ExternalCommand::onReadOutput() { - const QString s = QString::fromUtf8(readAllStandardOutput()); + const QByteArray s = readAllStandardOutput(); if(m_Output.length() > 10*1024*1024) { // prevent memory overflow for badly corrupted file systems if (report()) @@ -127,7 +127,7 @@ void ExternalCommand::onReadOutput() m_Output += s; if (report()) - *report() << s; + *report() << QString::fromLocal8Bit(s); } void ExternalCommand::onFinished(int exitCode, QProcess::ExitStatus exitStatus) diff --git a/src/util/externalcommand.h b/src/util/externalcommand.h index f9a665f..f854ee0 100644 --- a/src/util/externalcommand.h +++ b/src/util/externalcommand.h @@ -61,7 +61,11 @@ public: return m_ExitCode; /**< @return the exit code */ } - const QString& output() const { + const QString output() const { + return QString::fromLocal8Bit(m_Output); /**< @return the command output */ + } + + const QByteArray& rawOutput() const { return m_Output; /**< @return the command output */ } @@ -83,7 +87,7 @@ private: QString m_Command; QStringList m_Args; int m_ExitCode; - QString m_Output; + QByteArray m_Output; }; #endif