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:
hjk
2022-10-07 16:54:27 +02:00
parent bf5a8835ee
commit 5dde520a43
8 changed files with 125 additions and 172 deletions

View File

@@ -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);