summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Potashev <[email protected]>2015-09-19 11:43:05 +0300
committerAlexander Potashev <[email protected]>2015-09-19 11:43:05 +0300
commit3e51bd14cfa1b20d0f34b604026ed53b660d2ea5 (patch)
treed7b774e09e54c59232e7dbe8c0f6e069d7546e51
parent8c25ac1576c25f3a9b52e8f342c29d2f4b6023f0 (diff)
libmarbledeclarative: Fix build when Qt5Positioning is not available
Reviewers: nienhueser Reviewed By: nienhueser Differential Revision: https://phabricator.kde.org/D365
-rw-r--r--src/lib/marble/declarative/CMakeLists.txt3
-rw-r--r--src/lib/marble/declarative/Placemark.cpp7
2 files changed, 9 insertions, 1 deletions
diff --git a/src/lib/marble/declarative/CMakeLists.txt b/src/lib/marble/declarative/CMakeLists.txt
index 0475f17..b01854d 100644
--- a/src/lib/marble/declarative/CMakeLists.txt
+++ b/src/lib/marble/declarative/CMakeLists.txt
@@ -1,6 +1,9 @@
PROJECT( MarbleDeclarativePlugin )
macro_optional_find_package(Qt5Positioning)
+if(Qt5Positioning_LIBRARIES)
+ add_definitions(-DHAVE_QT5_POSITIONING)
+endif(Qt5Positioning_LIBRARIES)
INCLUDE_DIRECTORIES(
${CMAKE_CURRENT_SOURCE_DIR}
diff --git a/src/lib/marble/declarative/Placemark.cpp b/src/lib/marble/declarative/Placemark.cpp
index 8a19176..2a2f410 100644
--- a/src/lib/marble/declarative/Placemark.cpp
+++ b/src/lib/marble/declarative/Placemark.cpp
@@ -10,9 +10,10 @@
#include "Placemark.h"
+#ifdef HAVE_QT5_POSITIONING
#include <GeoDataExtendedData.h>
#include <QGeoAddress>
-#include <QLocale>
+#endif // HAVE_QT5_POSITIONING
Placemark::Placemark(QObject *parent ) :
QObject( parent )
@@ -48,6 +49,7 @@ QString Placemark::name() const
QString Placemark::address() const
{
if (m_address.isEmpty()) {
+#ifdef HAVE_QT5_POSITIONING
QGeoAddress address;
Marble::GeoDataExtendedData data = m_placemark.extendedData();
address.setCountry(data.value("country").value().toString());
@@ -86,6 +88,9 @@ QString Placemark::address() const
QString const addressString = address.text().replace("<br/>", ", ");
m_address = addressString.isEmpty() ? m_placemark.address() : addressString;
+#else // HAVE_QT5_POSITIONING
+ m_address = m_placemark.address();
+#endif // HAVE_QT5_POSITIONING
}
return m_address;