diff --git a/src/lib/marble/geodata/data/GeoDataContainer.cpp b/src/lib/marble/geodata/data/GeoDataContainer.cpp --- a/src/lib/marble/geodata/data/GeoDataContainer.cpp +++ b/src/lib/marble/geodata/data/GeoDataContainer.cpp @@ -298,7 +298,25 @@ int GeoDataContainer::removeAll(GeoDataFeature *feature) { detach(); +#if QT_VERSION >= 0x050400 return p()->m_vector.removeAll(feature); +#else + int count = 0; + + QVector &vector = p()->m_vector; + QVector::iterator it = vector.begin(); + + while(it != vector.end()) { + if (*it == feature) { + it = vector.erase(it); + ++count; + } else { + ++it; + } + } + + return count; +#endif } void GeoDataContainer::removeAt(int index) @@ -322,7 +340,20 @@ bool GeoDataContainer::removeOne( GeoDataFeature *feature ) { detach(); +#if QT_VERSION >= 0x050400 return p()->m_vector.removeOne( feature ); +#else + QVector &vector = p()->m_vector; + + const int i = vector.indexOf(feature); + if (i < 0) { + return false; + } + + vector.remove(i); + + return true; +#endif } int GeoDataContainer::size() const