Enable use of StationListModel
authorLuciano Montanaro <mileima@cirulla.net>
Sun, 29 May 2011 13:42:00 +0000 (15:42 +0200)
committerLuciano Montanaro <mileima@cirulla.net>
Sun, 29 May 2011 13:42:00 +0000 (15:42 +0200)
application/app.cpp
application/application.pro
application/stationlistview.cpp
application/stationlistview.h

index c516647..5245591 100644 (file)
@@ -41,6 +41,8 @@ App::App(QObject *parent) :
     stationListModel(new StationListModel(this)),
     stationListView(new StationListView(stationListModel, stationView))
 {
+    stationListModel->load("/opt/usr/share/apps/quandoparte/stations/stations.qpl");
+
     connect(stationListView, SIGNAL(stationSelected(const QString &)),
             SLOT(queryStation(const QString &)));
     connect(stationListView, SIGNAL(aboutTriggered()),
@@ -54,6 +56,7 @@ App::App(QObject *parent) :
             SLOT(setShowingArrivals(bool)));
     readSettings();
 
+    qDebug() << "found" << stationListModel->rowCount() << "stations";
 #if defined(Q_WS_S60)
     stationView->showMaximized();
 #else
index 74432a4..bb05bcf 100644 (file)
@@ -57,6 +57,7 @@ OTHER_FILES += \
     resources/stations/stations.qpl
 
 message($${OTHER_FILES})
+
 unix:!symbian {
     maemo5 {
         target.path = /opt/usr/bin
@@ -97,4 +98,5 @@ unix:!symbian {
     INSTALLS += icon64
     INSTALLS += css
     INSTALLS += i18n
+    INSTALLS += stations
 }
index bacfb5b..c89e0c1 100644 (file)
@@ -35,7 +35,7 @@ StationListView::StationListView(StationListModel *model, QWidget *parent) :
     QMainWindow(parent),
     ui(new Ui::StationListView),
     viewSelectionGroup(new QActionGroup(0)),
-    stationListModel(new QStringListModel(this)),
+    stationListModel(model),
     filterModel(new QSortFilterProxyModel(this)),
     keyPressForwarder(new KeyPressForwarder(this))
 
index c5012c0..308a277 100644 (file)
@@ -36,7 +36,7 @@ private slots:
 private:
     Ui::StationListView *ui;
     QActionGroup *viewSelectionGroup;
-    QStringListModel *stationListModel;
+    StationListModel *stationListModel;
     QSortFilterProxyModel *filterModel;
     KeyPressForwarder *keyPressForwarder;
 };