forked from qt-creator/qt-creator
Utils: Return a bit more data from DeviceShell::runInShell
Pass on stderr data and exit code to the caller, it's typically in a better condition to handle errors. Use it to notify the user about non-available 'find' arguments and fix the fallback to ls-based operation. Change-Id: I535535de2ffa09cad1dd6e9b07eb69f807dbae2f Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -33,6 +33,13 @@ namespace Utils {
|
||||
|
||||
class CommandLine;
|
||||
|
||||
struct QTCREATOR_UTILS_EXPORT RunResult
|
||||
{
|
||||
int exitCode = 0;
|
||||
QByteArray stdOut;
|
||||
QByteArray stdErr;
|
||||
};
|
||||
|
||||
class QTCREATOR_UTILS_EXPORT FileUtils
|
||||
{
|
||||
public:
|
||||
@@ -89,7 +96,7 @@ public:
|
||||
const FilePath &base,
|
||||
const FileFilter &filter,
|
||||
bool *useFind,
|
||||
const std::function<QByteArray(const CommandLine &)> &runInShell,
|
||||
const std::function<RunResult(const CommandLine &)> &runInShell,
|
||||
const std::function<bool(const FilePath &)> &callBack);
|
||||
|
||||
static qint64 bytesAvailableFromDFOutput(const QByteArray &dfOutput);
|
||||
|
||||
Reference in New Issue
Block a user