Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Use QLatin1String overload for QString::contains

GIT_SILENT
parent fcb90dcd
......@@ -224,7 +224,7 @@ FilteredItem CompilerFilterStrategy::actionInLine(const QString& line)
// They are later searched by pathForFile to find source files corresponding to
// compiler errors.
// Note: CMake objectfile has the format: "/path/to/four/CMakeFiles/file.o"
if ( curActFilter.fileGroup != -1 && curActFilter.tool == QLatin1String("cmake") && line.contains(QStringLiteral("Building"))) {
if ( curActFilter.fileGroup != -1 && curActFilter.tool == QLatin1String("cmake") && line.contains(QLatin1String("Building"))) {
const auto objectFile = match.captured(curActFilter.fileGroup);
const auto dir = objectFile.section(QStringLiteral("CMakeFiles/"), 0, 0);
d->putDirAtEnd(Path(d->m_buildDir, dir));
......
......@@ -221,7 +221,7 @@ bool KDevelop::copyPath(const KDevelop::IProject* project, const KDevelop::Path&
Path KDevelop::proposedBuildFolder(const Path& sourceFolder)
{
Path proposedBuildFolder;
if (sourceFolder.path().contains(QStringLiteral("/src/"))) {
if (sourceFolder.path().contains(QLatin1String("/src/"))) {
const QString srcBuildPath = sourceFolder.path().replace(QStringLiteral("/src/"), QStringLiteral("/build/"));
Q_ASSERT(!srcBuildPath.isEmpty());
if (QDir(srcBuildPath).exists()) {
......
......@@ -107,7 +107,7 @@ ClangSettingsManager::ClangSettingsManager()
bool ParserSettings::isCpp() const
{
return parserOptions.contains(QStringLiteral("-std=c++")) || parserOptions.contains(QStringLiteral("-std=gnu++"));
return parserOptions.contains(QLatin1String("-std=c++")) || parserOptions.contains(QLatin1String("-std=gnu++"));
}
QVector<QByteArray> ParserSettings::toClangAPI() const
......
......@@ -227,7 +227,7 @@ KDevelop::ContextMenuExtension ExternalScriptPlugin::contextMenuExtension(KDevel
if (context->type() != KDevelop::Context::EditorContext) {
// filter scripts that depend on an opened document
// if the context menu was not requested inside the editor
if (item->performParameterReplacement() && item->command().contains(QStringLiteral("%s"))) {
if (item->performParameterReplacement() && item->command().contains(QLatin1String("%s"))) {
continue;
} else if (item->inputMode() == ExternalScriptItem::InputSelectionOrNone) {
continue;
......@@ -237,12 +237,12 @@ KDevelop::ContextMenuExtension ExternalScriptPlugin::contextMenuExtension(KDevel
if (folderCount == m_urls.count()) {
// when only folders filter items that don't have %d parameter (or another parameter)
if (item->performParameterReplacement() &&
(!item->command().contains(QStringLiteral("%d")) ||
item->command().contains(QStringLiteral("%s")) ||
item->command().contains(QStringLiteral("%u")) ||
item->command().contains(QStringLiteral("%f")) ||
item->command().contains(QStringLiteral("%b")) ||
item->command().contains(QStringLiteral("%n"))
(!item->command().contains(QLatin1String("%d")) ||
item->command().contains(QLatin1String("%s")) ||
item->command().contains(QLatin1String("%u")) ||
item->command().contains(QLatin1String("%f")) ||
item->command().contains(QLatin1String("%b")) ||
item->command().contains(QLatin1String("%n"))
)
) {
continue;
......
......@@ -170,7 +170,7 @@ void Resource::slotAuthenticate(KJob *job)
const auto metaData = qobject_cast<KIO::StoredTransferJob*>(job)->metaData();
if (metaData[QStringLiteral("responsecode")] == QLatin1String("401")) {
const auto& header = metaData[QStringLiteral("HTTP-Headers")];
if (header.contains(QStringLiteral("X-GitHub-OTP: required;"), Qt::CaseInsensitive)) {
if (header.contains(QLatin1String("X-GitHub-OTP: required;"), Qt::CaseInsensitive)) {
emit twoFactorAuthRequested(qobject_cast<KIO::StoredTransferJob*>(job)->outgoingMetaData()[QStringLiteral("customHTTPHeader")]);
return;
}
......
......@@ -801,11 +801,11 @@ void GitPlugin::parseGitBranchOutput(DVcsJob* job)
for (const auto& branch : branchListDirty) {
// Skip pointers to another branches (one example of this is "origin/HEAD -> origin/master");
// "git rev-list" chokes on these entries and we do not need duplicate branches altogether.
if (branch.contains(QStringLiteral("->")))
if (branch.contains(QLatin1String("->")))
continue;
// Skip entries such as '(no branch)'
if (branch.contains(QStringLiteral("(no branch)")))
if (branch.contains(QLatin1String("(no branch)")))
continue;
QStringRef name = branch;
......@@ -886,7 +886,7 @@ QVector<DVcsEvent> GitPlugin::allCommits(const QString& repo)
item.setParents(parents);
//Avoid Merge string
while (!commits[i].contains(QStringLiteral("Author: ")))
while (!commits[i].contains(QLatin1String("Author: ")))
++i;
item.setAuthor(commits[i].section(QStringLiteral("Author: "), 1).trimmed());
......
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