Use QLatin1String overload for QString::startsWith

GIT_SILENT
parent c3be46a2
......@@ -119,7 +119,7 @@ void KDevelopSessions::match(Plasma::RunnerContext &context)
bool listAll = false;
if (term.startsWith(QStringLiteral("kdevelop"), Qt::CaseInsensitive)) {
if (term.startsWith(QLatin1String("kdevelop"), Qt::CaseInsensitive)) {
if (term.trimmed().compare(QLatin1String("kdevelop"), Qt::CaseInsensitive) == 0) {
listAll = true;
term.clear();
......
......@@ -683,7 +683,7 @@ QualifiedIdentifier::QualifiedIdentifier(const QString& id, bool isExpression)
push(finishedId);
}
} else {
if (id.startsWith(QStringLiteral("::"))) {
if (id.startsWith(QLatin1String("::"))) {
dd->m_explicitlyGlobal = true;
dd->splitIdentifiers(id, 2);
} else {
......
......@@ -164,23 +164,23 @@ KDevelop::VcsEvent BazaarUtils::parseBzrLogPart(const QString& output)
KDevelop::VcsItemEvent::Action currentAction;
for (const QString &line : outputLines) {
if (!atMessage) {
if (line.startsWith(QStringLiteral("revno"))) {
if (line.startsWith(QLatin1String("revno"))) {
QString revno = line.mid(QStringLiteral("revno: ").length());
revno = revno.left(revno.indexOf(QLatin1Char(' ')));
KDevelop::VcsRevision revision;
revision.setRevisionValue(revno.toLongLong(), KDevelop::VcsRevision::GlobalNumber);
commitInfo.setRevision(revision);
} else if (line.startsWith(QStringLiteral("committer: "))) {
} else if (line.startsWith(QLatin1String("committer: "))) {
QString commiter = line.mid(QStringLiteral("committer: ").length());
commitInfo.setAuthor(commiter); // Author goes after committer, but only if is different
} else if (line.startsWith(QStringLiteral("author"))) {
} else if (line.startsWith(QLatin1String("author"))) {
QString author = line.mid(QStringLiteral("author: ").length());
commitInfo.setAuthor(author); // It may override committer (In fact committer is not supported by VcsEvent)
} else if (line.startsWith(QStringLiteral("timestamp"))) {
} else if (line.startsWith(QLatin1String("timestamp"))) {
const QString formatString = QStringLiteral("yyyy-MM-dd hh:mm:ss");
QString timestamp = line.mid(QStringLiteral("timestamp: ddd ").length(), formatString.length());
commitInfo.setDate(QDateTime::fromString(timestamp, formatString));
} else if (line.startsWith(QStringLiteral("message"))) {
} else if (line.startsWith(QLatin1String("message"))) {
atMessage = true;
}
} else if (atMessage && !afterMessage) {
......@@ -220,7 +220,7 @@ KDevelop::VcsItemEvent::Action BazaarUtils::parseActionDescription(const QString
return KDevelop::VcsItemEvent::Deleted;
} else if (action == QLatin1String("kind changed:")) {
return KDevelop::VcsItemEvent::Replaced; // Best approximation
} else if (action.startsWith(QStringLiteral("renamed"))) {
} else if (action.startsWith(QLatin1String("renamed"))) {
return KDevelop::VcsItemEvent::Modified; // Best approximation
} else {
qCritical("Unsupported action: %s", action.toLocal8Bit().constData());
......
......@@ -139,7 +139,7 @@ void BzrAnnotateJob::parseBzrLog(KDevelop::DVcsJob* job)
QString message;
for (const QString& line : outputLines) {
if (!atMessage) {
if (line.startsWith(QStringLiteral("revno"))) {
if (line.startsWith(QLatin1String("revno"))) {
QString revno = line.mid(QStringLiteral("revno: ").length());
// In future there is possibility that "revno: " will change to
// "revno??". If that's all, then we recover matching only
......@@ -153,17 +153,17 @@ void BzrAnnotateJob::parseBzrLog(KDevelop::DVcsJob* job)
KDevelop::VcsRevision revision;
revision.setRevisionValue(revno.toLongLong(), KDevelop::VcsRevision::GlobalNumber);
commitInfo.setRevision(revision);
} else if (line.startsWith(QStringLiteral("committer: "))) {
} else if (line.startsWith(QLatin1String("committer: "))) {
QString commiter = line.mid(QStringLiteral("committer: ").length());
commitInfo.setAuthor(commiter); // Author goes after committer, but only if is different
} else if (line.startsWith(QStringLiteral("author"))) {
} else if (line.startsWith(QLatin1String("author"))) {
QString author = line.mid(QStringLiteral("author: ").length());
commitInfo.setAuthor(author); // It may override committer (In fact committer is not supported by VcsEvent)
} else if (line.startsWith(QStringLiteral("timestamp"))) {
} else if (line.startsWith(QLatin1String("timestamp"))) {
const QString formatString = QStringLiteral("yyyy-MM-dd hh:mm:ss");
QString timestamp = line.mid(QStringLiteral("timestamp: ddd ").length(), formatString.length());
commitInfo.setDate(QDateTime::fromString(timestamp, formatString));
} else if (line.startsWith(QStringLiteral("message"))) {
} else if (line.startsWith(QLatin1String("message"))) {
atMessage = true;
}
} else {
......
......@@ -126,7 +126,7 @@ void ChecksWidget::setChecks(const QString& checks)
}
auto state = Qt::Checked;
if (checkName.startsWith(QStringLiteral("no-"))) {
if (checkName.startsWith(QLatin1String("no-"))) {
checkName.remove(0, 3);
state = Qt::Unchecked;
}
......
......@@ -145,18 +145,18 @@ public:
continue;
}
if (line.startsWith(QStringLiteral("```"))) {
if (line.startsWith(QLatin1String("```"))) {
setState((state == PREFORMATTED) ? EMPTY : PREFORMATTED);
continue;
}
if (line.startsWith(QStringLiteral(" "))) {
if (line.startsWith(QLatin1String(" "))) {
if (state == EMPTY) {
setState(PREFORMATTED);
}
} else if (
line.startsWith(QStringLiteral("- ")) ||
line.startsWith(QStringLiteral("* "))) {
line.startsWith(QLatin1String("- ")) ||
line.startsWith(QLatin1String("* "))) {
// force close and reopen list - this fixes cases when we don't have
// separator line between items
setState(EMPTY);
......
......@@ -665,7 +665,7 @@ void GitPlugin::parseGitBlameOutput(DVcsJob *job)
annotation->setDate(QDateTime::fromTime_t(value.toUInt()));
else if(name==QLatin1String("summary"))
annotation->setCommitMessage(value.toString());
else if(name.startsWith(QStringLiteral("committer"))) {} //We will just store the authors
else if(name.startsWith(QLatin1String("committer"))) {} //We will just store the authors
else if(name==QLatin1String("previous")) {} //We don't need that either
else if(name==QLatin1String("filename")) { skipNext=true; }
else if(name==QLatin1String("boundary")) {
......
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