Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
PIM
KAlarm
Commits
a9feb5cc
Commit
a9feb5cc
authored
Oct 15, 2015
by
Sergio Martins
Browse files
Use QStringRef in a bunch of places
Found with clazy static analyzer
parent
f67762b9
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/kaevent.cpp
View file @
a9feb5cc
...
...
@@ -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
.
left
Ref
(
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
.
left
Ref
(
SZ_YEAR
).
toInt
(),
prop
.
mid
Ref
(
SZ_YEAR
,
SZ_MONTH
).
toInt
(),
prop
.
mid
Ref
(
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
.
mid
Ref
(
IX_TIME
,
SZ_HOUR
).
toInt
(),
prop
.
mid
Ref
(
IX_TIME
+
SZ_HOUR
,
SZ_MIN
).
toInt
(),
prop
.
mid
Ref
(
IX_TIME
+
SZ_HOUR
+
SZ_MIN
,
SZ_SEC
).
toInt
());
if
(
t
.
isValid
())
{
next
.
setDate
(
d
);
next
.
setTime
(
t
);
...
...
src/version.cpp
View file @
a9feb5cc
...
...
@@ -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
.
left
Ref
(
i
).
toUInt
();
// issue number
vernum
+=
(
v
<
99
?
v
:
99
);
}
return
vernum
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment