Marble

KmlRefreshModeTagHandler.cpp
1#include "KmlRefreshModeTagHandler.h"
2#include "MarbleDebug.h"
3#include "KmlElementDictionary.h"
4#include "GeoDataLink.h"
5#include "GeoParser.h"
6
7namespace Marble
8{
9namespace kml
10{
11KML_DEFINE_TAG_HANDLER( refreshMode )
12
13GeoNode* KmlrefreshModeTagHandler::parse( GeoParser& parser ) const
14{
15 Q_ASSERT(parser.isStartElement() && parser.isValidElement(QLatin1String(kmlTag_refreshMode)));
16
17 GeoStackItem parentItem = parser.parentElement();
18 QString content = parser.readElementText().trimmed();
19 GeoDataLink::RefreshMode mode;
20
21 if ( parentItem.is<GeoDataLink>()) {
22 if (content == QLatin1String("onChange")) {
23 mode = GeoDataLink::OnChange;
24 } else if (content == QLatin1String("onExpire")) {
25 mode = GeoDataLink::OnExpire;
26 } else if (content == QLatin1String("onInterval")) {
27 mode = GeoDataLink::OnInterval;
28 } else {
29 mode = GeoDataLink::OnChange;
30 mDebug() << "Value " << content << "set in kml file is invalid."
31 << "Value of <refreshMode> has been reset to onChange" ;
32 }
33 parentItem.nodeAs<GeoDataLink>()->setRefreshMode( mode );
34 }
35
36 return nullptr;
37}
38
39}
40}
41
Binds a QML item to a specific geodetic location in screen coordinates.
QString trimmed() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Jun 21 2024 12:00:07 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.