[Marble-commits] KDE/kdeedu/marble/src
Dennis Nienhüser
earthwings at gentoo.org
Wed Sep 8 23:44:42 CEST 2010
SVN commit 1173179 by nienhueser:
Do not force lookAt() getter to return something, this results in kml serialization always writing lookat tags and maybe other glitches.
M +9 -1 QtMainWindow.cpp
M +0 -10 lib/geodata/data/GeoDataPlacemark.cpp
M +8 -1 marble_part.cpp
--- trunk/KDE/kdeedu/marble/src/QtMainWindow.cpp #1173178:1173179
@@ -396,7 +396,15 @@
for (; i != end; ++i ) {
QAction *bookmarkAct = new QAction( (*i)->name(), this );
QVariant var;
- var.setValue( *( (*i)->lookAt() ) );
+
+ GeoDataLookAt* lookAt = (*i)->lookAt();
+ if ( !lookAt ) {
+ GeoDataLookAt coordinateToLookAt;
+ coordinateToLookAt.setCoordinates( (*i)->coordinate() );
+ coordinateToLookAt.setRange( (*i)->coordinate().altitude() );
+ } else {
+ var.setValue( *lookAt );
+ }
bookmarkAct->setData( var );
m_bookmarksListMenu->addAction( bookmarkAct );
--- trunk/KDE/kdeedu/marble/src/lib/geodata/data/GeoDataPlacemark.cpp #1173178:1173179
@@ -71,18 +71,8 @@
GeoDataLookAt *GeoDataPlacemark::lookAt() const
{
- if( p()->m_lookAt == 0 ){
- GeoDataCoordinates tempCoordinate = coordinate();
- GeoDataLookAt *coordinateToLookAt = new GeoDataLookAt();
- coordinateToLookAt->setCoordinates( tempCoordinate );
- coordinateToLookAt->setRange( tempCoordinate.altitude() );
- return coordinateToLookAt;
- }
- else {
return p()->m_lookAt;
-
}
-}
void GeoDataPlacemark::setLookAt( GeoDataLookAt *lookAt)
{
--- trunk/KDE/kdeedu/marble/src/marble_part.cpp #1173178:1173179
@@ -843,7 +843,14 @@
for (; i != end; ++i ) {
QAction *bookmarkAct = new QAction( (*i)->name(), this );
QVariant var;
- var.setValue( *( (*i)->lookAt() ) );
+ GeoDataLookAt* lookAt = (*i)->lookAt();
+ if ( !lookAt ) {
+ GeoDataLookAt coordinateToLookAt;
+ coordinateToLookAt.setCoordinates( (*i)->coordinate() );
+ coordinateToLookAt.setRange( (*i)->coordinate().altitude() );
+ } else {
+ var.setValue( *lookAt );
+ }
bookmarkAct->setData( var );
m_bookmarksListMenu->addAction( bookmarkAct );
}
More information about the Marble-commits
mailing list