[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    branches/marble/marble-1.1/src/lib
From:       Thibaut Gridel <tgridel () free ! fr>
Date:       2011-01-09 15:04:20
Message-ID: 20110109150420.7D40DAC8B3 () svn ! kde ! org
[Download RAW message or body]

SVN commit 1213201 by tgridel:

PositionTracking: properly save to file using a new document

 M  +10 -3     PositionTracking.cpp  


--- branches/marble/marble-1.1/src/lib/PositionTracking.cpp #1213200:1213201
@@ -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 );
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic