summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergio Martins <[email protected]>2015-10-15 17:36:43 +0100
committerSergio Martins <[email protected]>2015-10-15 17:36:43 +0100
commita9feb5ccc2e219659ca7dfd21d6418ddc4b97559 (patch)
tree81a18579279be75285a7b475dec159151dd8e5ce
parentf67762b952f2962995bc37b30652e3eca0d2d835 (diff)
Use QStringRef in a bunch of places
Found with clazy static analyzer
-rw-r--r--src/kaevent.cpp14
-rw-r--r--src/version.cpp2
2 files changed, 8 insertions, 8 deletions
diff --git a/src/kaevent.cpp b/src/kaevent.cpp
index dcf3f8d..fe8ee77 100644
--- a/src/kaevent.cpp
+++ b/src/kaevent.cpp
@@ -780,7 +780,7 @@ void KAEventPrivate::set(const Event::Ptr &event)
++i;
}
const int len = flag.length() - 1;
- mReminderMinutes = -flag.left(len).toInt(); // -> 0 if conversion fails
+ mReminderMinutes = -flag.leftRef(len).toInt(); // -> 0 if conversion fails
switch (flag.at(len).toLatin1()) {
case 'M': break;
case 'H': mReminderMinutes *= 60; break;
@@ -3844,16 +3844,16 @@ DateTime KAEventPrivate::readDateTime(const Event::Ptr &event, bool dateOnly, Da
const QString prop = event->customProperty(KACalendar::APPNAME, KAEventPrivate::NEXT_RECUR_PROPERTY);
if (prop.length() >= SZ_DATE) {
// The next due recurrence time is specified
- const QDate d(prop.left(SZ_YEAR).toInt(),
- prop.mid(SZ_YEAR, SZ_MONTH).toInt(),
- prop.mid(SZ_YEAR + SZ_MONTH, SZ_DAY).toInt());
+ const QDate d(prop.leftRef(SZ_YEAR).toInt(),
+ prop.midRef(SZ_YEAR, SZ_MONTH).toInt(),
+ prop.midRef(SZ_YEAR + SZ_MONTH, SZ_DAY).toInt());
if (d.isValid()) {
if (dateOnly && prop.length() == SZ_DATE) {
next.setDate(d);
} else if (!dateOnly && prop.length() == IX_TIME + SZ_TIME && prop[SZ_DATE] == QLatin1Char('T')) {
- const QTime t(prop.mid(IX_TIME, SZ_HOUR).toInt(),
- prop.mid(IX_TIME + SZ_HOUR, SZ_MIN).toInt(),
- prop.mid(IX_TIME + SZ_HOUR + SZ_MIN, SZ_SEC).toInt());
+ const QTime t(prop.midRef(IX_TIME, SZ_HOUR).toInt(),
+ prop.midRef(IX_TIME + SZ_HOUR, SZ_MIN).toInt(),
+ prop.midRef(IX_TIME + SZ_HOUR + SZ_MIN, SZ_SEC).toInt());
if (t.isValid()) {
next.setDate(d);
next.setTime(t);
diff --git a/src/version.cpp b/src/version.cpp
index a78f8e5..172850c 100644
--- a/src/version.cpp
+++ b/src/version.cpp
@@ -69,7 +69,7 @@ int getVersionNumber(const QString &version, QString *subVersion)
if (subVersion) {
*subVersion = issue.mid(i);
}
- v = issue.left(i).toUInt(); // issue number
+ v = issue.leftRef(i).toUInt(); // issue number
vernum += (v < 99 ? v : 99);
}
return vernum;