diff options
| author | Oskari Timperi <oskari.timperi@iki.fi> | 2014-01-11 21:34:35 +0200 |
|---|---|---|
| committer | Oskari Timperi <oskari.timperi@iki.fi> | 2014-02-03 23:32:08 +0200 |
| commit | e1bb6186c353dcfffb0b9e01ae40cdb365652c1b (patch) | |
| tree | b29e697d27571649148379af4d62083bb2fc0809 /src/main.cpp | |
| parent | 7d9c1b0da32bed3ee2413bafce89e01e80a5508f (diff) | |
| download | unitmaster-e1bb6186c353dcfffb0b9e01ae40cdb365652c1b.tar.gz unitmaster-e1bb6186c353dcfffb0b9e01ae40cdb365652c1b.zip | |
add Settings class
Diffstat (limited to 'src/main.cpp')
| -rw-r--r-- | src/main.cpp | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/src/main.cpp b/src/main.cpp index 0c04372..3727f1f 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -4,18 +4,26 @@ #include <sailfishapp.h> +#include "settings.h" + +#define STRINGIFY(X) #X int main(int argc, char *argv[]) { - // SailfishApp::main() will display "qml/template.qml", if you need more - // control over initialization, you can use: - // - // - SailfishApp::application(int, char *[]) to get the QGuiApplication * - // - SailfishApp::createView() to get a new QQuickView * instance - // - SailfishApp::pathTo(QString) to get a QUrl to a resource file - // - // To display the view, call "show()" (will show fullscreen on device). - - return SailfishApp::main(argc, argv); + QCoreApplication::setOrganizationName("oswjk"); + QCoreApplication::setApplicationName("unitmaster"); + QCoreApplication::setApplicationVersion(STRINGIFY(UNITMASTER_VERSION)); + + QGuiApplication *app = SailfishApp::application(argc, argv); + QQuickView *view = SailfishApp::createView(); + + Settings settings; + view->rootContext()->setContextProperty("settings", &settings); + + view->setSource(SailfishApp::pathTo("qml/harbour-unitmaster.qml")); + + view->showFullScreen(); + + return app->exec(); } |
