diff options
Diffstat (limited to 'rockwork/main.cpp')
| -rw-r--r-- | rockwork/main.cpp | 36 |
1 files changed, 19 insertions, 17 deletions
diff --git a/rockwork/main.cpp b/rockwork/main.cpp index 70fd0d7..57a8772 100644 --- a/rockwork/main.cpp +++ b/rockwork/main.cpp @@ -12,26 +12,28 @@ #include "applicationsfiltermodel.h" #include "appstoreclient.h" #include "screenshotmodel.h" +#include <sailfishapp.h> int main(int argc, char *argv[]) { - QGuiApplication app(argc, argv); + QScopedPointer<QGuiApplication> app(SailfishApp::application(argc, argv)); + app->setApplicationName("pebble"); + app->setOrganizationName(""); - qmlRegisterUncreatableType<Pebble>("RockWork", 1, 0, "Pebble", "Get them from the model"); - qmlRegisterUncreatableType<ApplicationsModel>("RockWork", 1, 0, "ApplicationsModel", "Get them from a Pebble object"); - qmlRegisterUncreatableType<AppItem>("RockWork", 1, 0, "AppItem", "Get them from an ApplicationsModel"); - qmlRegisterType<ApplicationsFilterModel>("RockWork", 1, 0, "ApplicationsFilterModel"); - qmlRegisterType<Pebbles>("RockWork", 1, 0, "Pebbles"); - qmlRegisterUncreatableType<NotificationSourceModel>("RockWork", 1, 0, "NotificationSourceModel", "Get it from a Pebble object"); - qmlRegisterType<ServiceControl>("RockWork", 1, 0, "ServiceController"); - qmlRegisterType<AppStoreClient>("RockWork", 1, 0, "AppStoreClient"); - qmlRegisterType<ScreenshotModel>("RockWork", 1, 0, "ScreenshotModel"); + qmlRegisterUncreatableType<Pebble>("RockPool", 1, 0, "Pebble", "Get them from the model"); + qmlRegisterUncreatableType<ApplicationsModel>("RockPool", 1, 0, "ApplicationsModel", "Get them from a Pebble object"); + qmlRegisterUncreatableType<AppItem>("RockPool", 1, 0, "AppItem", "Get them from an ApplicationsModel"); + qmlRegisterType<ApplicationsFilterModel>("RockPool", 1, 0, "ApplicationsFilterModel"); + qmlRegisterType<Pebbles>("RockPool", 1, 0, "Pebbles"); + qmlRegisterUncreatableType<NotificationSourceModel>("RockPool", 1, 0, "NotificationSourceModel", "Get it from a Pebble object"); + qmlRegisterType<ServiceControl>("RockPool", 1, 0, "ServiceController"); + qmlRegisterType<AppStoreClient>("RockPool", 1, 0, "AppStoreClient"); + qmlRegisterType<ScreenshotModel>("RockPool", 1, 0, "ScreenshotModel"); - QQuickView view; - view.engine()->rootContext()->setContextProperty("version", QStringLiteral(VERSION)); - view.engine()->rootContext()->setContextProperty("homePath", QStandardPaths::standardLocations(QStandardPaths::HomeLocation).first()); - view.setSource(QUrl(QStringLiteral("qrc:///Main.qml"))); - view.setResizeMode(QQuickView::SizeRootObjectToView); - view.show(); - return app.exec(); + QScopedPointer<QQuickView> view(SailfishApp::createView()); + view->rootContext()->setContextProperty("version", QStringLiteral(VERSION)); + view->setSource(SailfishApp::pathTo("qml/Main.qml")); + view->show(); + + return app->exec(); } |
