Commit 54716acd authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Fix some clazy warning

parent 1c212cf0
Pipeline #78525 passed with stage
in 17 seconds
......@@ -61,7 +61,7 @@ private Q_SLOTS:
QCOMPARE(entry.data[0].latitude(), 7.6f);
QCOMPARE(entry.data[0].longitude(), 46.1f);
QCOMPARE(entry.data[0].identifiers().size(), 1);
QCOMPARE(entry.data[0].identifier(QLatin1String("uic")), QLatin1String("85xxxxx"));
QCOMPARE(entry.data[0].identifier(QStringLiteral("uic")), QLatin1String("85xxxxx"));
QCOMPARE(entry.data[0].timeZone().isValid(), false);
QCOMPARE(entry.attributions.size(), 1);
QCOMPARE(entry.attributions[0].name(), QLatin1String("KDE"));
......
......@@ -50,7 +50,7 @@ bool EfaBackend::queryLocation(const LocationRequest& request, LocationReply *re
}
QUrl url(m_endpoint);
url.setPath(url.path() + (m_stopfinderRequestCommand.isEmpty() ? QLatin1String("XML_STOPFINDER_REQUEST") : m_stopfinderRequestCommand));
url.setPath(url.path() + (m_stopfinderRequestCommand.isEmpty() ? QStringLiteral("XML_STOPFINDER_REQUEST") : m_stopfinderRequestCommand));
auto query = commonQuery();
query.addQueryItem(QStringLiteral("locationServerActive"), QStringLiteral("1"));
......@@ -101,7 +101,7 @@ bool EfaBackend::queryStopover(const StopoverRequest &request, StopoverReply *re
}
QUrl url(m_endpoint);
url.setPath(url.path() + (m_dmRequestCommand.isEmpty() ? QLatin1String("XML_DM_REQUEST") : m_dmRequestCommand));
url.setPath(url.path() + (m_dmRequestCommand.isEmpty() ? QStringLiteral("XML_DM_REQUEST") : m_dmRequestCommand));
QDateTime dt = request.dateTime();
if (timeZone().isValid()) {
......@@ -185,7 +185,7 @@ bool EfaBackend::queryJourney(const JourneyRequest &request, JourneyReply *reply
}
QUrl url(m_endpoint);
url.setPath(url.path() + (m_tripRequestCommand.isEmpty() ? QLatin1String("XML_TRIP_REQUEST2") : m_tripRequestCommand));
url.setPath(url.path() + (m_tripRequestCommand.isEmpty() ? QStringLiteral("XML_TRIP_REQUEST2") : m_tripRequestCommand));
const auto ctx = requestContextData(request).value<EfaRequestContext>();
auto query = commonQuery();
......
......@@ -198,8 +198,8 @@ std::vector<Stopover> EfaCompactParser::parseDmResponse(const QByteArray &data)
while (reader.readNextElement()) {
if (reader.name() == QLatin1String("pas")) {
const auto pas = parseKeyValueList(reader.subReader(), QLatin1String("pa"), QLatin1String("n"), QLatin1String("v"));
m_requestContext.sessionId = pas.value(QLatin1String("sessionID"));
m_requestContext.requestId = pas.value(QLatin1String("requestID"));
m_requestContext.sessionId = pas.value(QStringLiteral("sessionID"));
m_requestContext.requestId = pas.value(QStringLiteral("requestID"));
} else if (reader.name() == QLatin1String("dp")) {
res.push_back(parseCompactDp(reader.subReader()));
}
......@@ -414,8 +414,8 @@ std::vector<Journey> EfaCompactParser::parseTripResponse(const QByteArray &data)
while (reader.readNextElement()) {
if (reader.name() == QLatin1String("pas")) {
const auto pas = parseKeyValueList(reader.subReader(), QLatin1String("pa"), QLatin1String("n"), QLatin1String("v"));
m_requestContext.sessionId = pas.value(QLatin1String("sessionID"));
m_requestContext.requestId = pas.value(QLatin1String("requestID"));
m_requestContext.sessionId = pas.value(QStringLiteral("sessionID"));
m_requestContext.requestId = pas.value(QStringLiteral("requestID"));
} else if (reader.name() == QLatin1String("tp")) {
res.push_back(parseCompactTp(reader.subReader()));
}
......
......@@ -488,7 +488,7 @@ std::vector<EfaXmlParser::PathDescription> EfaXmlParser::parsePathDescriptionLis
desc.niveau = elemReader.readElementText().toInt();
} else if (elemReader.name() == QLatin1String("genAttrList")) {
const auto attrs = parseGenericAttributeList(elemReader.subReader());
const auto indoorType = attrs.value(QLatin1String("INDOOR_TYPE"));
const auto indoorType = attrs.value(QStringLiteral("INDOOR_TYPE"));
if (indoorType == QLatin1String("STAIRS")) {
desc.maneuver = PathSection::Stairs;
} else if (indoorType == QLatin1String("LIFT")) {
......
......@@ -20,7 +20,7 @@ using namespace KPublicTransport;
bool OebbBackend::queryVehicleLayout(const VehicleLayoutRequest &request, VehicleLayoutReply *reply, QNetworkAccessManager *nam) const
{
const auto ibnr = request.stopover().stopPoint().identifier(QLatin1String("ibnr"));
const auto ibnr = request.stopover().stopPoint().identifier(QStringLiteral("ibnr"));
if (ibnr.size() != 7) {
return false;
}
......
......@@ -16,7 +16,7 @@ class Line;
class LinePrivate;
class LineMetaData;
namespace LineUtil{
KPUBLICTRANSPORT_EXPORT void setMetaData(Line&, LineMetaData);
KPUBLICTRANSPORT_EXPORT void setMetaData(Line&, const LineMetaData&);
}
/** A public transport line. */
......@@ -110,7 +110,7 @@ public:
static Line fromJson(const QJsonObject &obj);
private:
friend void LineUtil::setMetaData(Line&, LineMetaData);
friend void LineUtil::setMetaData(Line&, const LineMetaData&);
void setMetaData(const LineMetaData &metaData);
};
......
......@@ -60,7 +60,7 @@ void LineUtil::applyMetaData(Line &line, const Location &loc, bool download)
}
}
void LineUtil::setMetaData(Line& line, LineMetaData metaData)
void LineUtil::setMetaData(Line& line, const LineMetaData &metaData)
{
line.setMetaData(metaData);
}
......@@ -22,7 +22,7 @@ namespace LineUtil
bool isSameLineNameFuzzy(const QString &lhs, const QString &rhs);
bool isCompatibleMode(Line::Mode lhs, Line::Mode rhs);
void applyMetaData(Line &line, const Location &loc, bool download);
KPUBLICTRANSPORT_EXPORT void setMetaData(Line &line, LineMetaData metaData);
KPUBLICTRANSPORT_EXPORT void setMetaData(Line &line, const LineMetaData &metaData);
}
}
......
......@@ -24,7 +24,7 @@ QString NotesUtil::normalizeNote(const QString &note)
const auto match = linkRegExp.match(n);
if (match.hasMatch()) {
n.replace(match.capturedStart(), match.capturedLength(), QLatin1String("<a href=\"")
+ (match.capturedRef().startsWith(QLatin1String("http")) ? QString() : QLatin1String("https://"))
+ (match.capturedRef().startsWith(QLatin1String("http")) ? QString() : QStringLiteral("https://"))
+ match.capturedRef().toString()
+ QLatin1String("\">") + match.capturedRef() + QLatin1String("</a>"));
}
......
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