[Marble-commits] KDE/kdeedu/marble/src/lib
Thibaut Gridel
tgridel at free.fr
Sat Jul 17 00:35:48 CEST 2010
SVN commit 1150834 by tgridel:
GeoDataContainer: use folderList instead of folders
M +5 -5 FileLoader.cpp
M +7 -7 geodata/GeoDataTest.cpp
M +3 -5 geodata/data/GeoDataContainer.cpp
M +1 -1 geodata/data/GeoDataContainer.h
M +3 -3 routing/RoutingModel.cpp
--- trunk/KDE/kdeedu/marble/src/lib/FileLoader.cpp #1150833:1150834
@@ -307,12 +307,12 @@
out << (qint64) (*it)->population();
}
- const QVector<GeoDataFolder> folders = container->folders();
- QVector<GeoDataFolder>::const_iterator cont = folders.constBegin();
- QVector<GeoDataFolder>::const_iterator endcont = folders.constEnd();
+ const QVector<GeoDataFolder*> folders = container->folderList();
+ QVector<GeoDataFolder*>::const_iterator cont = folders.constBegin();
+ QVector<GeoDataFolder*>::const_iterator endcont = folders.constEnd();
for (; cont != endcont; ++cont ) {
- if (GeoDataFolderId == cont->featureId() ) {
- const GeoDataContainer *subcontainer = & (*cont);
+ if (GeoDataFolderId == (*cont)->featureId() ) {
+ GeoDataContainer *subcontainer = *cont;
savePlacemarks(out, subcontainer);
}
}
--- trunk/KDE/kdeedu/marble/src/lib/geodata/GeoDataTest.cpp #1150833:1150834
@@ -194,18 +194,18 @@
// qDebug() << placemark.name() << placemark.population() << placemark.coordinate().toString();
}
-void dumpFoldersRecursively(const GeoDataContainer& container, int depth)
+void dumpFoldersRecursively(const GeoDataContainer *container, int depth)
{
- qDebug() << "dumping container with" << container.size() << "children...";
+ qDebug() << "dumping container with" << container->size() << "children...";
- QVector<GeoDataFolder> folders = container.folders();
- QVector<GeoDataPlacemark*> placemarks = container.placemarkList();
+ QVector<GeoDataFolder*> folders = container->folderList();
+ QVector<GeoDataPlacemark*> placemarks = container->placemarkList();
QString format = formatOutput(depth);
qDebug() << qPrintable(format + QString("Dumping container with %1 child folders!\n").arg(folders.size()));
- QVector<GeoDataFolder>::const_iterator it = folders.constBegin();
- const QVector<GeoDataFolder>::const_iterator end = folders.constEnd();
+ QVector<GeoDataFolder*>::const_iterator it = folders.constBegin();
+ const QVector<GeoDataFolder*>::const_iterator end = folders.constEnd();
for (; it != end; ++it) {
qDebug() << qPrintable(format + QString("Dumping child %1\n").arg(it - folders.constBegin() + 1));
@@ -225,7 +225,7 @@
void dumpGeoDataDocument(GeoDataDocument* document)
{
- dumpFoldersRecursively(*document, 0);
+ dumpFoldersRecursively(document, 0);
// TODO: Dump all features!
}
--- trunk/KDE/kdeedu/marble/src/lib/geodata/data/GeoDataContainer.cpp #1150833:1150834
@@ -60,18 +60,16 @@
return p()->nodeType();
}
-QVector<GeoDataFolder> GeoDataContainer::folders() const
+QVector<GeoDataFolder*> GeoDataContainer::folderList() const
{
- QVector<GeoDataFolder> results;
+ QVector<GeoDataFolder*> results;
QVector<GeoDataFeature*>::const_iterator it = p()->m_vector.constBegin();
QVector<GeoDataFeature*>::const_iterator end = p()->m_vector.constEnd();
for (; it != end; ++it) {
-
if ( (*it)->featureId() == GeoDataFolderId ) {
- GeoDataFeature feature = **it;
- results.append( feature );
+ results.append( static_cast<GeoDataFolder*>( *it ) );
}
}
--- trunk/KDE/kdeedu/marble/src/lib/geodata/data/GeoDataContainer.h #1150833:1150834
@@ -63,7 +63,7 @@
*
* @see GeoDataFolder
*/
- QVector<GeoDataFolder> folders() const;
+ QVector<GeoDataFolder*> folderList() const;
/**
* @brief A convenience function that returns all features in this container.
--- trunk/KDE/kdeedu/marble/src/lib/routing/RoutingModel.cpp #1150833:1150834
@@ -274,9 +274,9 @@
GeoDataDocument* document = static_cast<GeoDataDocument*>( parser.releaseDocument() );
Q_ASSERT( document );
- QVector<GeoDataFolder> folders = document->folders();
- foreach( const GeoDataFolder &folder, folders ) {
- foreach( const GeoDataPlacemark *placemark, folder.placemarkList() ) {
+ QVector<GeoDataFolder*> folders = document->folderList();
+ foreach( const GeoDataFolder *folder, folders ) {
+ foreach( const GeoDataPlacemark *placemark, folder->placemarkList() ) {
GeoDataGeometry* geometry = placemark->geometry();
if ( geometry->geometryId() == GeoDataLineStringId ) {
GeoDataLineString* lineString = dynamic_cast<GeoDataLineString*>( geometry );
More information about the Marble-commits
mailing list