summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFriedrich W. H. Kossebau <kossebau@kde.org>2016-09-06 04:12:34 (GMT)
committerFriedrich W. H. Kossebau <kossebau@kde.org>2016-09-06 04:12:34 (GMT)
commit5a45888ad8a1629eed92f459b729ab731ff32f0a (patch)
tree2e6341b615f63001d847ec788965a7da195594e3
parentae0bc841c02e9fce7fb00e587eef38bc9edc5433 (diff)
Use const ref instead of deep copies of OsmPlacemarkData
-rw-r--r--src/lib/marble/MarbleWidgetPopupMenu.cpp4
-rw-r--r--src/lib/marble/declarative/Placemark.cpp6
-rw-r--r--src/lib/marble/osm/OsmTagEditorWidget_p.cpp2
3 files changed, 6 insertions, 6 deletions
diff --git a/src/lib/marble/MarbleWidgetPopupMenu.cpp b/src/lib/marble/MarbleWidgetPopupMenu.cpp
index 4e2bd9e..7a785b0 100644
--- a/src/lib/marble/MarbleWidgetPopupMenu.cpp
+++ b/src/lib/marble/MarbleWidgetPopupMenu.cpp
@@ -189,7 +189,7 @@ void MarbleWidgetPopupMenu::Private::setupDialogOsm( PopupLayer *popup, const Ge
}
QString description = descriptionFile.readAll();
- OsmPlacemarkData data = placemark->osmData();
+ const OsmPlacemarkData& data = placemark->osmData();
if (!data.containsTagKey("addr:street") && !data.containsTagKey("addr:housenumber")){
description.replace(QStringLiteral("<br> %postcode%"), QStringLiteral("%postcode%"));
}
@@ -646,7 +646,7 @@ void MarbleWidgetPopupMenu::slotInfoDialog()
bool isCity = false;
bool isNation = false;
- OsmPlacemarkData data = placemark->osmData();
+ const OsmPlacemarkData& data = placemark->osmData();
bool hasOsmData = false;
diff --git a/src/lib/marble/declarative/Placemark.cpp b/src/lib/marble/declarative/Placemark.cpp
index c7f0245..962b78e 100644
--- a/src/lib/marble/declarative/Placemark.cpp
+++ b/src/lib/marble/declarative/Placemark.cpp
@@ -180,7 +180,7 @@ QString Placemark::elevation() const
return m_elevation;
}
- OsmPlacemarkData data = m_placemark.osmData();
+ const OsmPlacemarkData& data = m_placemark.osmData();
if (data.containsTagKey("ele")) {
m_elevation = data.tagValue("ele");
@@ -195,7 +195,7 @@ QString Placemark::amenity() const
return m_amenity;
}
- OsmPlacemarkData data = m_placemark.osmData();
+ const OsmPlacemarkData& data = m_placemark.osmData();
if (data.containsTagKey("amenity") && !data.tagValue("amenity").isEmpty()){
QString amenity = data.tagValue("amenity");
@@ -212,7 +212,7 @@ QString Placemark::shop() const
return m_shop;
}
- OsmPlacemarkData data = m_placemark.osmData();
+ const OsmPlacemarkData& data = m_placemark.osmData();
if (data.containsTagKey("shop") && !data.tagValue("shop").isEmpty()){
QString shop = data.tagValue("shop");
diff --git a/src/lib/marble/osm/OsmTagEditorWidget_p.cpp b/src/lib/marble/osm/OsmTagEditorWidget_p.cpp
index 977a526..ccdf809 100644
--- a/src/lib/marble/osm/OsmTagEditorWidget_p.cpp
+++ b/src/lib/marble/osm/OsmTagEditorWidget_p.cpp
@@ -64,7 +64,7 @@ void OsmTagEditorWidgetPrivate::populateCurrentTagsList()
// Other tags
if( m_placemark->hasOsmData() ) {
- OsmPlacemarkData osmData = m_placemark->osmData();
+ const OsmPlacemarkData& osmData = m_placemark->osmData();
QHash< QString, QString>::const_iterator it = osmData.tagsBegin();
QHash< QString, QString>::const_iterator end = osmData.tagsEnd();
for ( ; it != end; ++it ) {