summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernhard Beschow <[email protected]>2016-07-03 11:40:13 +0200
committerBernhard Beschow <[email protected]>2016-07-03 11:40:57 +0200
commit144ce0215ffd22bd36ae3dd32c1242015e9d22e1 (patch)
tree4564e996be97fc529acd8acc3c444447bf7c0d67
parent4a38ea1544b02a5d68ad28dac6f11b44a81293b7 (diff)
merge visualCategories() into createStyle()
-rw-r--r--src/lib/marble/StyleBuilder.cpp19
-rw-r--r--src/lib/marble/StyleBuilder.h2
2 files changed, 3 insertions, 18 deletions
diff --git a/src/lib/marble/StyleBuilder.cpp b/src/lib/marble/StyleBuilder.cpp
index d0dba7d..2070d3f 100644
--- a/src/lib/marble/StyleBuilder.cpp
+++ b/src/lib/marble/StyleBuilder.cpp
@@ -904,10 +904,10 @@ GeoDataStyle::ConstPtr StyleBuilder::createStyle(const StyleParameters &paramete
style = newStyle;
}
-
if (style->iconStyle().iconPath().isEmpty()) {
- QList<GeoDataFeature::GeoDataVisualCategory> categories = visualCategories(osmData);
- foreach(GeoDataFeature::GeoDataVisualCategory category, categories) {
+ for (auto iter = osmData.tagsBegin(), end = osmData.tagsEnd(); iter != end; ++iter) {
+ const QString keyValue = QString("%1=%2").arg(iter.key()).arg(iter.value());
+ const GeoDataFeature::GeoDataVisualCategory category = OsmPresetLibrary::osmVisualCategory(keyValue);
const GeoDataStyle::ConstPtr categoryStyle = presetStyle(category);
if (!categoryStyle->iconStyle().icon().isNull()) {
GeoDataStyle::Ptr newStyle(new GeoDataStyle(*style));
@@ -1447,17 +1447,4 @@ StyleParameters::StyleParameters(const GeoDataFeature *feature_, int tileLevel_)
// nothing to do
}
-QList<GeoDataFeature::GeoDataVisualCategory> StyleBuilder::visualCategories(const OsmPlacemarkData &osmData)
-{
- QList<GeoDataFeature::GeoDataVisualCategory> categories;
- for (auto iter = osmData.tagsBegin(), end=osmData.tagsEnd(); iter != end; ++iter) {
- const QString keyValue = QString("%1=%2").arg(iter.key()).arg(iter.value());
- GeoDataFeature::GeoDataVisualCategory category = OsmPresetLibrary::osmVisualCategory(keyValue);
- if (category != GeoDataFeature::None) {
- categories << category;
- }
- }
- return categories;
-}
-
}
diff --git a/src/lib/marble/StyleBuilder.h b/src/lib/marble/StyleBuilder.h
index eae4607..3b27321 100644
--- a/src/lib/marble/StyleBuilder.h
+++ b/src/lib/marble/StyleBuilder.h
@@ -74,8 +74,6 @@ public:
private:
Q_DISABLE_COPY(StyleBuilder)
- static QList<GeoDataFeature::GeoDataVisualCategory> visualCategories(const OsmPlacemarkData &osmData);
-
class Private;
Private * const d;
};