diff --git a/src/versit/qversitcontactexporter_p.cpp b/src/versit/qversitcontactexporter_p.cpp index de9612d..85efc37 100644 --- a/src/versit/qversitcontactexporter_p.cpp +++ b/src/versit/qversitcontactexporter_p.cpp @@ -487,8 +487,9 @@ void QVersitContactExporterPrivate::encodeGeoLocation( QContactGeoLocation geoLocation = static_cast(detail); QVersitProperty property; property.setName(mPropertyMappings.value(detail.definitionName())); - property.setValue(QStringList() << QString::number(geoLocation.longitude()) - << QString::number(geoLocation.latitude())); + // RFC-2426 says the order should be "LAT LON" + property.setValue(QStringList() << QString::number(geoLocation.latitude()) + << QString::number(geoLocation.longitude())); property.setValueType(QVersitProperty::CompoundType); *generatedProperties << property; *processedFields << QContactGeoLocation::FieldLongitude diff --git a/src/versit/qversitcontactimporter_p.cpp b/src/versit/qversitcontactimporter_p.cpp index 9f6c04f..628581a 100644 --- a/src/versit/qversitcontactimporter_p.cpp +++ b/src/versit/qversitcontactimporter_p.cpp @@ -673,10 +673,11 @@ bool QVersitContactImporterPrivate::createGeoLocation( || variant.type() != QVariant::StringList) return false; QStringList values = variant.toStringList(); + // RFC-2426 says the order should be "LAT LON" bool ok1; - geo.setLongitude(takeFirst(values).toDouble(&ok1)); + geo.setLatitude(takeFirst(values).toDouble(&ok1)); bool ok2; - geo.setLatitude(takeFirst(values).toDouble(&ok2)); + geo.setLongitude(takeFirst(values).toDouble(&ok2)); if (ok1 && ok2) { saveDetailWithContext(updatedDetails, geo, extractContexts(property));