-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathentrypoint.cpp
More file actions
32 lines (28 loc) · 834 Bytes
/
entrypoint.cpp
File metadata and controls
32 lines (28 loc) · 834 Bytes
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
#include <QQmlApplicationEngine>
#include <QQmlContext>
#include <QtQml/QQmlComponent>
#include "entrypoint.h"
#include "feeddata.h"
EntryPoint::EntryPoint() : QObject(), _engine(nullptr)
{
}
EntryPoint::~EntryPoint()
{
feedManager.save();
}
void EntryPoint::setEngine(QQmlApplicationEngine* engine)
{
_engine = engine;
}
void EntryPoint::registerObjectsInEngine()
{
qmlRegisterType<FeedData>("com.podcaster.data", 1, 0, "FeedData");
qmlRegisterType<RecordInfo>("com.podcaster.data", 1, 0, "RecordInfo");
feedManager.load();
if(_engine != nullptr)
{
_engine->rootContext()->setContextProperty("feedManager", &feedManager);
_engine->rootContext()->setContextProperty("rssManager", &rssManager);
_engine->rootContext()->setContextProperty("downloader", &downloadManager);
}
}