-
Notifications
You must be signed in to change notification settings - Fork 2
/
main.cpp
40 lines (34 loc) · 1.57 KB
/
main.cpp
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
#include <QGuiApplication>
#include <QQuickView>
#include <QtQml>
#include "wrappers/notebookwrapper.h"
#include "wrappers/notewrapper.h"
#include "wrappers/resourcewrapper.h"
#include "wrappers/savedsearchwrapper.h"
#include "wrappers/tagwrapper.h"
#include "evernotesession.h"
#include "cache.h"
#include "oauth.h"
#include "settings.h"
#include "db/databasemanager.h"
#include <sailfishapp.h>
int main(int argc, char *argv[])
{
QScopedPointer<QGuiApplication> app(SailfishApp::application(argc, argv));
app->setApplicationName(QString("BlueWhale"));
app->setOrganizationName(QString("harbour-bluewhale"));
qmlRegisterType <TagWrapper> ("com.evernote.types",1,0, "Tag");
qmlRegisterType <NoteWrapper> ("com.evernote.types",1,0, "Note");
qmlRegisterType <ResourceWrapper> ("com.evernote.types",1,0, "Resource");
qmlRegisterType <NotebookWrapper> ("com.evernote.types",1,0, "Notebook");
qmlRegisterType <SavedSearchWrapper> ("com.evernote.types",1,0, "SavedSearch");
QScopedPointer<QQuickView> view(SailfishApp::createView());
view->setSource(SailfishApp::pathTo("qml/harbour-bluewhale.qml"));
view->rootContext()->setContextProperty("EvernoteSession", EvernoteSession::instance());
view->rootContext()->setContextProperty("Cache", Cache::instance());
view->rootContext()->setContextProperty("Settings", Settings::instance());
view->rootContext()->setContextProperty("OAuth", OAuth::instance());
view->rootContext()->setContextProperty("DatabaseManager", DatabaseManager::instance());
view->showFullScreen();
return app->exec();
}