Skip to content
GitLab
Menu
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
83d42687
Commit
83d42687
authored
Apr 11, 2019
by
Laurent Montel
😁
Browse files
Make it compile without foreach
parent
61a14566
Changes
2
Hide whitespace changes
Inline
Side-by-side
CMakeLists.txt
View file @
83d42687
...
...
@@ -47,6 +47,10 @@ find_package(KF5IdentityManagement ${IDENTITYMANAGER_LIB_VERSION} CONFIG REQUIRE
find_package
(
KF5CalendarUtils
${
CALENDARUTILS_LIB_VERSION
}
CONFIG REQUIRED
)
add_definitions
(
-DTRANSLATION_DOMAIN=\"libkalarmcal5\"
)
if
(
${
KF5Config_VERSION
}
STRGREATER
"5.56.0"
)
add_definitions
(
-DQT_NO_FOREACH
)
MESSAGE
(
STATUS
"compile without foreach"
)
endif
()
########### Targets ###########
...
...
src/kadatetime.cpp
View file @
83d42687
...
...
@@ -2355,7 +2355,7 @@ KADateTime KADateTime::fromString(const QString &string, const QString &format,
// abbreviation applies at the specified date/time.
bool
useUtcOffset
=
false
;
const
QList
<
QByteArray
>
zoneIds
=
QTimeZone
::
availableTimeZoneIds
();
Q_FOREACH
(
const
QByteArray
&
zoneId
,
zoneIds
)
{
for
(
const
QByteArray
&
zoneId
:
zoneIds
)
{
const
QTimeZone
z
(
zoneId
);
qdt
.
setTimeZone
(
z
);
if
(
z
.
abbreviation
(
qdt
)
==
zoneAbbrev
)
{
...
...
@@ -2393,7 +2393,7 @@ KADateTime KADateTime::fromString(const QString &string, const QString &format,
dtUTC
.
setTimeSpec
(
Qt
::
UTC
);
dtUTC
=
dtUTC
.
addSecs
(
-
utcOffset
);
const
QList
<
QByteArray
>
zoneIds
=
QTimeZone
::
availableTimeZoneIds
();
Q_FOREACH
(
const
QByteArray
&
zoneId
,
zoneIds
)
{
for
(
const
QByteArray
&
zoneId
:
zoneIds
)
{
const
QTimeZone
z
(
zoneId
);
if
(
z
.
offsetFromUtc
(
dtUTC
)
==
utcOffset
)
{
// Found a time zone which uses this offset at the specified time
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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