summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFriedrich W. H. Kossebau <kossebau@kde.org>2016-08-25 14:42:07 (GMT)
committerFriedrich W. H. Kossebau <kossebau@kde.org>2016-08-25 14:42:07 (GMT)
commit2192d61c101bee9da808005398bc9f7fd1f2e38c (patch)
tree845824abb65dc971dfa29e2325fa4dcbf7d2e766
parent676288ab8749a2966eb3d487ec76ce58ff8b6f2d (diff)
Use QHash, not QMap, for quicker access to OSM visual categories by tag
-rw-r--r--src/lib/marble/osm/OsmPresetLibrary.cpp6
-rw-r--r--src/lib/marble/osm/OsmPresetLibrary.h8
-rw-r--r--src/lib/marble/osm/OsmTagEditorWidget_p.cpp4
3 files changed, 9 insertions, 9 deletions
diff --git a/src/lib/marble/osm/OsmPresetLibrary.cpp b/src/lib/marble/osm/OsmPresetLibrary.cpp
index 2887123..6d7031c 100644
--- a/src/lib/marble/osm/OsmPresetLibrary.cpp
+++ b/src/lib/marble/osm/OsmPresetLibrary.cpp
@@ -19,7 +19,7 @@
namespace Marble
{
-QMap<OsmPresetLibrary::OsmTag, GeoDataFeature::GeoDataVisualCategory> OsmPresetLibrary::s_visualCategories;
+QHash<OsmPresetLibrary::OsmTag, GeoDataFeature::GeoDataVisualCategory> OsmPresetLibrary::s_visualCategories;
void OsmPresetLibrary::initializeOsmVisualCategories()
{
@@ -345,13 +345,13 @@ GeoDataFeature::GeoDataVisualCategory OsmPresetLibrary::osmVisualCategory(const
return s_visualCategories.value(tag, GeoDataFeature::None);
}
-QMap<OsmPresetLibrary::OsmTag, GeoDataFeature::GeoDataVisualCategory>::const_iterator OsmPresetLibrary::begin()
+QHash<OsmPresetLibrary::OsmTag, GeoDataFeature::GeoDataVisualCategory>::const_iterator OsmPresetLibrary::begin()
{
initializeOsmVisualCategories();
return s_visualCategories.constBegin();
}
-QMap<OsmPresetLibrary::OsmTag, GeoDataFeature::GeoDataVisualCategory>::const_iterator OsmPresetLibrary::end()
+QHash<OsmPresetLibrary::OsmTag, GeoDataFeature::GeoDataVisualCategory>::const_iterator OsmPresetLibrary::end()
{
initializeOsmVisualCategories();
return s_visualCategories.constEnd();
diff --git a/src/lib/marble/osm/OsmPresetLibrary.h b/src/lib/marble/osm/OsmPresetLibrary.h
index 01f775e..42d56b3 100644
--- a/src/lib/marble/osm/OsmPresetLibrary.h
+++ b/src/lib/marble/osm/OsmPresetLibrary.h
@@ -11,7 +11,7 @@
#ifndef MARBLE_OSMPRESETLIBRARY_H
#define MARBLE_OSMPRESETLIBRARY_H
-#include <QMap>
+#include <QHash>
#include <QPair>
#include "GeoDataFeature.h"
@@ -39,8 +39,8 @@ public:
/**
* @brief begin and end provide an stl style iterator for the preset map
*/
- static QMap<OsmTag, GeoDataFeature::GeoDataVisualCategory>::const_iterator begin();
- static QMap<OsmTag, GeoDataFeature::GeoDataVisualCategory>::const_iterator end();
+ static QHash<OsmTag, GeoDataFeature::GeoDataVisualCategory>::const_iterator begin();
+ static QHash<OsmTag, GeoDataFeature::GeoDataVisualCategory>::const_iterator end();
static QStringList shopValues();
static QStringList buildingValues();
@@ -53,7 +53,7 @@ private:
/**
* @brief s_visualCategories contains osm tag mappings to GeoDataVisualCategories
*/
- static QMap<OsmTag, GeoDataFeature::GeoDataVisualCategory> s_visualCategories;
+ static QHash<OsmTag, GeoDataFeature::GeoDataVisualCategory> s_visualCategories;
};
diff --git a/src/lib/marble/osm/OsmTagEditorWidget_p.cpp b/src/lib/marble/osm/OsmTagEditorWidget_p.cpp
index ebb3ed2..5d1cd25 100644
--- a/src/lib/marble/osm/OsmTagEditorWidget_p.cpp
+++ b/src/lib/marble/osm/OsmTagEditorWidget_p.cpp
@@ -123,8 +123,8 @@ QList<OsmTagEditorWidgetPrivate::OsmTag> OsmTagEditorWidgetPrivate::recommendedT
QStringList filter = generateTagFilter();
- QMap<OsmTag, GeoDataFeature::GeoDataVisualCategory>::const_iterator it = OsmPresetLibrary::begin();
- QMap<OsmTag, GeoDataFeature::GeoDataVisualCategory>::const_iterator end = OsmPresetLibrary::end();
+ QHash<OsmTag, GeoDataFeature::GeoDataVisualCategory>::const_iterator it = OsmPresetLibrary::begin();
+ QHash<OsmTag, GeoDataFeature::GeoDataVisualCategory>::const_iterator end = OsmPresetLibrary::end();
for ( ; it != end; ++it ) {
if ( filter.contains( it.key().first ) ) {