Bump version to 0.9.0
[quandoparte] / application / view.cpp
index 61c9171..ea49a56 100644 (file)
@@ -1,6 +1,6 @@
 /*
 
-Copyright (C) 2011 Luciano Montanaro <mikelima@cirulla.net>
+Copyright (C) 2011, 2013 Luciano Montanaro <mikelima@cirulla.net>
 
 This program is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
@@ -22,16 +22,18 @@ Boston, MA 02110-1301, USA.
 #include "view.h"
 #include "settings.h"
 #include "dataprovider.h"
-#include "stationlistmodel.h"
-#include "stationlistproxymodel.h"
+#include "stationitem.h"
+#include "stationscheduleitem.h"
 #include "stationschedulemodel.h"
+#include "stationlistproxymodel.h"
+#include "stationlistmodel.h"
 
 #include <QtGlobal>
+#include <QtConcurrentRun>
 #include <QDebug>
 #include <QDir>
 #include <QFile>
 #include <QModelIndex>
-#include <QtConcurrent/QtConcurrentRun>
 #if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
 #include <QtQuick/QtQuick>
 #else
@@ -65,6 +67,11 @@ static QString trueFilePath(const QString &path)
 #endif
 }
 
+Q_DECLARE_METATYPE(QList< QPersistentModelIndex >)
+#if (QT_VERSION >= QT_VERSION_CHECK(5, 1, 0))
+Q_DECLARE_METATYPE(QAbstractItemModel::LayoutChangeHint)
+#endif
+
 #if (QT_VERSION >= QT_VERSION_CHECK(5, 1, 0))
 View::View(QWindow *parent) :
     QQuickView(parent),
@@ -82,11 +89,18 @@ View::View(QWidget *parent) :
     stationListProxyModel->setSourceModel(stationListModel);
 
     /* Types to be made accessible to QML */
-    qRegisterMetaType<QModelIndex>("QModelIndex");
-    qmlRegisterType<Settings>("net.cirulla.quandoparte", 1, 0, "Settings");
-    qmlRegisterType<StationListProxyModel>(
+#if (QT_VERSION >= QT_VERSION_CHECK(5, 1, 0))
+    qRegisterMetaType<QGeoCoordinate>("QGeoCoordinate");
+    qRegisterMetaType<QGeoPositionInfo>("QGeoPositionInfo");
+    qRegisterMetaType< QModelIndex >("QModelIndex");
+    qRegisterMetaType< QList< QPersistentModelIndex > >();
+    qRegisterMetaType< QAbstractItemModel::LayoutChangeHint>();
+#endif
+    qmlRegisterType< StationListModel >(
+                "net.cirulla.quandoparte", 1, 0, "StationListModel");
+    qmlRegisterType< StationListProxyModel >(
                 "net.cirulla.quandoparte", 1, 0, "StationListProxyModel");
-    qmlRegisterType<StationScheduleModel>(
+    qmlRegisterType< StationScheduleModel >(
                 "net.cirulla.quandoparte", 1, 0, "StationScheduleModel");
 
 #if (QT_VERSION >= QT_VERSION_CHECK(5, 1, 0))