Created stub StationSchedule class
[quandoparte] / application / view.cpp
index e3959af..bfa8e74 100644 (file)
@@ -21,6 +21,7 @@ Boston, MA 02110-1301, USA.
 
 #include "view.h"
 #include "settings.h"
+#include "dataprovider.h"
 #include "stationlistmodel.h"
 #include "stationlistproxymodel.h"
 
@@ -61,11 +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