forked from qt-creator/qt-creator
Fix warnings
Don't try to write from another thread into a process stdin. Fixes "QSocketNotifier: Socket notifiers cannot be enabled or disabled from another thread" warnings. Change-Id: Id93a40a6bee6d4042cf600c8fabb06bf965d8ccc Reviewed-by: hjk <hjk@theqtcompany.com>
This commit is contained in:
committed by
BogDan Vatra
parent
cb6acf32f9
commit
e26bbc8459
@@ -249,6 +249,11 @@ static int extractPid(const QString &exeName, const QByteArray &psOutput)
|
|||||||
|
|
||||||
QByteArray AndroidRunner::runPs()
|
QByteArray AndroidRunner::runPs()
|
||||||
{
|
{
|
||||||
|
if (QThread::currentThread() != thread()) {
|
||||||
|
QByteArray ret;
|
||||||
|
QMetaObject::invokeMethod(this, "runPs", Qt::BlockingQueuedConnection, Q_RETURN_ARG(QByteArray, ret));
|
||||||
|
return ret;
|
||||||
|
} else {
|
||||||
QByteArray psLine("ps");
|
QByteArray psLine("ps");
|
||||||
if (m_isBusyBox)
|
if (m_isBusyBox)
|
||||||
psLine += " -w";
|
psLine += " -w";
|
||||||
@@ -256,6 +261,7 @@ QByteArray AndroidRunner::runPs()
|
|||||||
m_psProc.write(psLine);
|
m_psProc.write(psLine);
|
||||||
m_psProc.waitForBytesWritten(psLine.size());
|
m_psProc.waitForBytesWritten(psLine.size());
|
||||||
return m_psProc.readAllStandardOutput();
|
return m_psProc.readAllStandardOutput();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void AndroidRunner::checkPID()
|
void AndroidRunner::checkPID()
|
||||||
|
|||||||
@@ -80,12 +80,12 @@ private slots:
|
|||||||
void logcatReadStandardError();
|
void logcatReadStandardError();
|
||||||
void logcatReadStandardOutput();
|
void logcatReadStandardOutput();
|
||||||
void asyncStart();
|
void asyncStart();
|
||||||
|
QByteArray runPs();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void adbKill(qint64 pid);
|
void adbKill(qint64 pid);
|
||||||
QStringList selector() const { return m_selector; }
|
QStringList selector() const { return m_selector; }
|
||||||
void forceStop();
|
void forceStop();
|
||||||
QByteArray runPs();
|
|
||||||
void findPs();
|
void findPs();
|
||||||
void logcatProcess(const QByteArray &text, QByteArray &buffer, bool onlyError);
|
void logcatProcess(const QByteArray &text, QByteArray &buffer, bool onlyError);
|
||||||
bool adbShellAmNeedsQuotes();
|
bool adbShellAmNeedsQuotes();
|
||||||
|
|||||||
Reference in New Issue
Block a user