X-Git-Url: https://www.flypig.org.uk/git/?p=harbour-pedalo.git;a=blobdiff_plain;f=src%2Fharbour-pedalo.cpp;h=e8f123dd1728db6debfe7ed8eef1ba2df6f72588;hp=6346ad3c5bad459d29085d172f486480b09847c9;hb=70180c4c4fd2807d16f90562d6876f3f07d388b1;hpb=d42485b9c24c02503080b05e5e466112f47c909a diff --git a/src/harbour-pedalo.cpp b/src/harbour-pedalo.cpp index 6346ad3..e8f123d 100644 --- a/src/harbour-pedalo.cpp +++ b/src/harbour-pedalo.cpp @@ -1,5 +1,5 @@ -#ifdef QT_QML_DEBUG #include +#ifdef QT_QML_DEBUG #include #endif @@ -9,6 +9,7 @@ #include "journeymodel.h" #include "status.h" #include "settings.h" +#include "imageprovider.h" #include "harbour-pedalo.h" @@ -35,18 +36,26 @@ int main(int argc, char *argv[]) qmlRegisterSingletonType("harbour.pedalo.settings", 1, 0, "Settings", Settings::provider); JourneyModel journeys; - Status currentStatus; + Status currentStatus(journeys); Settings::getInstance().setMainStatus(currentStatus); Settings::getInstance().loadSettings(); 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())); view->setSource(SailfishApp::pathTo("qml/harbour-pedalo.qml")); QQmlContext *ctxt = view->rootContext(); + ctxt->setContextProperty("version", VERSION); + qDebug() << "harbour-pedalo VERSION string: " << VERSION; + qDebug() << "VERSION_MAJOR: " << VERSION_MAJOR; + qDebug() << "VERSION_MINOR: " << VERSION_MINOR; + qDebug() << "VERSION_BUILD: " << VERSION_BUILD; + ctxt->setContextProperty("journeymodel", &journeys); ctxt->setContextProperty("currentStatus", ¤tStatus);