summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDennis Nienhüser <[email protected]>2015-08-31 20:37:16 +0200
committerDennis Nienhüser <[email protected]>2015-08-31 20:37:16 +0200
commit4972f18d7dfc59769437988c4c2d85ceb349bc2f (patch)
tree49e60851af87b5a54f3b12572736776f836c8f34
parent96324a41b60c19aa7d72056dfc2970828ec2543c (diff)
Clear all search results when adding one to the route
-rw-r--r--src/apps/marble-maps/PlacemarkDialog.qml4
-rw-r--r--src/lib/marble/declarative/Routing.cpp14
-rw-r--r--src/lib/marble/declarative/Routing.h2
3 files changed, 2 insertions, 18 deletions
diff --git a/src/apps/marble-maps/PlacemarkDialog.qml b/src/apps/marble-maps/PlacemarkDialog.qml
index 520cd0e..95ac6c5 100644
--- a/src/apps/marble-maps/PlacemarkDialog.qml
+++ b/src/apps/marble-maps/PlacemarkDialog.qml
@@ -113,7 +113,7 @@ Item {
function execute() {
ensureRouteHasDeparture()
routing.addViaByPlacemark(placemark)
- routing.removeSearchResultPlacemark(placemark);
+ routing.clearSearchResultPlacemarks();
placemark = null;
}
}
@@ -126,7 +126,7 @@ Item {
function execute() {
ensureRouteHasDeparture()
routing.addViaByPlacemarkAtIndex(routing.waypointCount(), placemark)
- routing.removeSearchResultPlacemark(placemark);
+ routing.clearSearchResultPlacemarks();
placemark = null;
}
}
diff --git a/src/lib/marble/declarative/Routing.cpp b/src/lib/marble/declarative/Routing.cpp
index 38e9319..5185100 100644
--- a/src/lib/marble/declarative/Routing.cpp
+++ b/src/lib/marble/declarative/Routing.cpp
@@ -205,20 +205,6 @@ void Routing::clearSearchResultPlacemarks()
d->m_searchResultItems.clear();
}
-void Routing::removeSearchResultPlacemark(Placemark *placemark)
-{
- Q_ASSERT(d->m_searchResultPlacemarks.size() == d->m_searchResultItems.size());
- for (int i=0, n=d->m_searchResultPlacemarks.size(); i<n; ++i) {
- if (d->m_searchResultPlacemarks[i] == placemark) {
- d->m_searchResultPlacemarks[i]->deleteLater();
- d->m_searchResultPlacemarks.remove(i);
- d->m_searchResultItems[i]->deleteLater();
- d->m_searchResultItems.remove(i);
- return;
- }
- }
-}
-
void Routing::updateSearchResultPlacemarks()
{
for (int i = d->m_searchResultItems.keys().size(); i < d->m_searchResultPlacemarks.size(); i++ ) {
diff --git a/src/lib/marble/declarative/Routing.h b/src/lib/marble/declarative/Routing.h
index b3c4f1d..22a61e8 100644
--- a/src/lib/marble/declarative/Routing.h
+++ b/src/lib/marble/declarative/Routing.h
@@ -102,8 +102,6 @@ public Q_SLOTS:
void clearSearchResultPlacemarks();
- void removeSearchResultPlacemark(Placemark* placemark);
-
Q_SIGNALS:
void marbleMapChanged();