Commit 9216c538 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Fix Bug 369489 - please use openstreetmap instead of mapquest

FIXED-IN: 5.4.0
BUG: 369489

I don't use it by default but we can use openstreetmap in kaddressbook.
parent 7a77ddc3
......@@ -13,6 +13,7 @@
<choice name="UseExternalAddressApplication"/>
<choice name="UseGooglemap"/>
<choice name="UseMapquest"/>
<choice name="UseOpenStreetMap"/>
</choices>
<whatsthis>Defines which application shall be used to show the postal address of a contact on a map. If 'Web Browser' is selected, an URL can be defined with placeholders for the single address parts. If 'External Application' is selected, a command with placeholders can be defined.</whatsthis>
<default>UseBrowser</default>
......
......@@ -70,5 +70,11 @@ void ShowAddressAction::showAddress(const KContacts::Address &address)
if (!urlTemplate.isEmpty()) {
QDesktopServices::openUrl(QUrl(urlTemplate));
}
} else if (ContactActionsSettings::self()->showAddressAction() == ContactActionsSettings::UseOpenStreetMap) {
QString urlTemplate = QStringLiteral("https://www.openstreetmap.org/search?query=%s,%l,%c");
replaceArguments(urlTemplate, address);
if (!urlTemplate.isEmpty()) {
QDesktopServices::openUrl(QUrl(urlTemplate));
}
}
}
......@@ -65,6 +65,7 @@ KCMAkonadiContactActions::KCMAkonadiContactActions(QWidget *parent, const QVaria
ui.ShowAddressAction->addItem(i18n("External Application"), ContactActionsSettings::UseExternalAddressApplication);
ui.ShowAddressAction->addItem(i18n("Google map"), ContactActionsSettings::UseGooglemap);
ui.ShowAddressAction->addItem(i18n("Map quest"), ContactActionsSettings::UseMapquest);
ui.ShowAddressAction->addItem(i18n("OpenStreetMap"), ContactActionsSettings::UseOpenStreetMap);
connect(ui.ShowAddressAction, SIGNAL(currentIndexChanged(int)), SLOT(slotShowAddressActionChanged(int)));
......
Markdown is supported
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