Use QLatin1String overload for QString::operator ==/!=

GIT_SILENT
parent fe0c4346
......@@ -75,7 +75,7 @@ void AreaDisplay::newArea(Sublime::Area* area)
auto* m = new QMenu(m_button);
m->addActions(area->actions());
if(currentArea->objectName() != QStringLiteral("code")) {
if (currentArea->objectName() != QLatin1String("code")) {
if(!m->actions().isEmpty())
m->addSeparator();
m->addAction(QIcon::fromTheme(QStringLiteral("document-edit")), i18n("Back to code"), this, SLOT(backToCode()), QKeySequence(Qt::AltModifier | Qt::Key_Backspace));
......
......@@ -996,7 +996,7 @@ QString DocumentController::activeDocumentPath( const QString& target ) const
}
}
IDocument* doc = activeDocument();
if(!doc || target == QStringLiteral("[selection]"))
if(!doc || target == QLatin1String("[selection]"))
{
Context* selection = ICore::self()->selectionController()->currentSelection();
if(selection && selection->type() == Context::ProjectItemContext && !static_cast<ProjectItemContext*>(selection)->items().isEmpty())
......
......@@ -91,7 +91,7 @@ void sanitizeArguments(QVector<QByteArray>& arguments)
QVector<QByteArray> argsForSession(const QString& path, ParseSessionData::Options options, const ParserSettings& parserSettings)
{
QMimeDatabase db;
if(db.mimeTypeForFile(path).name() == QStringLiteral("text/x-objcsrc")) {
if (db.mimeTypeForFile(path).name() == QLatin1String("text/x-objcsrc")) {
return {QByteArrayLiteral("-xobjective-c++")};
}
......
......@@ -121,7 +121,7 @@ void ChecksWidget::setChecks(const QString& checks)
const QStringList checksList = checks.split(QLatin1Char(','), QString::SkipEmptyParts);
for (auto checkName : checksList) {
checkName = checkName.trimmed();
if (checkName == QStringLiteral("manual")) {
if (checkName == QLatin1String("manual")) {
continue;
}
......@@ -184,7 +184,7 @@ void ChecksWidget::updateChecks()
auto levelItem = m_ui->checksTree->topLevelItem(i);
auto levelName = levelItem->data(0, CheckRole).toString();
if (levelName == QStringLiteral("manual")) {
if (levelName == QLatin1String("manual")) {
// Manual level is "fake level" so we clear the name and will store only
// selected checks.
levelItems.clear();
......
......@@ -242,7 +242,7 @@ QStringList Parameters::commandLine(QString& infoMessage) const
}
if (m_project && m_project->managerPlugin()) {
if (m_project->managerPlugin()->componentName() == QStringLiteral("kdevcmakemanager")) {
if (m_project->managerPlugin()->componentName() == QLatin1String("kdevcmakemanager")) {
result << QStringLiteral("-i")
<< m_projectBuildPath.toLocalFile() + QStringLiteral("/CMakeFiles");
}
......
......@@ -421,8 +421,8 @@ LanguageType languageType(const QString& path, bool treatAmbiguousAsCPP)
{
QMimeDatabase db;
const auto mimeType = db.mimeTypeForFile(path).name();
if (mimeType == QStringLiteral("text/x-csrc") ||
mimeType == QStringLiteral("text/x-chdr") ) {
if (mimeType == QLatin1String("text/x-csrc") ||
mimeType == QLatin1String("text/x-chdr") ) {
if (treatAmbiguousAsCPP) {
if (path.endsWith(QLatin1String(".h"), Qt::CaseInsensitive)) {
return Cpp;
......@@ -444,20 +444,20 @@ LanguageType languageType(const QString& path, bool treatAmbiguousAsCPP)
return C;
}
if (mimeType == QStringLiteral("text/x-c++src") ||
mimeType == QStringLiteral("text/x-c++hdr") ) {
if (mimeType == QLatin1String("text/x-c++src") ||
mimeType == QLatin1String("text/x-c++hdr") ) {
return Cpp;
}
if (mimeType == QStringLiteral("text/x-objc++src")) {
if (mimeType == QLatin1String("text/x-objc++src")) {
return ObjCpp;
}
if (mimeType == QStringLiteral("text/x-objcsrc")) {
if (mimeType == QLatin1String("text/x-objcsrc")) {
return ObjC;
}
if (mimeType == QStringLiteral("text/x-opencl-src")) {
if (mimeType == QLatin1String("text/x-opencl-src")) {
return OpenCl;
}
......
......@@ -168,7 +168,7 @@ void Resource::slotAuthenticate(KJob *job)
}
const auto metaData = qobject_cast<KIO::StoredTransferJob*>(job)->metaData();
if (metaData[QStringLiteral("responsecode")] == QStringLiteral("401")) {
if (metaData[QStringLiteral("responsecode")] == QLatin1String("401")) {
const auto& header = metaData[QStringLiteral("HTTP-Headers")];
if (header.contains(QStringLiteral("X-GitHub-OTP: required;"), Qt::CaseInsensitive)) {
emit twoFactorAuthRequested(qobject_cast<KIO::StoredTransferJob*>(job)->outgoingMetaData()[QStringLiteral("customHTTPHeader")]);
......
......@@ -41,7 +41,7 @@ HelpNetworkReply::HelpNetworkReply(const QNetworkRequest &request, const QByteAr
}
// Fix broken CSS images (tested on Qt 5.5.1 and 5.7.0)
if (request.url().fileName() == QStringLiteral("offline.css")) {
if (request.url().fileName() == QLatin1String("offline.css")) {
data.replace("../images", "images");
}
......
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