#include <QFileInfo>
#include <QDebug>
#include <QStandardItem>
-#ifndef TARGET_PLATFORM_SAILFISH
-#include <QGeoCoordinate>
-#endif
+#include <QtLocation/QGeoCoordinate>
-#ifndef TARGET_PLATFORM_SAILFISH
+#if (QT_VERSION < QT_VERSION_CHECK(5, 0, 0))
QTM_USE_NAMESPACE
Q_DECLARE_METATYPE(QGeoCoordinate)
#endif
QStandardItemModel(parent)
{
setRowCount(0);
-#ifndef TARGET_PLATFORM_SAILFISH
+#if (QT_VERSION < QT_VERSION_CHECK(5, 0, 0))
QHash<int, QByteArray> roles;
#endif
roles[Qt::DisplayRole] = "name";
roles[StationListModel::PositionRole] = "position";
roles[StationListModel::StationCodeRole] = "code";
-#ifndef TARGET_PLATFORM_SAILFISH
+#if (QT_VERSION < QT_VERSION_CHECK(5, 0, 0))
setRoleNames(roles);
#endif
}
void StationListModel::readPosElement(QStandardItem *item)
{
QStringList coordinates = m_reader.readElementText().split(",");
-#ifndef TARGET_PLATFORM_SAILFISH
QGeoCoordinate pos = QGeoCoordinate(coordinates[0].toDouble(), coordinates[1].toDouble());
item->setData(QVariant::fromValue(pos), PositionRole);
-#endif
m_reader.readElementText();
if (m_reader.isEndElement()) {
m_reader.readNext();