forked from qt-creator/qt-creator
Use Qt 5's QStringList::join(QChar)
Less typing and less cycles than join(QString) where appropriate Change-Id: I6ebc0e17e4d7fd9845864dd95b7de4ba4dad6906 Reviewed-by: Eike Ziller <eike.ziller@digia.com>
This commit is contained in:
@@ -539,7 +539,7 @@ AndroidConfig::CreateAvdInfo AndroidConfig::createAVDImpl(CreateAvdInfo info, Ut
|
||||
proc.start(androidToolPath.toString(), arguments);
|
||||
if (!proc.waitForStarted()) {
|
||||
info.error = QApplication::translate("AndroidConfig", "Could not start process \"%1 %2\"")
|
||||
.arg(androidToolPath.toString(), arguments.join(QLatin1String(" ")));
|
||||
.arg(androidToolPath.toString(), arguments.join(QLatin1Char(' ')));
|
||||
return info;
|
||||
}
|
||||
|
||||
|
||||
@@ -328,18 +328,18 @@ void AndroidDeployQtStep::run(QFutureInterface<bool> &fi)
|
||||
void AndroidDeployQtStep::runCommand(const QString &program, const QStringList &arguments)
|
||||
{
|
||||
QProcess buildProc;
|
||||
emit addOutput(tr("Package deploy: Running command \"%1 %2\".").arg(program).arg(arguments.join(QLatin1String(" "))), BuildStep::MessageOutput);
|
||||
emit addOutput(tr("Package deploy: Running command \"%1 %2\".").arg(program).arg(arguments.join(QLatin1Char(' '))), BuildStep::MessageOutput);
|
||||
buildProc.start(program, arguments);
|
||||
if (!buildProc.waitForStarted()) {
|
||||
emit addOutput(tr("Packaging error: Could not start command \"%1 %2\". Reason: %3")
|
||||
.arg(program).arg(arguments.join(QLatin1String(" "))).arg(buildProc.errorString()), BuildStep::ErrorMessageOutput);
|
||||
.arg(program).arg(arguments.join(QLatin1Char(' '))).arg(buildProc.errorString()), BuildStep::ErrorMessageOutput);
|
||||
return;
|
||||
}
|
||||
if (!buildProc.waitForFinished(2 * 60 * 1000)
|
||||
|| buildProc.error() != QProcess::UnknownError
|
||||
|| buildProc.exitCode() != 0) {
|
||||
QString mainMessage = tr("Packaging Error: Command \"%1 %2\" failed.")
|
||||
.arg(program).arg(arguments.join(QLatin1String(" ")));
|
||||
.arg(program).arg(arguments.join(QLatin1Char(' ')));
|
||||
if (buildProc.error() != QProcess::UnknownError)
|
||||
mainMessage += QLatin1Char(' ') + tr("Reason: %1").arg(buildProc.errorString());
|
||||
else
|
||||
|
||||
@@ -183,7 +183,7 @@ public:
|
||||
QString lineText;
|
||||
if (node->incompatibleReason().isEmpty()) {
|
||||
lineText = AndroidManager::androidNameForApiLevel(device.sdk) + QLatin1String(" ");
|
||||
lineText += AndroidDeviceDialog::tr("ABI:") + device.cpuAbi.join(QLatin1String(" "));
|
||||
lineText += AndroidDeviceDialog::tr("ABI:") + device.cpuAbi.join(QLatin1Char(' '));
|
||||
} else {
|
||||
lineText = node->incompatibleReason();
|
||||
}
|
||||
@@ -342,7 +342,7 @@ void AndroidDeviceModel::setDevices(const QVector<AndroidDeviceInfo> &devices)
|
||||
.arg(device.serialNumber);
|
||||
} else if (!device.cpuAbi.contains(m_abi)) {
|
||||
error = AndroidDeviceDialog::tr("ABI is incompatible, device supports ABIs: %1.")
|
||||
.arg(device.cpuAbi.join(QLatin1String(" ")));
|
||||
.arg(device.cpuAbi.join(QLatin1Char(' ')));
|
||||
} else if (device.sdk < m_apiLevel) {
|
||||
error = AndroidDeviceDialog::tr("API Level of device is: %1.")
|
||||
.arg(device.sdk);
|
||||
|
||||
@@ -416,7 +416,7 @@ static QString loadLocal(ProjectExplorer::Target *target, int apiLevel, ItemType
|
||||
|
||||
// The next loop requires all library names to end with a ":" so we append one
|
||||
// to the end after joining.
|
||||
localLibs = dependencyLibs.join(QLatin1String(":")) + QLatin1Char(':');
|
||||
localLibs = dependencyLibs.join(QLatin1Char(':')) + QLatin1Char(':');
|
||||
foreach (QString replacedLib, replacedLibs)
|
||||
localLibs.remove(replacedLib + QLatin1Char(':'));
|
||||
|
||||
@@ -486,7 +486,7 @@ void AndroidManager::cleanLibsOnDevice(ProjectExplorer::Target *target)
|
||||
arguments << QLatin1String("shell") << QLatin1String("rm") << QLatin1String("-r") << QLatin1String("/data/local/tmp/qt");
|
||||
process->connect(process, SIGNAL(finished(int)), process, SLOT(deleteLater()));
|
||||
const QString adb = AndroidConfigurations::currentConfig().adbToolPath().toString();
|
||||
Core::MessageManager::write(adb + QLatin1Char(' ') + arguments.join(QLatin1String(" ")));
|
||||
Core::MessageManager::write(adb + QLatin1Char(' ') + arguments.join(QLatin1Char(' ')));
|
||||
process->start(adb, arguments);
|
||||
if (!process->waitForStarted(500))
|
||||
delete process;
|
||||
@@ -516,7 +516,7 @@ void AndroidManager::installQASIPackage(ProjectExplorer::Target *target, const Q
|
||||
|
||||
process->connect(process, SIGNAL(finished(int)), process, SLOT(deleteLater()));
|
||||
const QString adb = AndroidConfigurations::currentConfig().adbToolPath().toString();
|
||||
Core::MessageManager::write(adb + QLatin1Char(' ') + arguments.join(QLatin1String(" ")));
|
||||
Core::MessageManager::write(adb + QLatin1Char(' ') + arguments.join(QLatin1Char(' ')));
|
||||
process->start(adb, arguments);
|
||||
if (!process->waitForFinished(500))
|
||||
delete process;
|
||||
|
||||
Reference in New Issue
Block a user