Fix compiling with Qt < 5.4

QVector::removeAll/QVector::removeOne were only added in Qt 5.4
parent b81be849
......@@ -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 );
......
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