X-Git-Url: https://www.flypig.org.uk/git/?p=harbour-pedalo.git;a=blobdiff_plain;f=src%2Fharbour-pedalo.cpp;h=729edae2592b4825ca93f4bfefa4f45454b85e26;hp=6c0094d36c6264e2f33f52bc5733d0b4653aa114;hb=41ee443df2b12e7a4373be580006f57cc5fd768a;hpb=5fc520bad80dccf9bf2e0f16552c9f2605417067 diff --git a/src/harbour-pedalo.cpp b/src/harbour-pedalo.cpp index 6c0094d..729edae 100644 --- a/src/harbour-pedalo.cpp +++ b/src/harbour-pedalo.cpp @@ -10,6 +10,7 @@ #include "status.h" #include "settings.h" #include "imageprovider.h" +#include "graph.h" #include "harbour-pedalo.h" @@ -34,6 +35,8 @@ int main(int argc, char *argv[]) Settings::instantiate(); qmlRegisterSingletonType("harbour.pedalo.settings", 1, 0, "Settings", Settings::provider); + qmlRegisterType("harbour.pedalo.journeymodel", 1, 0, "JourneyModel"); + qmlRegisterType("harbour.pedalo.graph", 1, 0, "Graph"); JourneyModel journeys; Status currentStatus(journeys); @@ -43,6 +46,7 @@ int main(int argc, char *argv[]) QFile file; file.setFileName(Settings::getConfigDir() + "/journeys.csv"); journeys.importFromFile(file); + journeys.sort(JourneyModel::StartRole, Qt::DescendingOrder); QScopedPointer view(SailfishApp::createView()); view->engine()->addImageProvider(QLatin1String("pedalo"), new ImageProvider(Settings::getInstance())); @@ -54,6 +58,7 @@ int main(int argc, char *argv[]) qDebug() << "VERSION_MAJOR: " << VERSION_MAJOR; qDebug() << "VERSION_MINOR: " << VERSION_MINOR; qDebug() << "VERSION_BUILD: " << VERSION_BUILD; + ctxt->setContextProperty("journeymodel", &journeys); ctxt->setContextProperty("currentStatus", ¤tStatus);