When image is an Array, take the first one
ClosedPublic

Authored by broulik on Feb 23 2020, 1:31 PM.

Details

Summary

Itinerary expects image as a QUrl, so when a websites uses an Array with multiple images (not sure how compliant that is but very common), at least take the first one so we have something to show.

Test Plan

Suddenly got images on many more restaurant websites :)
QJsonArray::first() doesn't assert like QList::first() when empty since it returns a QJsonValue and no reference.

Diff Detail

Repository
R1003 KItinerary: Travel Reservation handling library
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
broulik created this revision.Feb 23 2020, 1:31 PM
Restricted Application added a project: KDE PIM. · View Herald TranscriptFeb 23 2020, 1:31 PM
Restricted Application added a subscriber: kde-pim. · View Herald Transcript
broulik requested review of this revision.Feb 23 2020, 1:31 PM
vkrause accepted this revision.Feb 23 2020, 2:14 PM
This revision is now accepted and ready to land.Feb 23 2020, 2:14 PM
This revision was automatically updated to reflect the committed changes.