-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmain.cpp
50 lines (36 loc) · 1.21 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
39
40
41
42
43
44
45
46
47
48
49
50
#include <QGuiApplication>
#include <QQuickView>
#include <QQmlContext>
#include <QFontDatabase>
#include <QStandardPaths>
#include <QDir>
#include "org_gpodder_android_GPodderNative.h"
#include "gpodderandroid.h"
static GPodderAndroid *
g_android = NULL;
JNIEXPORT void JNICALL
Java_org_gpodder_android_GPodderNative_audioBecomingNoisy(JNIEnv *env, jclass clazz)
{
if (g_android) {
emit g_android->audioBecomingNoisy();
}
}
int
main(int argc, char *argv[])
{
QGuiApplication app(argc, argv);
// Native <-> QML glue object
g_android = new GPodderAndroid();
// gPodder storage directory
QString data(QDir(QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation)).filePath("gPodder"));
qputenv("GPODDER_HOME", data.toUtf8());
// gPodder QML UI fonts and themeing
QFontDatabase::addApplicationFont(":/touch/icons/iconic_fill.ttf");
QFontDatabase::addApplicationFont(":/touch/fonts/source-sans-pro.extralight.ttf");
QQuickView view;
view.rootContext()->setContextProperty("gpodderAndroid", g_android);
view.setSource(QUrl("qrc:/touch/gpodder.qml"));
view.setResizeMode(QQuickView::SizeRootObjectToView);
view.show();
return app.exec();
}