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