Commit 551f7e1c authored by Alessandro Portale's avatar Alessandro Portale Committed by hjk

QString(QLatin1String()) -> QString::fromLatin1()

Change-Id: I93bdd926ca1c7a37a298335711069d985f1f91dd
Reviewed-by: default avatarhjk <hjk121@nokiamail.com>
parent 6c244fb0
......@@ -273,5 +273,5 @@ void NamePrettyPrinter::visit(const SelectorNameId *name)
void NamePrettyPrinter::visit(const AnonymousNameId *name)
{
_name = QString(QLatin1String("Anonymous:%1")).arg(name->classTokenIndex());
_name = QString::fromLatin1("Anonymous:%1").arg(name->classTokenIndex());
}
......@@ -94,7 +94,7 @@ void QmlToolsClient::messageReceived(const QByteArray &message)
emit destroyedObject(objectDebugId);
}
log(LogReceive, type, QString(QLatin1String("requestId: %1 success: %2"))
log(LogReceive, type, QString::fromLatin1("requestId: %1 success: %2")
.arg(QString::number(requestId)).arg(QString::number(success)));
} else if (type == QByteArray(EVENT)) {
QByteArray event;
......
......@@ -307,13 +307,13 @@ QStringList ConsoleProcess::fixWinEnvironment(const QStringList &env)
if (envStrings.filter(QRegExp(QLatin1String("^PATH="),Qt::CaseInsensitive)).isEmpty()) {
QByteArray path = qgetenv("PATH");
if (!path.isEmpty())
envStrings.prepend(QString(QLatin1String("PATH=%1")).arg(QString::fromLocal8Bit(path)));
envStrings.prepend(QString::fromLatin1("PATH=%1").arg(QString::fromLocal8Bit(path)));
}
// add systemroot if needed
if (envStrings.filter(QRegExp(QLatin1String("^SystemRoot="),Qt::CaseInsensitive)).isEmpty()) {
QByteArray systemRoot = qgetenv("SystemRoot");
if (!systemRoot.isEmpty())
envStrings.prepend(QString(QLatin1String("SystemRoot=%1")).arg(QString::fromLocal8Bit(systemRoot)));
envStrings.prepend(QString::fromLatin1("SystemRoot=%1").arg(QString::fromLocal8Bit(systemRoot)));
}
return envStrings;
}
......
......@@ -122,7 +122,7 @@ QString HtmlDocExtractor::getFunctionDescription(const QString &html,
// So I try to find the link to this property in the list of properties, extract its
// anchor and then follow by the name found.
const QString &pattern =
QString(QLatin1String("<a href=\"[a-z\\.]+#([A-Za-z]+)-prop\">%1</a>")).arg(cleanMark);
QString::fromLatin1("<a href=\"[a-z\\.]+#([A-Za-z]+)-prop\">%1</a>").arg(cleanMark);
QRegExp exp = createMinimalExp(pattern);
if (exp.indexIn(html) != -1) {
const QString &prop = exp.cap(1);
......
......@@ -76,7 +76,7 @@ void Android::Internal::AndroidSignalOperation::adbFindRunAsFinished(int exitCod
<< QLatin1String("run-as")
<< runAs
<< QLatin1String("kill")
<< QString(QLatin1String("-%1")).arg(m_signal)
<< QString::fromLatin1("-%1").arg(m_signal)
<< QString::number(m_pid));
}
}
......@@ -127,7 +127,7 @@ void Android::Internal::AndroidSignalOperation::signalOperationViaADB(int pid, i
m_adbProcess->start(m_adbPath, QStringList()
<< QLatin1String("shell")
<< QLatin1String("cat")
<< QString(QLatin1String("/proc/%1/cmdline")).arg(m_pid));
<< QString::fromLatin1("/proc/%1/cmdline").arg(m_pid));
}
void Android::Internal::AndroidSignalOperation::killProcess(int pid)
......
......@@ -274,7 +274,7 @@ int MagicRule::endPos() const
QString MagicRule::toOffset(const QPair<int, int> &startEnd)
{
return QString(QLatin1String("%1:%2")).arg(startEnd.first).arg(startEnd.second);
return QString::fromLatin1("%1:%2").arg(startEnd.first).arg(startEnd.second);
}
QPair<int, int> MagicRule::fromOffset(const QString &offset)
......@@ -386,7 +386,7 @@ QString MagicByteRule::matchValue() const
{
QString value;
foreach (int byte, m_bytes)
value.append(QString(QLatin1String("\\0x%1")).arg(byte, 0, 16));
value.append(QString::fromLatin1("\\0x%1").arg(byte, 0, 16));
return value;
}
......
......@@ -65,7 +65,7 @@ static QList<QStandardItem *> hostEntry(const QString &host,
QStandardItem *projectCountItem = 0;
QString countItemText;
if (!isDummyEntry)
countItemText = projectCount ? QString::number(projectCount) : QString(QLatin1String("..."));
countItemText = projectCount ? QString::number(projectCount) : QString::fromLatin1("...");
projectCountItem = new QStandardItem(countItemText);
projectCountItem->setFlags(nonEditableFlags);
QStandardItem *descriptionItem = new QStandardItem(description);
......
......@@ -109,7 +109,7 @@ QUrl SrcDestDialog::getRepoUrl() const
m_workingdir = fileLoc;
if (!projectLoc.isEmpty() && fileLoc.startsWith(projectLoc + QLatin1Char('/')))
m_workingdir = projectLoc;
QSettings settings(QString(QLatin1String("%1/.hg/hgrc")).arg(m_workingdir), QSettings::IniFormat);
QSettings settings(QString::fromLatin1("%1/.hg/hgrc").arg(m_workingdir), QSettings::IniFormat);
QUrl url;
if (m_direction == outgoing)
url = settings.value(QLatin1String("paths/default-push")).toUrl();
......
......@@ -447,13 +447,13 @@ void ProjectExplorerPlugin::testGccOutputParsers_data()
QTest::newRow("rm false positive")
<< QString::fromLatin1("rm: cannot remove `release/moc_mainwindow.cpp': No such file or directory")
<< OutputParserTester::STDERR
<< QString() << QString(QLatin1String("rm: cannot remove `release/moc_mainwindow.cpp': No such file or directory\n"))
<< QString() << QString::fromLatin1("rm: cannot remove `release/moc_mainwindow.cpp': No such file or directory\n")
<< QList<ProjectExplorer::Task>()
<< QString();
QTest::newRow("ranlib false positive")
<< QString::fromLatin1("ranlib: file: libSupport.a(HashTable.o) has no symbols")
<< OutputParserTester::STDERR
<< QString() << QString(QLatin1String("ranlib: file: libSupport.a(HashTable.o) has no symbols\n"))
<< QString() << QString::fromLatin1("ranlib: file: libSupport.a(HashTable.o) has no symbols\n")
<< QList<ProjectExplorer::Task>()
<< QString();
QTest::newRow("ld: missing library")
......
......@@ -87,7 +87,7 @@ static QStringList pluginDependencies(const PluginBaseClasses *plb)
const QChar blank = QLatin1Char(' ');
// Find the module names and convert to ids
QStringList pluginModules= plb->dependentModules ?
QString(QLatin1String(plb->dependentModules)).split(blank) :
QString::fromLatin1(plb->dependentModules).split(blank) :
QStringList();
pluginModules.push_back(QLatin1String(plb->module));
foreach (const QString &module, pluginModules) {
......
......@@ -141,7 +141,7 @@ ConsoleItem *constructLogItemTree(ConsoleItem *parent, const QVariant &result,
if (key.isEmpty())
item->setText(QLatin1String("List"));
else
item->setText(QString(QLatin1String("[%1] : List")).arg(key));
item->setText(QString::fromLatin1("[%1] : List").arg(key));
QVariantList resultList = result.toList();
for (int i = 0; i < resultList.count(); i++) {
ConsoleItem *child = constructLogItemTree(item, resultList.at(i),
......
......@@ -244,7 +244,7 @@ void QmlConsoleView::copyToClipboard(const QModelIndex &index)
if (fileUrl.isLocalFile())
filePath = fileUrl.toLocalFile();
if (!filePath.isEmpty()) {
contents = QString(QLatin1String("%1 %2: %3")).arg(contents).arg(filePath).arg(
contents = QString::fromLatin1("%1 %2: %3").arg(contents).arg(filePath).arg(
model()->data(index, QmlConsoleItemModel::LineRole).toString());
}
QClipboard *cb = QApplication::clipboard();
......
......@@ -118,9 +118,9 @@ void BaseHoverHandler::appendToolTip(const QString &extension)
void BaseHoverHandler::addF1ToToolTip()
{
m_toolTip = QString(QLatin1String("<table><tr><td valign=middle>%1</td><td>&nbsp;&nbsp;"
"<img src=\":/texteditor/images/f1.png\"></td>"
"</tr></table>")).arg(m_toolTip);
m_toolTip = QString::fromLatin1("<table><tr><td valign=middle>%1</td><td>&nbsp;&nbsp;"
"<img src=\":/texteditor/images/f1.png\"></td>"
"</tr></table>").arg(m_toolTip);
}
void BaseHoverHandler::setIsDiagnosticTooltip(bool isDiagnosticTooltip)
......
......@@ -306,7 +306,7 @@ void StateListener::slotStateChanged()
Core::EditorManager::setWindowTitleVcsTopic(QString());
}
if (debug)
qDebug() << state << (vc ? vc->displayName() : QString(QLatin1String("No version control")));
qDebug() << state << (vc ? vc->displayName() : QLatin1String("No version control"));
emit stateChanged(state, vc);
}
......
......@@ -171,11 +171,11 @@ void tst_Lookup::document_functionAt_1()
QVERIFY(doc->diagnosticMessages().isEmpty());
QCOMPARE(doc->functionAt(1, 2), QString());
QCOMPARE(doc->functionAt(1, 11), QString(QLatin1String("Foo::Bar")));
QCOMPARE(doc->functionAt(2, 2), QString(QLatin1String("Foo::Bar")));
QCOMPARE(doc->functionAt(3, 10), QString(QLatin1String("Foo::Bar")));
QCOMPARE(doc->functionAt(4, 3), QString(QLatin1String("Foo::Bar")));
QCOMPARE(doc->functionAt(6, 1), QString(QLatin1String("Foo::Bar")));
QCOMPARE(doc->functionAt(1, 11), QString::fromLatin1("Foo::Bar"));
QCOMPARE(doc->functionAt(2, 2), QString::fromLatin1("Foo::Bar"));
QCOMPARE(doc->functionAt(3, 10), QString::fromLatin1("Foo::Bar"));
QCOMPARE(doc->functionAt(4, 3), QString::fromLatin1("Foo::Bar"));
QCOMPARE(doc->functionAt(6, 1), QString::fromLatin1("Foo::Bar"));
}
void tst_Lookup::simple_class_1()
......
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