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

0001 // SPDX-License-Identifier: LGPL-2.1-or-later
0002 //
0003 // SPDX-FileCopyrightText: 2013 Mohammed Nafees <nafees.technocool@gmail.com>
0004 //
0005 
0006 #include "KmlCookieTagHandler.h"
0007 
0008 #include "KmlElementDictionary.h"
0009 #include "GeoDataNetworkLinkControl.h"
0010 #include "GeoDataParser.h"
0011 
0012 namespace Marble
0013 {
0014 namespace kml
0015 {
0016 KML_DEFINE_TAG_HANDLER( cookie )
0017 
0018 GeoNode* KmlcookieTagHandler::parse( GeoParser& parser ) const
0019 {
0020     Q_ASSERT(parser.isStartElement() && parser.isValidElement(QLatin1String(kmlTag_cookie)));
0021 
0022     GeoStackItem parentItem = parser.parentElement();
0023 
0024     if ( parentItem.represents( kmlTag_NetworkLinkControl ) )
0025     {
0026         QString cookie = parser.readElementText();
0027 
0028         parentItem.nodeAs<GeoDataNetworkLinkControl>()->setCookie( cookie );
0029     }
0030 
0031     return nullptr;
0032 }
0033 
0034 }
0035 }