forked from qt-creator/qt-creator
Android: Avoid one use of ProcessArgs::splitArgs()
Replaced by the more harmless joinArgs in a compatibility settings code path for now. Change-Id: Id6d94faea26002f4a2641b5824d97e09a783b720 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
@@ -292,14 +292,14 @@ bool AndroidAvdManager::startAvdAsync(const QString &avdName) const
|
|||||||
});
|
});
|
||||||
|
|
||||||
// start the emulator
|
// start the emulator
|
||||||
QStringList arguments;
|
CommandLine cmd(m_config.emulatorToolPath());
|
||||||
if (AndroidConfigurations::force32bitEmulator())
|
if (AndroidConfigurations::force32bitEmulator())
|
||||||
arguments << "-force-32bit";
|
cmd.addArg("-force-32bit");
|
||||||
|
|
||||||
arguments << m_config.emulatorArgs() << "-avd" << avdName;
|
cmd.addArgs(m_config.emulatorArgs(), CommandLine::Raw);
|
||||||
qCDebug(avdManagerLog) << "Running command (startAvdAsync):"
|
cmd.addArgs({"-avd", avdName});
|
||||||
<< CommandLine(m_config.emulatorToolPath(), arguments).toUserOutput();
|
qCDebug(avdManagerLog) << "Running command (startAvdAsync):" << cmd.toUserOutput();
|
||||||
avdProcess->setCommand({m_config.emulatorToolPath(), arguments});
|
avdProcess->setCommand(cmd);
|
||||||
avdProcess->start();
|
avdProcess->start();
|
||||||
return avdProcess->waitForStarted(-1);
|
return avdProcess->waitForStarted(-1);
|
||||||
}
|
}
|
||||||
|
@@ -229,8 +229,10 @@ QLatin1String AndroidConfig::displayName(const Abi &abi)
|
|||||||
void AndroidConfig::load(const QSettings &settings)
|
void AndroidConfig::load(const QSettings &settings)
|
||||||
{
|
{
|
||||||
// user settings
|
// user settings
|
||||||
m_emulatorArgs = settings.value(EmulatorArgsKey,
|
QVariant emulatorArgs = settings.value(EmulatorArgsKey, QString("-netdelay none -netspeed full"));
|
||||||
QStringList({"-netdelay", "none", "-netspeed", "full"})).toStringList();
|
if (emulatorArgs.type() == QVariant::StringList) // Changed in 8.0 from QStringList to QString.
|
||||||
|
emulatorArgs = ProcessArgs::joinArgs(emulatorArgs.toStringList());
|
||||||
|
m_emulatorArgs = emulatorArgs.toString();
|
||||||
m_sdkLocation = FilePath::fromUserInput(settings.value(SDKLocationKey).toString()).cleanPath();
|
m_sdkLocation = FilePath::fromUserInput(settings.value(SDKLocationKey).toString()).cleanPath();
|
||||||
m_customNdkList = settings.value(CustomNdkLocationsKey).toStringList();
|
m_customNdkList = settings.value(CustomNdkLocationsKey).toStringList();
|
||||||
m_defaultNdk =
|
m_defaultNdk =
|
||||||
@@ -1106,12 +1108,12 @@ QString AndroidConfig::toolchainHostFromNdk(const FilePath &ndkPath)
|
|||||||
return toolchainHost;
|
return toolchainHost;
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringList AndroidConfig::emulatorArgs() const
|
QString AndroidConfig::emulatorArgs() const
|
||||||
{
|
{
|
||||||
return m_emulatorArgs;
|
return m_emulatorArgs;
|
||||||
}
|
}
|
||||||
|
|
||||||
void AndroidConfig::setEmulatorArgs(const QStringList &args)
|
void AndroidConfig::setEmulatorArgs(const QString &args)
|
||||||
{
|
{
|
||||||
m_emulatorArgs = args;
|
m_emulatorArgs = args;
|
||||||
}
|
}
|
||||||
|
@@ -123,8 +123,8 @@ public:
|
|||||||
QString toolchainHost(const QtSupport::QtVersion *qtVersion) const;
|
QString toolchainHost(const QtSupport::QtVersion *qtVersion) const;
|
||||||
static QString toolchainHostFromNdk(const Utils::FilePath &ndkPath);
|
static QString toolchainHostFromNdk(const Utils::FilePath &ndkPath);
|
||||||
|
|
||||||
QStringList emulatorArgs() const;
|
QString emulatorArgs() const;
|
||||||
void setEmulatorArgs(const QStringList &args);
|
void setEmulatorArgs(const QString &args);
|
||||||
|
|
||||||
bool automaticKitCreation() const;
|
bool automaticKitCreation() const;
|
||||||
void setAutomaticKitCreation(bool b);
|
void setAutomaticKitCreation(bool b);
|
||||||
@@ -196,7 +196,7 @@ private:
|
|||||||
Utils::FilePath m_openJDKLocation;
|
Utils::FilePath m_openJDKLocation;
|
||||||
Utils::FilePath m_keystoreLocation;
|
Utils::FilePath m_keystoreLocation;
|
||||||
Utils::FilePath m_openSslLocation;
|
Utils::FilePath m_openSslLocation;
|
||||||
QStringList m_emulatorArgs;
|
QString m_emulatorArgs;
|
||||||
bool m_automaticKitCreation = true;
|
bool m_automaticKitCreation = true;
|
||||||
QUrl m_sdkToolsUrl;
|
QUrl m_sdkToolsUrl;
|
||||||
QByteArray m_sdkToolsSha256;
|
QByteArray m_sdkToolsSha256;
|
||||||
|
@@ -603,7 +603,7 @@ void AndroidDeviceManager::setEmulatorArguments(QWidget *parent)
|
|||||||
dialog.setLabelText(AndroidDevice::tr("Emulator command-line startup options "
|
dialog.setLabelText(AndroidDevice::tr("Emulator command-line startup options "
|
||||||
"(<a href=\"%1\">Help Web Page</a>):")
|
"(<a href=\"%1\">Help Web Page</a>):")
|
||||||
.arg(helpUrl));
|
.arg(helpUrl));
|
||||||
dialog.setTextValue(m_androidConfig.emulatorArgs().join(' '));
|
dialog.setTextValue(m_androidConfig.emulatorArgs());
|
||||||
|
|
||||||
if (auto label = dialog.findChild<QLabel*>()) {
|
if (auto label = dialog.findChild<QLabel*>()) {
|
||||||
label->setOpenExternalLinks(true);
|
label->setOpenExternalLinks(true);
|
||||||
@@ -613,7 +613,7 @@ void AndroidDeviceManager::setEmulatorArguments(QWidget *parent)
|
|||||||
if (dialog.exec() != QDialog::Accepted)
|
if (dialog.exec() != QDialog::Accepted)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
m_androidConfig.setEmulatorArgs(ProcessArgs::splitArgs(dialog.textValue()));
|
m_androidConfig.setEmulatorArgs(dialog.textValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
QString AndroidDeviceManager::getRunningAvdsSerialNumber(const QString &name) const
|
QString AndroidDeviceManager::getRunningAvdsSerialNumber(const QString &name) const
|
||||||
|
Reference in New Issue
Block a user