1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
#include <QGuiApplication>
#include <QQmlApplicationEngine>
#include <QQuickView>
#include <QtQml>
#include <QFile>
#include "notificationsourcemodel.h"
#include "servicecontrol.h"
#include "pebbles.h"
#include "pebble.h"
#include "applicationsmodel.h"
#include "applicationsfiltermodel.h"
#include "appstoreclient.h"
#include "screenshotmodel.h"
#include <sailfishapp.h>
int main(int argc, char *argv[])
{
QScopedPointer<QGuiApplication> app(SailfishApp::application(argc, argv));
app->setApplicationName("pebble");
app->setOrganizationName("");
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");
QScopedPointer<QQuickView> view(SailfishApp::createView());
view->rootContext()->setContextProperty("version", QStringLiteral(VERSION));
view->setSource(SailfishApp::pathTo("qml/Main.qml"));
view->show();
return app->exec();
}
|