summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <montel@kde.org>2016-09-29 04:53:01 (GMT)
committerMontel Laurent <montel@kde.org>2016-09-29 04:53:01 (GMT)
commit9216c53839ee536b3fac80fb920ff2ef4b8defdf (patch)
tree228ba8a831d058bdb661799ae3b8092b9fccfb11
parent7a77ddc395c9312374590339d10758778ec6bc05 (diff)
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.
-rw-r--r--src/actions/contactactionssettings.kcfg.cmake1
-rw-r--r--src/actions/showaddressaction.cpp6
-rw-r--r--src/kcm/kcmakonadicontactactions.cpp1
3 files changed, 8 insertions, 0 deletions
diff --git a/src/actions/contactactionssettings.kcfg.cmake b/src/actions/contactactionssettings.kcfg.cmake
index 58aaa90..80e5f89 100644
--- a/src/actions/contactactionssettings.kcfg.cmake
+++ b/src/actions/contactactionssettings.kcfg.cmake
@@ -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>
diff --git a/src/actions/showaddressaction.cpp b/src/actions/showaddressaction.cpp
index 16c91bc..f1a6756 100644
--- a/src/actions/showaddressaction.cpp
+++ b/src/actions/showaddressaction.cpp
@@ -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));
+ }
}
}
diff --git a/src/kcm/kcmakonadicontactactions.cpp b/src/kcm/kcmakonadicontactactions.cpp
index 9f20b25..67afc99 100644
--- a/src/kcm/kcmakonadicontactactions.cpp
+++ b/src/kcm/kcmakonadicontactactions.cpp
@@ -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)));