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
KItinerary
Commits
347b9720
Commit
347b9720
authored
Jan 11, 2022
by
Laurent Montel
😁
Browse files
Fix more qt6 compile error
parent
cb00d391
Pipeline
#122011
passed with stage
in 4 minutes and 18 seconds
Changes
6
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/lib/calendarhandler.cpp
View file @
347b9720
...
...
@@ -29,7 +29,6 @@
#include <KCalendarCore/Event>
#endif
#include <kcontacts_version.h>
#include <KContacts/Address>
#include <KLocalizedString>
...
...
@@ -46,11 +45,7 @@ static QString formatAddress(const PostalAddress &addr)
a
.
setStreet
(
addr
.
streetAddress
());
a
.
setPostalCode
(
addr
.
postalCode
());
a
.
setLocality
(
addr
.
addressLocality
());
#if KContacts_VERSION <= QT_VERSION_CHECK(5, 88, 0)
a
.
setCountry
(
KContacts
::
Address
::
ISOtoCountry
(
addr
.
addressCountry
()));
#else
a
.
setCountry
(
addr
.
addressCountry
());
#endif
return
a
.
formattedAddress
();
}
...
...
@@ -444,7 +439,6 @@ static void fillGeoPosition(const QVariant &place, const KCalendarCore::Event::P
return
;
}
event
->
setHasGeo
(
true
);
event
->
setGeoLatitude
(
geo
.
latitude
());
event
->
setGeoLongitude
(
geo
.
longitude
());
}
...
...
src/lib/calendarhandler.h
View file @
347b9720
...
...
@@ -9,8 +9,11 @@
#include "kitinerary_export.h"
#include <QSharedPointer>
template
<
typename
T
>
class
QVector
;
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
template
<
typename
T
>
class
QVector
;
#else
template
<
typename
T
>
class
QList
;
#endif
class
QVariant
;
namespace
KCalendarCore
{
...
...
src/lib/extractorpostprocessor.cpp
View file @
347b9720
...
...
@@ -240,12 +240,20 @@ TrainStation ExtractorPostprocessorPrivate::processTrainStation(TrainStation sta
}
else
if
(
id
.
startsWith
(
QLatin1String
(
"ibnr:"
))
&&
id
.
size
()
==
12
)
{
const
auto
record
=
KnowledgeDb
::
stationForIbnr
(
KnowledgeDb
::
IBNR
{
id
.
mid
(
5
).
toUInt
()});
applyStationData
(
record
,
station
);
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
const
auto
country
=
KnowledgeDb
::
countryIdForUicCode
(
id
.
midRef
(
5
,
2
).
toUShort
()).
toString
();
#else
const
auto
country
=
KnowledgeDb
::
countryIdForUicCode
(
QStringView
(
id
).
mid
(
5
,
2
).
toUShort
()).
toString
();
#endif
applyStationCountry
(
country
,
station
);
}
else
if
(
id
.
startsWith
(
QLatin1String
(
"uic:"
))
&&
id
.
size
()
==
11
)
{
const
auto
record
=
KnowledgeDb
::
stationForUic
(
KnowledgeDb
::
UICStation
{
id
.
mid
(
4
).
toUInt
()});
applyStationData
(
record
,
station
);
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
const
auto
country
=
KnowledgeDb
::
countryIdForUicCode
(
id
.
midRef
(
4
,
2
).
toUShort
()).
toString
();
#else
const
auto
country
=
KnowledgeDb
::
countryIdForUicCode
(
QStringView
(
id
).
mid
(
4
,
2
).
toUShort
()).
toString
();
#endif
applyStationCountry
(
country
,
station
);
}
else
if
(
id
.
startsWith
(
QLatin1String
(
"ir:"
))
&&
id
.
size
()
>
4
)
{
const
auto
record
=
KnowledgeDb
::
stationForIndianRailwaysStationCode
(
id
.
mid
(
3
));
...
...
src/lib/tlv/berelement.cpp
View file @
347b9720
...
...
@@ -24,7 +24,7 @@ BER::Element::Element() = default;
BER
::
Element
::
Element
(
const
QByteArray
&
data
,
int
offset
,
int
size
)
:
m_data
(
data
)
,
m_offset
(
offset
)
,
m_dataSize
(
size
<
0
?
data
.
size
()
:
std
::
min
(
offset
+
size
,
data
.
size
()))
,
m_dataSize
(
size
<
0
?
data
.
size
()
:
std
::
min
<
int
>
(
offset
+
size
,
data
.
size
()))
{
assert
(
m_dataSize
<=
m_data
.
size
());
if
(
!
isValid
())
{
...
...
src/lib/uic9183/rct2ticket.cpp
View file @
347b9720
...
...
@@ -38,8 +38,11 @@ QDate Rct2TicketPrivate::firstDayOfValidity() const
if
(
it
==
f
.
end
())
{
return
{};
}
const
auto
dtStr
=
f
.
midRef
(
std
::
distance
(
f
.
begin
(),
it
));
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
const
auto
dtStr
=
f
.
midRef
(
std
::
distance
(
f
.
begin
(),
it
));
#else
const
auto
dtStr
=
QStringView
(
f
).
mid
(
std
::
distance
(
f
.
begin
(),
it
));
#endif
auto
dt
=
QDate
::
fromString
(
dtStr
.
left
(
10
).
toString
(),
QStringLiteral
(
"dd.MM.yyyy"
));
if
(
dt
.
isValid
())
{
return
dt
;
...
...
src/lib/uic9183/uic9183ticketlayout.cpp
View file @
347b9720
...
...
@@ -161,8 +161,11 @@ QString Uic9183TicketLayout::text(int row, int column, int width, int height) co
// split field into lines
// TODO this needs to follow the U_TLAY word-wrapping algorithm?
const
auto
content
=
f
.
text
();
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
const
auto
lines
=
content
.
splitRef
(
QLatin1Char
(
'\n'
));
#else
const
auto
lines
=
QStringView
(
content
).
split
(
QLatin1Char
(
'\n'
));
#endif
// cut out the right part of the line
for
(
int
i
=
0
;
i
<
lines
.
size
();
++
i
)
{
if
(
f
.
row
()
+
i
<
row
)
{
...
...
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