forked from qt-creator/qt-creator
Android: Fix asserts triggered on app startup
The QVariant values of Store map are apparently of QStringList type, not QString. This fixes the following asserts triggered on every startup: "sd.first().typeId() == QMetaType::QString". Change-Id: I84eb6a942503632d047939b138727c75e9e7037e Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
@@ -171,24 +171,26 @@ AndroidRunnerWorker::AndroidRunnerWorker(RunWorker *runner, const QString &packa
|
|||||||
m_extraAppParams = runControl->commandLine().arguments();
|
m_extraAppParams = runControl->commandLine().arguments();
|
||||||
|
|
||||||
if (const Store sd = runControl->settingsData(Constants::ANDROID_AM_START_ARGS);
|
if (const Store sd = runControl->settingsData(Constants::ANDROID_AM_START_ARGS);
|
||||||
!sd.values().isEmpty()) {
|
!sd.isEmpty()) {
|
||||||
QTC_CHECK(sd.first().typeId() == QMetaType::QString);
|
QTC_CHECK(sd.first().typeId() == QMetaType::QString);
|
||||||
const QString startArgs = sd.first().toString();
|
const QString startArgs = sd.first().toString();
|
||||||
m_amStartExtraArgs = ProcessArgs::splitArgs(startArgs, OsTypeOtherUnix);
|
m_amStartExtraArgs = ProcessArgs::splitArgs(startArgs, OsTypeOtherUnix);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (const Store sd = runControl->settingsData(Constants::ANDROID_PRESTARTSHELLCMDLIST);
|
if (const Store sd = runControl->settingsData(Constants::ANDROID_PRESTARTSHELLCMDLIST);
|
||||||
!sd.values().isEmpty()) {
|
!sd.isEmpty()) {
|
||||||
QTC_CHECK(sd.first().typeId() == QMetaType::QString);
|
const QVariant &first = sd.first();
|
||||||
const QStringList commands = sd.first().toString().split('\n', Qt::SkipEmptyParts);
|
QTC_CHECK(first.typeId() == QMetaType::QStringList);
|
||||||
|
const QStringList commands = first.toStringList();
|
||||||
for (const QString &shellCmd : commands)
|
for (const QString &shellCmd : commands)
|
||||||
m_beforeStartAdbCommands.append(QString("shell %1").arg(shellCmd));
|
m_beforeStartAdbCommands.append(QString("shell %1").arg(shellCmd));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (const Store sd = runControl->settingsData(Constants::ANDROID_POSTFINISHSHELLCMDLIST);
|
if (const Store sd = runControl->settingsData(Constants::ANDROID_POSTFINISHSHELLCMDLIST);
|
||||||
!sd.values().isEmpty()) {
|
!sd.isEmpty()) {
|
||||||
QTC_CHECK(sd.first().typeId() == QMetaType::QString);
|
const QVariant &first = sd.first();
|
||||||
const QStringList commands = sd.first().toString().split('\n', Qt::SkipEmptyParts);
|
QTC_CHECK(first.typeId() == QMetaType::QStringList);
|
||||||
|
const QStringList commands = first.toStringList();
|
||||||
for (const QString &shellCmd : commands)
|
for (const QString &shellCmd : commands)
|
||||||
m_afterFinishAdbCommands.append(QString("shell %1").arg(shellCmd));
|
m_afterFinishAdbCommands.append(QString("shell %1").arg(shellCmd));
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user