File indexing completed on 2024-06-02 03:51:07

0001 // SPDX-License-Identifier: LGPL-2.1-or-later
0002 //
0003 // SPDX-FileCopyrightText: 2013 Mihail Ivchenko <ematirov@gmail.com>
0004 //
0005 
0006 #include "KmlWaitTagHandler.h"
0007 #include "KmlPlaylistTagHandler.h"
0008 
0009 #include "KmlElementDictionary.h"
0010 #include "KmlObjectTagHandler.h"
0011 #include "GeoParser.h"
0012 #include "GeoDataPlaylist.h"
0013 #include "GeoDataWait.h"
0014 
0015 namespace Marble
0016 {
0017 namespace kml
0018 {
0019 KML_DEFINE_TAG_HANDLER_GX22( Wait )
0020 
0021 GeoNode* KmlWaitTagHandler::parse(GeoParser &parser) const
0022 {
0023     Q_ASSERT(parser.isStartElement() && parser.isValidElement(QLatin1String(kmlTag_Wait)));
0024 
0025     GeoStackItem parentItem = parser.parentElement();
0026 
0027     GeoDataWait *wait = new GeoDataWait;
0028     KmlObjectTagHandler::parseIdentifiers( parser, wait );
0029 
0030     if (parentItem.is<GeoDataPlaylist>()) {
0031         parentItem.nodeAs<GeoDataPlaylist>()->addPrimitive(wait);
0032         return wait;
0033     } else {
0034         delete wait;
0035     }
0036 
0037     return nullptr;
0038 }
0039 
0040 } // namespace kml
0041 } // namespace Marble