KItinerary::MergeUtil

KItinerary::MergeUtil Namespace Reference

Functions

bool isSame (const QVariant &lhs, const QVariant &rhs)
 
bool isSamePerson (const Person &lhs, const Person &rhs)
 
QVariant merge (const QVariant &lhs, const QVariant &rhs)
 

Detailed Description

Utilities for merging reservations or elements of them.

Function Documentation

◆ isSame()

bool KItinerary::MergeUtil::isSame ( const QVariant lhs,
const QVariant rhs 
)

Checks if two Reservation or Trip values refer to the same booking element.

This does not mean being exactly equal, but having matching identifying properties. What this means exactly depends on the data type:

  • Flights: booking reference, flight number and departure day match
  • Train trip: booking reference, train number and departure day match
  • Bus trip: booking ref and/or number and departure time match
  • Hotel booking: hotel name, booking reference and checkin day match

For all reservation types, the Reservation::underName property is checked and either needs to be equal or absent in one of the values.

Definition at line 80 of file mergeutil.cpp.

◆ isSamePerson()

bool KItinerary::MergeUtil::isSamePerson ( const Person lhs,
const Person rhs 
)

Checks if two Person objects refer to the same person.

Essentially a case-insensitive comparison of the name components.

Definition at line 434 of file mergeutil.cpp.

◆ merge()

QVariant KItinerary::MergeUtil::merge ( const QVariant lhs,
const QVariant rhs 
)

Merge the two given objects.

This is the same as JsonLdDocument::apply in most cases, but if one side can be determined to be "better", that one is preferred.

Definition at line 503 of file mergeutil.cpp.

This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Thu May 26 2022 03:54:26 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.