~ubuntu-branches/ubuntu/wily/marble/wily-proposed

« back to all changes in this revision

Viewing changes to src/lib/marble/geodata/handlers/kml/KmlChangeTagHandler.cpp

  • Committer: Package Import Robot
  • Author(s): Scarlett Clark, Jonathan Riddell, Scarlett Clark
  • Date: 2014-07-24 23:38:32 UTC
  • mfrom: (1.5.2)
  • Revision ID: package-import@ubuntu.com-20140724233832-7v4421t4khrhw487
Tags: 4:4.13.90-0ubuntu1
[ Jonathan Riddell ]
* Switch to libmarblewidget19 for new soversion

[ Scarlett Clark ]
* New upstream beta release
* Update: do_not_install_private_headers. 

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
//
 
2
// This file is part of the Marble Virtual Globe.
 
3
//
 
4
// This program is free software licensed under the GNU LGPL. You can
 
5
// find a copy of this license in LICENSE.txt in the top directory of
 
6
// the source code.
 
7
//
 
8
// Copyright 2014      Sanjiban Bairagya <sanjiban22393@gmail.com>
 
9
//
 
10
 
 
11
#include "KmlChangeTagHandler.h"
 
12
 
 
13
#include "KmlElementDictionary.h"
 
14
#include "GeoDataUpdate.h"
 
15
#include "GeoDataChange.h"
 
16
#include "GeoDataParser.h"
 
17
#include "KmlObjectTagHandler.h"
 
18
 
 
19
namespace Marble
 
20
{
 
21
namespace kml
 
22
{
 
23
KML_DEFINE_TAG_HANDLER( Change )
 
24
 
 
25
GeoNode* KmlChangeTagHandler::parse( GeoParser& parser ) const
 
26
{
 
27
    Q_ASSERT( parser.isStartElement() && parser.isValidElement( kmlTag_Change ) );
 
28
 
 
29
    GeoDataChange *change = new GeoDataChange;
 
30
    KmlObjectTagHandler::parseIdentifiers( parser, change );
 
31
    GeoStackItem parentItem = parser.parentElement();
 
32
 
 
33
    if ( parentItem.represents( kmlTag_Update ) ) {
 
34
        parentItem.nodeAs<GeoDataUpdate>()->setChange( change );
 
35
        return change;
 
36
    } else {
 
37
        delete change;
 
38
        return 0;
 
39
    }
 
40
}
 
41
 
 
42
}
 
43
}