Marble

KmlFolderTagHandler.cpp
1/*
2 SPDX-FileCopyrightText: 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7#include "KmlFolderTagHandler.h"
8
9#include "MarbleDebug.h"
10
11#include "KmlElementDictionary.h"
12#include "KmlObjectTagHandler.h"
13#include "GeoDataContainer.h"
14#include "GeoDataFolder.h"
15#include "GeoDataParser.h"
16#include "GeoDataDocument.h"
17
18namespace Marble
19{
20namespace kml
21{
22KML_DEFINE_TAG_HANDLER(Folder)
23
24GeoNode* KmlFolderTagHandler::parse(GeoParser& parser) const
25{
26 Q_ASSERT(parser.isStartElement() && parser.isValidElement(QLatin1String(kmlTag_Folder)));
27
28 GeoStackItem parentItem = parser.parentElement();
29 GeoDataFolder *folder = new GeoDataFolder;
30 KmlObjectTagHandler::parseIdentifiers( parser, folder );
31 if ( parentItem.represents( kmlTag_Folder ) || parentItem.represents( kmlTag_Document ) ) {
32 GeoDataContainer *parentPtr = parentItem.nodeAs<GeoDataContainer>();
33 parentPtr->append( folder );
34
35 return folder;
36 } else if (parentItem.qualifiedName().first == QLatin1String(kmlTag_kml)) {
37 GeoDataDocument* doc = geoDataDoc( parser );
38 doc->append( folder );
39 return folder;
40 } else {
41 delete folder;
42 return nullptr;
43 }
44}
45
46}
47}
Binds a QML item to a specific geodetic location in screen coordinates.
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.