Commit 74334206 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Use QStringView

parent c910e31e
Pipeline #75906 failed with stage
in 24 minutes and 46 seconds
......@@ -70,7 +70,8 @@ QDateTime EventsListJob::parseDateTime(const QString &str) const
// Parse the absolute time
auto dt = QDateTime::fromString(str.left(19), QStringLiteral("yyyy-MM-ddTHH:mm:ss"));
// Parse the offset
const auto tz = str.rightRef(5);
const QStringView strView{str};
const auto tz = strView.right(5);
const int sec = (tz.left(1) == QLatin1String("+") ? 1 : -1) * tz.mid(1, 2).toInt() * 3600 + tz.right(2).toInt() * 60;
dt.setOffsetFromUtc(sec);
......
......@@ -714,7 +714,7 @@ Akonadi::Item::Flags Maildir::readEntryFlags(const QString &key) const
const QRegularExpression rx = statusSeparatorRx();
const int index = key.indexOf(rx);
if (index != -1) {
const QStringRef mailDirFlags = key.midRef(index + 3); // after "(:|!)2,"
const QStringView mailDirFlags = QStringView(key).mid(index + 3); // after "(:|!)2,"
const int flagSize(mailDirFlags.size());
for (int i = 0; i < flagSize; ++i) {
const QChar flag = mailDirFlags.at(i);
......
Supports Markdown
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