summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFriedrich W. H. Kossebau <[email protected]>2016-07-09 05:21:00 +0200
committerFriedrich W. H. Kossebau <[email protected]>2016-07-09 05:21:00 +0200
commitff866acf69ce0c84cd1a3ea7bf776ac88fc51995 (patch)
treecf906325d4caa2ad91c7190573c4baaf1be37900
parentb81be8492901b76355db630d27043af69f2aa8da (diff)
Fix compiling with Qt < 5.4
QVector::removeAll/QVector::removeOne were only added in Qt 5.4
-rw-r--r--src/lib/marble/ReverseGeocodingRunnerManager.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/lib/marble/ReverseGeocodingRunnerManager.cpp b/src/lib/marble/ReverseGeocodingRunnerManager.cpp
index 65b3d03..d29fa3a 100644
--- a/src/lib/marble/ReverseGeocodingRunnerManager.cpp
+++ b/src/lib/marble/ReverseGeocodingRunnerManager.cpp
@@ -121,7 +121,20 @@ void ReverseGeocodingRunnerManager::reverseGeocoding( const GeoDataCoordinates &
{
d->m_reverseTasks.clear();
d->m_reverseGeocodingResult.clear();
+#if QT_VERSION >= 0x050400
d->m_reverseGeocodingResults.removeAll( coordinates );
+#else
+ QVector<GeoDataCoordinates> &vector = d->m_reverseGeocodingResults;
+ QVector<GeoDataCoordinates>::iterator it = vector.begin();
+
+ while (it != vector.end()) {
+ if (*it == coordinates) {
+ it = vector.erase(it);
+ } else {
+ ++it;
+ }
+ }
+#endif
QList<const ReverseGeocodingRunnerPlugin*> plugins = d->plugins( d->m_pluginManager->reverseGeocodingRunnerPlugins() );
foreach( const ReverseGeocodingRunnerPlugin* plugin, plugins ) {
ReverseGeocodingTask* task = new ReverseGeocodingTask( plugin->newRunner(), this, d->m_marbleModel, coordinates );