summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernhard Beschow <bbeschow@cs.tu-berlin.de>2016-08-14 11:56:33 (GMT)
committerBernhard Beschow <bbeschow@cs.tu-berlin.de>2016-08-14 12:16:33 (GMT)
commitdaf5d5405c4f944c0f64fd1d1eb8c2e9be3842e7 (patch)
treeed0e871cae276ed89fde3829e8d6cf2682d47431
parent2f6f22988b14810b25973e4be57de5f930bef8c9 (diff)
remove convenience method that was used only once
-rw-r--r--src/lib/marble/osm/OsmPresetLibrary.cpp12
-rw-r--r--src/lib/marble/osm/OsmPresetLibrary.h6
-rw-r--r--src/lib/marble/osm/OsmTagEditorWidget_p.cpp6
3 files changed, 5 insertions, 19 deletions
diff --git a/src/lib/marble/osm/OsmPresetLibrary.cpp b/src/lib/marble/osm/OsmPresetLibrary.cpp
index 0854231..6bf5ab1 100644
--- a/src/lib/marble/osm/OsmPresetLibrary.cpp
+++ b/src/lib/marble/osm/OsmPresetLibrary.cpp
@@ -15,9 +15,6 @@
#include "GeoDataPlacemark.h"
#include "GeoDataStyle.h"
#include "OsmPlacemarkData.h"
-#include "StyleBuilder.h"
-
-#include <QMap>
namespace Marble
{
@@ -475,15 +472,6 @@ void OsmPresetLibrary::initializeAdditionalOsmTags()
s_additionalOsmTags << OsmTag( "access", "permissive" );
}
-GeoDataStyle::ConstPtr OsmPresetLibrary::presetStyle( const OsmTag &tag )
-{
- static const StyleBuilder styleBuilder;
-
- const GeoDataFeature::GeoDataVisualCategory category = osmVisualCategory(tag);
-
- return styleBuilder.presetStyle(category);
-}
-
GeoDataFeature::GeoDataVisualCategory OsmPresetLibrary::osmVisualCategory(const OsmTag &tag)
{
initializeOsmVisualCategories();
diff --git a/src/lib/marble/osm/OsmPresetLibrary.h b/src/lib/marble/osm/OsmPresetLibrary.h
index 9304949..e1e36a1 100644
--- a/src/lib/marble/osm/OsmPresetLibrary.h
+++ b/src/lib/marble/osm/OsmPresetLibrary.h
@@ -15,7 +15,6 @@
#include <QPair>
#include "GeoDataFeature.h"
-#include <GeoDataStyle.h>
#include "marble_export.h"
namespace Marble
@@ -33,11 +32,6 @@ public:
typedef QPair<QString, QString> OsmTag;
/**
- * @brief corespondingIcon returns the icon that is associated with a visual category
- */
- static GeoDataStyle::ConstPtr presetStyle( const OsmTag &tag );
-
- /**
* @brief Convenience categorization of placemarks for Osm key=value pairs
*/
static GeoDataFeature::GeoDataVisualCategory osmVisualCategory(const OsmTag &tag);
diff --git a/src/lib/marble/osm/OsmTagEditorWidget_p.cpp b/src/lib/marble/osm/OsmTagEditorWidget_p.cpp
index 247efe9..873fd48 100644
--- a/src/lib/marble/osm/OsmTagEditorWidget_p.cpp
+++ b/src/lib/marble/osm/OsmTagEditorWidget_p.cpp
@@ -19,6 +19,7 @@
#include "OsmPlacemarkData.h"
#include "GeoDataExtendedData.h"
#include "GeoDataData.h"
+#include "StyleBuilder.h"
// Qt
#include <QTreeWidget>
@@ -96,6 +97,8 @@ void OsmTagEditorWidgetPrivate::populatePresetTagsList()
QTreeWidgetItem *OsmTagEditorWidgetPrivate::tagWidgetItem( const OsmTag &tag ) const
{
+ static const StyleBuilder styleBuilder;
+
QStringList itemText;
itemText << tag.first;
@@ -104,7 +107,8 @@ QTreeWidgetItem *OsmTagEditorWidgetPrivate::tagWidgetItem( const OsmTag &tag ) c
QTreeWidgetItem *tagItem = new QTreeWidgetItem( itemText );
// Getting the icon preset for the tag ( if there's one available )
- GeoDataStyle::ConstPtr style = OsmPresetLibrary::presetStyle( tag );
+ const GeoDataFeature::GeoDataVisualCategory category = OsmPresetLibrary::osmVisualCategory(tag);
+ GeoDataStyle::ConstPtr style = styleBuilder.presetStyle(category);
QPixmap iconPixmap = QPixmap::fromImage( style->iconStyle().icon() );
tagItem->setIcon( 1, QIcon( iconPixmap ) );