[Marble-commits] KDE/kdeedu/marble
Andrew Manson
g.real.ate at gmail.com
Mon Aug 10 17:25:33 CEST 2009
SVN commit 1009661 by mansona:
adding some of the support for saving Annotation files. Trying to add a Unit test for
a plugin but having problems. Adding support for CTest and CDash.
M +3 -3 CTestConfig.cmake
M +2 -7 src/plugins/render/osmannotate/CMakeLists.txt
M +19 -0 src/plugins/render/osmannotate/PlacemarkTextAnnotation.cpp
M +3 -0 src/plugins/render/osmannotate/PlacemarkTextAnnotation.h
M +2 -0 src/plugins/render/osmannotate/TextAnnotation.cpp
M +3 -0 src/plugins/render/osmannotate/TextAnnotation.h
M +10 -0 src/plugins/render/osmannotate/TextEditor.cpp
M +2 -0 src/plugins/render/osmannotate/TextEditor.h
M +22 -0 tests/CMakeLists.txt
M +1 -1 tests/TestGeoDataWriter.cpp
M +5 -2 tests/TestOsmAnnotation.cpp
M +1 -1 tests/data/CDATATest.kml
--- trunk/KDE/kdeedu/marble/CTestConfig.cmake #1009660:1009661
@@ -1,5 +1,5 @@
SET(CTEST_PROJECT_NAME "Marble")
-SET(CTEST_NIGHTLY_START_TIME "00:00:00 EST")
+SET(CTEST_NIGHTLY_START_TIME "00:00:00 UTC")
IF(NOT DEFINED CTEST_DROP_METHOD)
SET(CTEST_DROP_METHOD "http")
@@ -7,6 +7,6 @@
IF(CTEST_DROP_METHOD STREQUAL "http")
SET(CTEST_DROP_SITE "my.cdash.org")
- SET(CTEST_DROP_LOCATION "/submit.php?project=test")
- SET(CTEST_TRIGGER_SITE "")
+ SET(CTEST_DROP_LOCATION "/submit.php?project=Marble")
+ set(CTEST_DROP_SITE_CDASH TRUE)
ENDIF(CTEST_DROP_METHOD STREQUAL "http")
--- trunk/KDE/kdeedu/marble/src/plugins/render/osmannotate/CMakeLists.txt #1009660:1009661
@@ -8,15 +8,10 @@
INCLUDE(${QT_USE_FILE})
FILE( GLOB geodata_handlers_osm_SRCS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} osm/*.cpp )
+FILE( GLOB osmannotate_local_SRCS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.cpp )
set( osmannotate_SRCS
- OsmAnnotatePlugin.cpp
- PlacemarkTextAnnotation.cpp
- TmpGraphicsItem.cpp
- TextAnnotation.cpp
- AreaAnnotation.cpp
- GeoWidgetBubble.cpp
- TextEditor.cpp
+ ${osmannotate_local_SRCS}
${geodata_handlers_osm_SRCS} )
marble_add_plugin( OsmAnnotatePlugin ${osmannotate_SRCS} )
--- trunk/KDE/kdeedu/marble/src/plugins/render/osmannotate/PlacemarkTextAnnotation.cpp #1009660:1009661
@@ -13,6 +13,7 @@
#include "AbstractProjection.h"
#include "GeoDataPlacemark.h"
+#include "GeoDocument.h"
#include "GeoPainter.h"
#include "GeoWidgetBubble.h"
#include "ViewportParams.h"
@@ -136,17 +137,35 @@
return m_textEditor->name();
}
+void PlacemarkTextAnnotation::setName( const QString &name )
+{
+ m_textEditor->setName( name );
+}
+
QString PlacemarkTextAnnotation::description() const
{
return m_textEditor->description();
}
+void PlacemarkTextAnnotation::setDescription( const QString &description )
+{
+ m_textEditor->setDescription( description );
+}
+
GeoDataGeometry PlacemarkTextAnnotation::geometry() const
{
return GeoDataPoint( coordinate() );
}
+void PlacemarkTextAnnotation::setGeometry( const GeoDataGeometry &geometry )
+{
+ //FIXME: undefined reference
+// if( geometry.nodeType() == GeoDataTypes::GeoDataPointType ) {
+ setCoordinate( GeoDataCoordinates( static_cast<GeoDataPoint>(geometry) ) );
+// }
+}
+
bool PlacemarkTextAnnotation::mousePressEvent( QMouseEvent* event )
{
Q_UNUSED(event);
--- trunk/KDE/kdeedu/marble/src/plugins/render/osmannotate/PlacemarkTextAnnotation.h #1009660:1009661
@@ -34,8 +34,11 @@
//TextAnnotation
virtual QString name() const;
+ virtual void setName( const QString &name );
virtual QString description() const;
+ virtual void setDescription( const QString &description );
virtual GeoDataGeometry geometry() const;
+ virtual void setGeometry( const GeoDataGeometry &geometry );
private:
GeoWidgetBubble* bubble;
--- trunk/KDE/kdeedu/marble/src/plugins/render/osmannotate/TextAnnotation.cpp #1009660:1009661
@@ -29,6 +29,8 @@
placemark.setName( name() );
placemark.setDescription( description() );
+ //allow for HTML in the description
+ placemark.setDescriptionCDATA( true );
//FIXME: make this work for all geometries and not just points
// placemark.setGeometry( geometry() );
--- trunk/KDE/kdeedu/marble/src/plugins/render/osmannotate/TextAnnotation.h #1009660:1009661
@@ -26,8 +26,11 @@
virtual ~TextAnnotation();
virtual QString name() const = 0 ;
+ virtual void setName( const QString& name ) = 0;
virtual QString description() const = 0;
+ virtual void setDescription( const QString& description ) = 0;
virtual GeoDataGeometry geometry() const = 0;
+ virtual void setGeometry( const GeoDataGeometry &geometry ) = 0;
GeoDataPlacemark toGeoData() const;
--- trunk/KDE/kdeedu/marble/src/plugins/render/osmannotate/TextEditor.cpp #1009660:1009661
@@ -87,9 +87,19 @@
return m_name->text();
}
+void TextEditor::setName(const QString &name )
+{
+ m_name->setText( name );
+}
+
QString TextEditor::description() const
{
return m_description->toHtml();
}
+void TextEditor::setDescription( const QString &description )
+{
+ m_description->setHtml( description );
}
+
+}
--- trunk/KDE/kdeedu/marble/src/plugins/render/osmannotate/TextEditor.h #1009660:1009661
@@ -29,8 +29,10 @@
//return the plain text name
QString name() const;
+ void setName( const QString &name );
//return the HTML description
QString description() const;
+ void setDescription( const QString &description );
private:
QAction* m_boldAction;
--- trunk/KDE/kdeedu/marble/tests/CMakeLists.txt #1009660:1009661
@@ -29,6 +29,27 @@
#############################################################
+
+#############################################################
+# Add extra Libs for testing Plugins
+#############################################################
+#FIXME: Find a better way to do this!
+set(osmannotate_SRCS
+ ../src/plugins/render/osmannotate/TextAnnotation.cpp
+ ../src/plugins/render/osmannotate/PlacemarkTextAnnotation.cpp
+ ../src/plugins/render/osmannotate/GeoWidgetBubble.cpp
+ ../src/plugins/render/osmannotate/TmpGraphicsItem.cpp
+ ../src/plugins/render/osmannotate/TextEditor.cpp )
+
+add_library(OsmAnnotatePluginTestLib SHARED ${osmannotate_SRCS} )
+target_link_libraries( OsmAnnotatePluginTestLib
+ ${QT_QTGUI_LIBRARY}
+ ${QT_QTMAIN_LIBRARY}
+ ${QT_QTCORE_LIBRARY}
+ marblewidget )
+
+#############################################################
+
# MarbleWidget test
marble_add_test( MarbleWidgetSpeedTest )
@@ -71,4 +92,5 @@
marble_add_test( MarbleWidgetTest )
add_definitions( -DCITIES_PATH="\\\"${CMAKE_CURRENT_SOURCE_DIR}/../../../data/placemarks/cityplacemarks.kml\\\"" )
marble_add_test( KMLTest )
+
marble_add_test( TestOsmAnnotation )
--- trunk/KDE/kdeedu/marble/tests/TestGeoDataWriter.cpp #1009660:1009661
@@ -72,7 +72,7 @@
QVERIFY( file.open( QIODevice::ReadOnly ) );
//Parser and verify
- QVERIFY( parser->read( &file ) );
+ QVERIFY2( parser->read( &file ), filename.toAscii() );
parsers.insert( filename, parserPointer );
--- trunk/KDE/kdeedu/marble/tests/TestOsmAnnotation.cpp #1009660:1009661
@@ -24,12 +24,15 @@
void saveAnnotations_data();
void saveAnnotations();
private:
- QList<QSharedPointer<TextAnnotation> > textAnnotations;
+ QMap< QString, QSharedPointer<TextAnnotation> > textAnnotations;
};
void TestOsmAnnotation::initTestCase()
{
-
+ PlacemarkTextAnnotation* standard;
+// uncomment the following to get the Undefined references
+// standard = new PlacemarkTextAnnotation();
+// standard->setName( "Standard Annon" );
}
void TestOsmAnnotation::saveAnnotations_data()
--- trunk/KDE/kdeedu/marble/tests/data/CDATATest.kml #1009660:1009661
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<kml xmlns="http://www.opengis.net/kml/2.2">
+<kml xmlns="http://earth.google.com/kml/2.2">
<Document>
<Placemark>
<name>Feature.kml</name>
More information about the Marble-commits
mailing list