summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSanjiban Bairagya <sanjiban22393@gmail.com>2016-09-24 19:34:57 (GMT)
committerSanjiban Bairagya <sanjiban22393@gmail.com>2016-09-24 19:34:57 (GMT)
commit37fc703d310866985014b6d88c4af0c8817432f1 (patch)
tree0b94ae735fe332779587fdb52a23df85e04cc509
parent1368ec36ded88665dc113d619698bcb7a68e8547 (diff)
Revert "Kml_scaleTagHandler{.cpp, .h} -> KmlScaleTagHandler{.cpp, .h}"
This reverts commit 1368ec36ded88665dc113d619698bcb7a68e8547.
-rw-r--r--src/lib/marble/geodata/CMakeLists.txt2
-rw-r--r--src/lib/marble/geodata/handlers/kml/KmlScaleTagHandler.cpp63
-rw-r--r--src/lib/marble/geodata/handlers/kml/KmlScaleTagHandler.h47
-rw-r--r--src/lib/marble/geodata/handlers/kml/Kml_scaleTagHandler.cpp58
-rw-r--r--src/lib/marble/geodata/handlers/kml/Kml_scaleTagHandler.h48
5 files changed, 146 insertions, 72 deletions
diff --git a/src/lib/marble/geodata/CMakeLists.txt b/src/lib/marble/geodata/CMakeLists.txt
index bdb9fd9..e21f3b1 100644
--- a/src/lib/marble/geodata/CMakeLists.txt
+++ b/src/lib/marble/geodata/CMakeLists.txt
@@ -326,7 +326,7 @@ geodata/handlers/kml/KmlRoleTagHandler.cpp
geodata/handlers/kml/KmlRollTagHandler.cpp
geodata/handlers/kml/KmlRotationTagHandler.cpp
geodata/handlers/kml/KmlRotationXYTagHandler.cpp
-geodata/handlers/kml/KmlScaleTagHandler.cpp
+geodata/handlers/kml/Kml_scaleTagHandler.cpp
geodata/handlers/kml/KmlSchemaDataTagHandler.cpp
geodata/handlers/kml/KmlSchemaTagHandler.cpp
geodata/handlers/kml/KmlScreenOverlayTagHandler.cpp
diff --git a/src/lib/marble/geodata/handlers/kml/KmlScaleTagHandler.cpp b/src/lib/marble/geodata/handlers/kml/KmlScaleTagHandler.cpp
index 9ac36d9..cc31168 100644
--- a/src/lib/marble/geodata/handlers/kml/KmlScaleTagHandler.cpp
+++ b/src/lib/marble/geodata/handlers/kml/KmlScaleTagHandler.cpp
@@ -1,57 +1,44 @@
-/*
- Copyright (C) 2008 Patrick Spendrin <ps_ml@gmx.de>
-
- This file is part of the KDE project
-
- This library is free software you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public License
- aint with this library see the file COPYING.LIB. If not, write to
- the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-// be aware that there is another Tag called Scale which uses the name KmlscaleTagHandler.h
-// as it is impossible to use the name KmlscaleTagHandler then, use an underscore
-// to mark the lower case variant
+//
+// This file is part of the Marble Virtual Globe.
+//
+// This program is free software licensed under the GNU LGPL. You can
+// find a copy of this license in LICENSE.txt in the top directory of
+// the source code.
+//
+// Copyright 2013 Mayank Madan <maddiemadan@gmail.com>
+//
#include "KmlScaleTagHandler.h"
#include "MarbleDebug.h"
#include "KmlElementDictionary.h"
-#include "GeoDataIconStyle.h"
-#include "GeoDataLabelStyle.h"
-#include "GeoParser.h"
+#include "KmlObjectTagHandler.h"
+#include "GeoDataScale.h"
+#include "GeoDataGeometry.h"
+#include "GeoDataModel.h"
+#include "GeoDataParser.h"
namespace Marble
{
namespace kml
{
-KML_DEFINE_TAG_HANDLER( scale )
+KML_DEFINE_TAG_HANDLER( Scale )
-GeoNode* KmlscaleTagHandler::parse( GeoParser& parser ) const
+GeoNode* KmlScaleTagHandler::parse( GeoParser& parser ) const
{
- Q_ASSERT(parser.isStartElement() && parser.isValidElement(QLatin1String(kmlTag_scale)));
+ Q_ASSERT(parser.isStartElement() && parser.isValidElement(QLatin1String(kmlTag_Scale)));
+ GeoDataScale scale;
+ KmlObjectTagHandler::parseIdentifiers( parser, &scale );
GeoStackItem parentItem = parser.parentElement();
-
- if ( parentItem.represents( kmlTag_IconStyle ) ) {
- parentItem.nodeAs<GeoDataIconStyle>()->setScale(
- parser.readElementText().trimmed().toFloat() );
- } else if( parentItem.represents( kmlTag_LabelStyle ) ) {
- parentItem.nodeAs<GeoDataLabelStyle>()->setScale(
- parser.readElementText().trimmed().toFloat() );
+
+ if( parentItem.represents( kmlTag_Model ) ) {
+ parentItem.nodeAs<GeoDataModel>()->setScale(scale);
+ return &parentItem.nodeAs<GeoDataModel>()->scale();
+ } else {
+ return 0;
}
- return 0;
}
}
diff --git a/src/lib/marble/geodata/handlers/kml/KmlScaleTagHandler.h b/src/lib/marble/geodata/handlers/kml/KmlScaleTagHandler.h
index 031bf44..a4f37b5 100644
--- a/src/lib/marble/geodata/handlers/kml/KmlScaleTagHandler.h
+++ b/src/lib/marble/geodata/handlers/kml/KmlScaleTagHandler.h
@@ -1,33 +1,15 @@
-/*
- Copyright (C) 2008 Patrick Spendrin <ps_ml@gmx.de>
-
- This file is part of the KDE project
-
- This library is free software you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public License
- aint with this library see the file COPYING.LIB. If not, write to
- the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#ifndef MARBLE_KML_KMLsCALETAGHANDLER_H
-#define MARBLE_KML_KMLsCALETAGHANDLER_H
-
-// be aware that there is another Tag called Scale which uses the name KmlscaleTagHandler.h
-// as it is impossible to use the name KmlscaleTagHandler then, use an underscore
-// to mark the lower case variant
-// FIXME: is this really the case nowadays?
-// There does not seem to be a KmlscaleTagHandler.h, nor seems kmlTag_Scale to be used anymore.
-// As a reminder let's keep the small 's' for now.
+//
+// This file is part of the Marble Virtual Globe.
+//
+// This program is free software licensed under the GNU LGPL. You can
+// find a copy of this license in LICENSE.txt in the top directory of
+// the source code.
+//
+// Copyright 2013 Mayank Madan <maddiemadan@gmail.com>
+//
+
+#ifndef KMLSCALETAGHANDLER_H
+#define KMLSCALETAGHANDLER_H
#include "GeoTagHandler.h"
@@ -36,7 +18,7 @@ namespace Marble
namespace kml
{
-class KmlscaleTagHandler : public GeoTagHandler
+class KmlScaleTagHandler : public GeoTagHandler
{
public:
virtual GeoNode* parse(GeoParser&) const;
@@ -44,5 +26,4 @@ public:
}
}
-
-#endif
+#endif // KMLSCALETAGHANDLER_H
diff --git a/src/lib/marble/geodata/handlers/kml/Kml_scaleTagHandler.cpp b/src/lib/marble/geodata/handlers/kml/Kml_scaleTagHandler.cpp
new file mode 100644
index 0000000..b05344c
--- /dev/null
+++ b/src/lib/marble/geodata/handlers/kml/Kml_scaleTagHandler.cpp
@@ -0,0 +1,58 @@
+/*
+ Copyright (C) 2008 Patrick Spendrin <ps_ml@gmx.de>
+
+ This file is part of the KDE project
+
+ This library is free software you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ aint with this library see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+// be aware that there is another Tag called Scale which uses the name KmlscaleTagHandler.h
+// as it is impossible to use the name KmlscaleTagHandler then, use an underscore
+// to mark the lower case variant
+
+#include "Kml_scaleTagHandler.h"
+
+#include "MarbleDebug.h"
+
+#include "KmlElementDictionary.h"
+#include "GeoDataIconStyle.h"
+#include "GeoDataLabelStyle.h"
+#include "GeoParser.h"
+
+namespace Marble
+{
+namespace kml
+{
+KML_DEFINE_TAG_HANDLER( scale )
+
+GeoNode* KmlscaleTagHandler::parse( GeoParser& parser ) const
+{
+ Q_ASSERT(parser.isStartElement() && parser.isValidElement(QLatin1String(kmlTag_scale)));
+
+ GeoStackItem parentItem = parser.parentElement();
+
+ if ( parentItem.represents( kmlTag_IconStyle ) ) {
+ parentItem.nodeAs<GeoDataIconStyle>()->setScale(
+ parser.readElementText().trimmed().toFloat() );
+ } else if( parentItem.represents( kmlTag_LabelStyle ) ) {
+ parentItem.nodeAs<GeoDataLabelStyle>()->setScale(
+ parser.readElementText().trimmed().toFloat() );
+ }
+ return 0;
+}
+
+}
+}
diff --git a/src/lib/marble/geodata/handlers/kml/Kml_scaleTagHandler.h b/src/lib/marble/geodata/handlers/kml/Kml_scaleTagHandler.h
new file mode 100644
index 0000000..031bf44
--- /dev/null
+++ b/src/lib/marble/geodata/handlers/kml/Kml_scaleTagHandler.h
@@ -0,0 +1,48 @@
+/*
+ Copyright (C) 2008 Patrick Spendrin <ps_ml@gmx.de>
+
+ This file is part of the KDE project
+
+ This library is free software you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ aint with this library see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#ifndef MARBLE_KML_KMLsCALETAGHANDLER_H
+#define MARBLE_KML_KMLsCALETAGHANDLER_H
+
+// be aware that there is another Tag called Scale which uses the name KmlscaleTagHandler.h
+// as it is impossible to use the name KmlscaleTagHandler then, use an underscore
+// to mark the lower case variant
+// FIXME: is this really the case nowadays?
+// There does not seem to be a KmlscaleTagHandler.h, nor seems kmlTag_Scale to be used anymore.
+// As a reminder let's keep the small 's' for now.
+
+#include "GeoTagHandler.h"
+
+namespace Marble
+{
+namespace kml
+{
+
+class KmlscaleTagHandler : public GeoTagHandler
+{
+public:
+ virtual GeoNode* parse(GeoParser&) const;
+};
+
+}
+}
+
+#endif