D27600: When image is an Array, take the first one

Kai Uwe Broulik noreply at phabricator.kde.org
Sun Feb 23 13:31:04 GMT 2020


broulik created this revision.
broulik added a reviewer: vkrause.
Herald added a project: KDE PIM.
Herald added a subscriber: kde-pim.
broulik requested review of this revision.

REVISION 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.

REPOSITORY
  R1003 KItinerary: Travel Reservation handling library

REVISION DETAIL
  https://phabricator.kde.org/D27600

AFFECTED FILES
  src/jsonldimportfilter.cpp

To: broulik, vkrause
Cc: kde-pim, fbampaloukas, dcaliste, dvasin, rodsevich, winterz, vkrause, mlaurent, knauss, dvratil
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-pim/attachments/20200223/a469bb72/attachment-0001.html>


More information about the kde-pim mailing list