Commit 28a120d6 authored by Bernhard Beschow's avatar Bernhard Beschow

return a static const default style instance instead of asking a static instance of StyleBuilder

GeoDataFeature::style() isn't used for rendering any more. Instead, the renderer asks the StyleBuilder to return a style.

Since there are many places in the code relying on style() returning a non-null pointer, we can't simply return a null pointer. Therefore, we return a dummy style object as a temporary solution.
parent 6a738660
......@@ -30,11 +30,11 @@
#include "GeoDataPlacemark.h"
#include "GeoDataRegion.h"
#include "GeoDataCamera.h"
#include "StyleBuilder.h"
namespace Marble
StyleBuilder GeoDataFeaturePrivate::s_styleBuilder;
const QSharedPointer<const GeoDataStyle> GeoDataFeaturePrivate::s_defaultStyle(new GeoDataStyle);
: d( new GeoDataFeaturePrivate() )
......@@ -342,7 +342,8 @@ GeoDataStyle::ConstPtr GeoDataFeature::style() const
if (d->m_style) {
return d->m_style;
return d->s_styleBuilder.createStyle(StyleParameters(this));
return GeoDataFeaturePrivate::s_defaultStyle;
GeoDataStyle::ConstPtr GeoDataFeature::customStyle() const
......@@ -155,7 +155,7 @@ class GeoDataFeaturePrivate
QAtomicInt ref;
// Static members
static StyleBuilder s_styleBuilder;
static const QSharedPointer<const GeoDataStyle> s_defaultStyle;
} // namespace Marble
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