Commit a14ed062 authored by Volker Krause's avatar Volker Krause
Browse files

Give the PlaceEditor the ability to select a default country

Useful if the address we want to edit has none set yet.
parent 7f3a0c19
......@@ -25,6 +25,9 @@ Kirigami.FormLayout {
property double latitude: place.geo.latitude;
property double longitude: place.geo.longitude;
/** Initially selected country if the given address doesn't specify one. */
property string defaultCountry: Settings.homeCountryIsoCode
function save(place) {
var addr = place.address;
addr.streetAddress = streetAddress.text;
......@@ -103,7 +106,7 @@ Kirigami.FormLayout {
id: addressCountry
Kirigami.FormData.label: i18n("Country:")
model: Country.allCountries.map(c => c.alpha2)
initialCountry: place.address.addressCountry
initialCountry: place.address.addressCountry ? place.address.addressCountry : root.defaultCountry
}
QtLocation.Plugin {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment