Marble
7 #include "DgmlDownloadPolicyTagHandler.h"
9 #include "DgmlAttributeDictionary.h"
10 #include "DgmlElementDictionary.h"
11 #include "GeoParser.h"
12 #include "GeoSceneTileDataset.h"
14 #include "MarbleGlobal.h"
15 #include "MarbleDebug.h"
21 static GeoTagHandlerRegistrar handler( GeoParser::QualifiedName( dgmlTag_DownloadPolicy,
22 dgmlTag_nameSpace20 ),
23 new DgmlDownloadPolicyTagHandler );
29 GeoNode* DgmlDownloadPolicyTagHandler::parse( GeoParser& parser )
const
32 Q_ASSERT(parser.isStartElement() && parser.isValidElement(
QLatin1String(dgmlTag_DownloadPolicy)));
35 GeoStackItem parentItem = parser.parentElement();
36 if ( !parentItem.represents( dgmlTag_Texture ) && !parentItem.represents( dgmlTag_Vectortile ) ) {
37 qCritical(
"Parse error: parent element is not 'texture' or 'vectortile'" );
43 const QString usageStr = parser.attribute( dgmlAttr_usage ).
trimmed();
49 qCritical(
"Parse error: invalid attribute downloadPolicy/@usage" );
54 const QString maximumConnectionsStr = parser.attribute( dgmlAttr_maximumConnections ).
trimmed();
56 const int maximumConnections = maximumConnectionsStr.
toInt( &ok );
58 qCritical(
"Parse error: invalid attribute downloadPolicy/@maximumConnections" );
62 parentItem.nodeAs<GeoSceneTileDataset>()->addDownloadPolicy( usage, maximumConnections );
@ DownloadBrowse
Browsing mode, normal operation of Marble, like a web browser.
DownloadUsage
This enum is used to describe the type of download.
QString trimmed() const const
int toInt(bool *ok, int base) const const
Binds a QML item to a specific geodetic location in screen coordinates.
@ DownloadBulk
Bulk download, for example "File/Download region".
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Oct 2 2023 03:52:07 by
doxygen 1.8.17 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.