[Marble-commits] KDE/kdeedu/marble/src/lib
Thibaut Gridel
tgridel at free.fr
Sun Jan 9 14:38:06 CET 2011
SVN commit 1213187 by tgridel:
PositionTracking: properly save to file using a new document
M +10 -3 PositionTracking.cpp
--- trunk/KDE/kdeedu/marble/src/lib/PositionTracking.cpp #1213186:1213187
@@ -192,12 +192,19 @@
//FIXME: a better way to do this?
writer.setDocumentType( kml::kmlTag_nameSpace22 );
- GeoDataDocument *document = new GeoDataDocument( *d->m_document );
+ GeoDataDocument *document = new GeoDataDocument;
QFileInfo fileInfo( fileName );
QString name = fileInfo.baseName();
document->setName( name );
- document->remove( 0 );
- document->last().setName( "Track" );
+ foreach( GeoDataStyle style, d->m_document->styles() ) {
+ document->addStyle( style );
+ }
+ foreach( GeoDataStyleMap map, d->m_document->styleMaps() ) {
+ document->addStyleMap( map );
+ }
+ GeoDataFeature *track = new GeoDataFeature(d->m_document->last());
+ track->setName( "Track " + name );
+ document->append( track );
QFile file( fileName );
file.open( QIODevice::ReadWrite );
More information about the Marble-commits
mailing list