Commit cecc46b9 authored by Kai Koehne's avatar Kai Koehne Committed by hjk

Replace QString::fromLocal8Bit("") calls

Calling fromLocal8Bit() for literals is wrong, since that depends
ont the user's environment. We use latin1 strings exclusively in Qt.

Change-Id: I0cd0986787ea630425773672d3a892fbd0f0a77a
Reviewed-by: default avatarhjk <hjk121@nokiamail.com>
parent 0d3314d9
...@@ -218,7 +218,7 @@ void SshChannelManager::removeChannel(ChannelIterator it) ...@@ -218,7 +218,7 @@ void SshChannelManager::removeChannel(ChannelIterator it)
const int removeCount = m_sessions.remove(it.value()); const int removeCount = m_sessions.remove(it.value());
if (removeCount != 1) { if (removeCount != 1) {
throw SshClientException(SshInternalError, throw SshClientException(SshInternalError,
QString::fromLocal8Bit("Internal error: Unexpected session count %1 for channel.") QString::fromLatin1("Internal error: Unexpected session count %1 for channel.")
.arg(removeCount)); .arg(removeCount));
} }
m_channels.erase(it); m_channels.erase(it);
......
...@@ -68,7 +68,7 @@ bool NameDemanglerPrivate::demangle(const QString &mangledName) ...@@ -68,7 +68,7 @@ bool NameDemanglerPrivate::demangle(const QString &mangledName)
if (m_parseState.m_pos != m_parseState.m_mangledName.size()) if (m_parseState.m_pos != m_parseState.m_mangledName.size())
throw ParseException(QLatin1String("Unconsumed input")); throw ParseException(QLatin1String("Unconsumed input"));
if (m_parseState.m_parseStack.count() != 1) { if (m_parseState.m_parseStack.count() != 1) {
throw ParseException(QString::fromLocal8Bit("There are %1 elements on the parse stack; " throw ParseException(QString::fromLatin1("There are %1 elements on the parse stack; "
"expected one.").arg(m_parseState.m_parseStack.count())); "expected one.").arg(m_parseState.m_parseStack.count()));
} }
...@@ -78,11 +78,11 @@ bool NameDemanglerPrivate::demangle(const QString &mangledName) ...@@ -78,11 +78,11 @@ bool NameDemanglerPrivate::demangle(const QString &mangledName)
m_demangledName = QLatin1String(m_parseState.stackTop()->toByteArray()); m_demangledName = QLatin1String(m_parseState.stackTop()->toByteArray());
success = true; success = true;
} catch (const ParseException &p) { } catch (const ParseException &p) {
m_errorString = QString::fromLocal8Bit("Parse error at index %1 of mangled name '%2': %3.") m_errorString = QString::fromLatin1("Parse error at index %1 of mangled name '%2': %3.")
.arg(m_parseState.m_pos).arg(mangledName, p.error); .arg(m_parseState.m_pos).arg(mangledName, p.error);
success = false; success = false;
} catch (const InternalDemanglerException &e) { } catch (const InternalDemanglerException &e) {
m_errorString = QString::fromLocal8Bit("Internal demangler error at function %1, file %2, " m_errorString = QString::fromLatin1("Internal demangler error at function %1, file %2, "
"line %3").arg(e.func, e.file).arg(e.line); "line %3").arg(e.func, e.file).arg(e.line);
success = false; success = false;
} }
......
...@@ -1180,7 +1180,7 @@ void OperatorNameNode::parse() ...@@ -1180,7 +1180,7 @@ void OperatorNameNode::parse()
} else if (id == "az") { } else if (id == "az") {
m_type = AlignofExprType; m_type = AlignofExprType;
} else { } else {
throw ParseException(QString::fromLocal8Bit("Invalid operator encoding '%1'") throw ParseException(QString::fromLatin1("Invalid operator encoding '%1'")
.arg(QString::fromLocal8Bit(id))); .arg(QString::fromLocal8Bit(id)));
} }
} }
...@@ -1912,7 +1912,7 @@ void TemplateParamNode::parse() ...@@ -1912,7 +1912,7 @@ void TemplateParamNode::parse()
} }
} }
if (!isConversionOperator) { if (!isConversionOperator) {
throw ParseException(QString::fromLocal8Bit("Invalid template parameter index %1") throw ParseException(QString::fromLatin1("Invalid template parameter index %1")
.arg(m_index)); .arg(m_index));
} }
} else { } else {
...@@ -2486,7 +2486,7 @@ void TypeNode::parse() ...@@ -2486,7 +2486,7 @@ void TypeNode::parse()
= DEMANGLER_CAST(TemplateParamNode, MY_CHILD_AT(0)); = DEMANGLER_CAST(TemplateParamNode, MY_CHILD_AT(0));
if (templateParamNode->childCount() == 0) { if (templateParamNode->childCount() == 0) {
if (templateParamNode->index() >= parseState()->templateParamCount()) { if (templateParamNode->index() >= parseState()->templateParamCount()) {
throw ParseException(QString::fromLocal8Bit("Invalid template parameter " throw ParseException(QString::fromLatin1("Invalid template parameter "
"index %1 in forwarding").arg(templateParamNode->index())); "index %1 in forwarding").arg(templateParamNode->index()));
} }
templateParamNode->addChild(parseState() templateParamNode->addChild(parseState()
......
...@@ -90,7 +90,7 @@ void QnxDebugSupport::startExecution() ...@@ -90,7 +90,7 @@ void QnxDebugSupport::startExecution()
setState(StartingRemoteProcess); setState(StartingRemoteProcess);
if (m_useQmlDebugger) if (m_useQmlDebugger)
m_engine->startParameters().processArgs += QString::fromLocal8Bit(" -qmljsdebugger=port:%1,block").arg(m_qmlPort); m_engine->startParameters().processArgs += QString::fromLatin1(" -qmljsdebugger=port:%1,block").arg(m_qmlPort);
QStringList arguments; QStringList arguments;
if (m_useCppDebugger) if (m_useCppDebugger)
......
...@@ -140,7 +140,7 @@ void RemoteLinuxAnalyzeSupport::startExecution() ...@@ -140,7 +140,7 @@ void RemoteLinuxAnalyzeSupport::startExecution()
connect(runner, SIGNAL(reportError(QString)), SLOT(handleAppRunnerError(QString))); connect(runner, SIGNAL(reportError(QString)), SLOT(handleAppRunnerError(QString)));
const QStringList args = arguments() const QStringList args = arguments()
<< QString::fromLocal8Bit("-qmljsdebugger=port:%1,block").arg(d->qmlPort); << QString::fromLatin1("-qmljsdebugger=port:%1,block").arg(d->qmlPort);
runner->setWorkingDirectory(workingDirectory()); runner->setWorkingDirectory(workingDirectory());
runner->setEnvironment(environment()); runner->setEnvironment(environment());
runner->start(device(), remoteFilePath(), args); runner->start(device(), remoteFilePath(), args);
......
...@@ -130,7 +130,7 @@ void RemoteLinuxCheckForFreeDiskSpaceService::doDeploy() ...@@ -130,7 +130,7 @@ void RemoteLinuxCheckForFreeDiskSpaceService::doDeploy()
d->processRunner = new QSsh::SshRemoteProcessRunner; d->processRunner = new QSsh::SshRemoteProcessRunner;
connect(d->processRunner, SIGNAL(processClosed(int)), SLOT(handleProcessFinished())); connect(d->processRunner, SIGNAL(processClosed(int)), SLOT(handleProcessFinished()));
connect(d->processRunner, SIGNAL(readyReadStandardError()), SLOT(handleStdErr())); connect(d->processRunner, SIGNAL(readyReadStandardError()), SLOT(handleStdErr()));
const QString command = QString::fromLocal8Bit("df -k %1 |tail -n 1 |sed 's/ */ /g' " const QString command = QString::fromLatin1("df -k %1 |tail -n 1 |sed 's/ */ /g' "
"|cut -d ' ' -f 4").arg(d->pathToCheck); "|cut -d ' ' -f 4").arg(d->pathToCheck);
d->processRunner->run(command.toUtf8(), deviceConfiguration()->sshParameters()); d->processRunner->run(command.toUtf8(), deviceConfiguration()->sshParameters());
} }
......
...@@ -248,7 +248,7 @@ void tst_PluginSpec::loadLibrary() ...@@ -248,7 +248,7 @@ void tst_PluginSpec::loadLibrary()
QVERIFY(spec->resolveDependencies(QList<PluginSpec *>())); QVERIFY(spec->resolveDependencies(QList<PluginSpec *>()));
QVERIFY2(spec->loadLibrary(), qPrintable(spec->errorString)); QVERIFY2(spec->loadLibrary(), qPrintable(spec->errorString));
QVERIFY(spec->plugin != 0); QVERIFY(spec->plugin != 0);
QVERIFY(QString::fromLocal8Bit(spec->plugin->metaObject()->className()) == QString::fromLocal8Bit("MyPlugin::MyPluginImpl")); QVERIFY(QLatin1String(spec->plugin->metaObject()->className()) == QLatin1String("MyPlugin::MyPluginImpl"));
QCOMPARE(spec->state, PluginSpec::Loaded); QCOMPARE(spec->state, PluginSpec::Loaded);
QVERIFY(!spec->hasError); QVERIFY(!spec->hasError);
QCOMPARE(spec->plugin->pluginSpec(), ps); QCOMPARE(spec->plugin->pluginSpec(), ps);
......
...@@ -284,7 +284,7 @@ void RemoteProcessTest::handleConnected() ...@@ -284,7 +284,7 @@ void RemoteProcessTest::handleConnected()
{ {
Q_ASSERT(m_state == TestingIoDevice); Q_ASSERT(m_state == TestingIoDevice);
m_catProcess = m_sshConnection->createRemoteProcess(QString::fromLocal8Bit("/bin/cat").toUtf8()); m_catProcess = m_sshConnection->createRemoteProcess(QString::fromLatin1("/bin/cat").toUtf8());
connect(m_catProcess.data(), SIGNAL(started()), SLOT(handleProcessStarted())); connect(m_catProcess.data(), SIGNAL(started()), SLOT(handleProcessStarted()));
connect(m_catProcess.data(), SIGNAL(closed(int)), SLOT(handleProcessClosed(int))); connect(m_catProcess.data(), SIGNAL(closed(int)), SLOT(handleProcessClosed(int)));
m_started = false; m_started = false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment