-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathhutspot.cpp
65 lines (51 loc) · 1.8 KB
/
hutspot.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/**
* Copyright (C) 2018 Willem-Jan de Hoog
*
* License: MIT
*/
#ifdef QT_QML_DEBUG
#include <QtQuick>
#else
#include <QQuickView>
#include <QQmlContext>
#include <QGuiApplication>
#include <QTranslator>
#include <QDebug>
#endif
#include <sailfishapp.h>
#include "IconProvider.h"
#include "spotify.h"
#include "spmdns.h"
#include "connect/spconnect.h"
#include "qdeclarativeprocess.h"
#include "systemutil.h"
int main(int argc, char *argv[])
{
QGuiApplication * app = SailfishApp::application(argc,argv);
QQuickView * view = SailfishApp::createView();
QCoreApplication::setOrganizationName("wdehoog");
QCoreApplication::setOrganizationDomain("wdehoog");
QCoreApplication::setApplicationName("hutspot");
QString buildDateTime;
buildDateTime.append(__DATE__);
buildDateTime.append(" ");
buildDateTime.append(__TIME__);
view->rootContext()->setContextProperty("BUILD_DATE_TIME", buildDateTime);
Spotify spotify;
view->rootContext()->setContextProperty("spotify", &spotify);
qmlRegisterUncreatableType<QDeclarativeProcessEnums>("org.hildon.components", 1, 0, "Processes", "");
qmlRegisterType<QDeclarativeProcess>("org.hildon.components", 1, 0, "Process");
// custom icon loader
QQmlEngine *engine = view->engine();
engine->addImageProvider(QLatin1String("hutspot-icons"), new IconProvider);
SPMDNS spMdns;
view->rootContext()->setContextProperty("spMdns", &spMdns);
SPConnect spConnect;
view->rootContext()->setContextProperty("spConnect", &spConnect);
qmlRegisterUncreatableType<SystemUtilEnums>("SystemUtils", 1, 0, "SystemUtils", "");
SystemUtil systemUtil;
view->rootContext()->setContextProperty("sysUtil", &systemUtil);
view->setSource(SailfishApp::pathTo("qml/hutspot.qml"));
view->show();
return app->exec();
}