Commit 47bf18b9 authored by Bernhard Beschow's avatar Bernhard Beschow

OsmPresetLibrary::visualCategories() was only used in StyleBuilder, so move it there

parent 7e431b30
......@@ -904,7 +904,7 @@ GeoDataStyle::ConstPtr StyleBuilder::createStyle(const StyleParameters &paramete
}
QList<GeoDataFeature::GeoDataVisualCategory> categories = OsmPresetLibrary::visualCategories(osmData);
QList<GeoDataFeature::GeoDataVisualCategory> categories = visualCategories(osmData);
foreach(GeoDataFeature::GeoDataVisualCategory category, categories) {
const GeoDataStyle::ConstPtr categoryStyle = GeoDataFeature::presetStyle(category);
if (!categoryStyle->iconStyle().iconPath().isEmpty()) {
......@@ -1443,4 +1443,17 @@ 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;
}
}
......@@ -16,8 +16,10 @@
#include <QColor>
#include <QFont>
#include <QList>
namespace Marble {
class OsmPlacemarkData;
class StyleParameters
{
......@@ -72,6 +74,8 @@ public:
private:
Q_DISABLE_COPY(StyleBuilder)
static QList<GeoDataFeature::GeoDataVisualCategory> visualCategories(const OsmPlacemarkData &osmData);
class Private;
Private * const d;
};
......
......@@ -655,17 +655,4 @@ GeoDataFeature::GeoDataVisualCategory OsmPresetLibrary::determineVisualCategory(
return GeoDataFeature::None;
}
QList<GeoDataFeature::GeoDataVisualCategory> OsmPresetLibrary::visualCategories(const OsmPlacemarkData &osmData)
{
QList<GeoDataFeature::GeoDataVisualCategory> categories;
for (auto iter = osmData.tagsBegin(), end=osmData.tagsEnd(); iter != end; ++iter) {
QString const keyValue = QString("%1=%2").arg(iter.key()).arg(iter.value());
GeoDataFeature::GeoDataVisualCategory category = osmVisualCategory(keyValue);
if (category != GeoDataFeature::None) {
categories << category;
}
}
return categories;
}
}
......@@ -69,8 +69,6 @@ public:
static GeoDataFeature::GeoDataVisualCategory determineVisualCategory(const OsmPlacemarkData &osmData);
static QList<GeoDataFeature::GeoDataVisualCategory> visualCategories(const OsmPlacemarkData &osmData);
private:
static void initializeOsmVisualCategories();
static void initializeAdditionalOsmTags();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment