Created stub StationSchedule class
[quandoparte] / application / view.cpp
index ace9d43..bfa8e74 100644 (file)
@@ -20,14 +20,15 @@ Boston, MA 02110-1301, USA.
 */
 
 #include "view.h"
+#include "settings.h"
+#include "dataprovider.h"
 #include "stationlistmodel.h"
 #include "stationlistproxymodel.h"
 
-#include <QDeclarativeContext>
-#include <QDeclarativeView>
 #include <QDebug>
 #include <QDir>
 #include <QFile>
+#include <QtDeclarative>
 
 // search Paths seem to be broken in Harmattan?
 
@@ -61,9 +62,17 @@ View::View(QWidget *parent) :
     stationListModel->load(trueFilePath("stations:stations.qpl"));
 
     stationListProxyModel->setSourceModel(stationListModel);
-    stationListProxyModel->setFilterCaseSensitivity(Qt::CaseInsensitive);
+
+    /* Types to be made accessible to QML */
+    qmlRegisterType<DataProvider>("net.cirulla.quandoparte", 1, 0, "DataProvider");
+    qmlRegisterType<Settings>("net.cirulla.quandoparte", 1, 0, "Settings");
+    qmlRegisterType<StationListProxyModel>(
+                "net.cirulla.quandoparte", 1, 0, "StationListProxyModel");
 
     QDeclarativeContext *context = this->rootContext();
+    /* objects to be made accessible to QML */
+    context->setContextProperty("settings", Settings::instance());
+    context->setContextProperty("stationList", stationListModel);
     context->setContextProperty("stationListProxyModel", stationListProxyModel);
 
     // This does not seem ot work in harmattan. As a workaround, change dir to