1
0
Fork 0
mirror of https://github.com/HenkKalkwater/harbour-sailfin.git synced 2024-05-08 15:12:43 +00:00
harbour-sailfin/src/harbour-sailfin.cpp
Chris Josten 53b3eac213 Initial commit
Features so far:
- Login is working, both on back-end and GUI-wise
- Saving and reusing login tokens is working
- The home page is mostly functional
- Show details can be received and displayed in a basic manner

Following features are taken into account, but have not been fully
implemented:
- Support for multiple accounts/servers
- Securely saving login tokens
2020-09-20 12:14:51 +02:00

49 lines
1.5 KiB
C++

#ifdef QT_QML_DEBUG
#include <QtQuick>
#endif
#include <QJSEngine>
#include <QGuiApplication>
#include <QQuickView>
#include <QQmlEngine>
#include <sailfishapp.h>
#include "jellyfinapiclient.h"
#include "jellyfinapimodel.h"
#include "serverdiscoverymodel.h"
void registerQml() {
const char* QML_NAMESPACE = "nl.netsoj.chris.Jellyfin";
qmlRegisterSingletonType<JellyfinApiClient>(QML_NAMESPACE, 1, 0, "ApiClient", [](QQmlEngine *eng, QJSEngine *js) {
Q_UNUSED(eng)
Q_UNUSED(js)
return dynamic_cast<QObject*>(new JellyfinApiClient());
});
qmlRegisterType<ServerDiscoveryModel>(QML_NAMESPACE, 1, 0, "ServerDiscoveryModel");
// API models
Jellyfin::registerModels(QML_NAMESPACE);
}
int main(int argc, char *argv[]) {
// SailfishApp::main() will display "qml/harbour-sailfin.qml", if you need more
// control over initialization, you can use:
//
// - SailfishApp::application(int, char *[]) to get the QGuiApplication *
// - SailfishApp::createView() to get a new QQuickView * instance
// - SailfishApp::pathTo(QString) to get a QUrl to a resource file
// - SailfishApp::pathToMainQml() to get a QUrl to the main QML file
//
// To display the view, call "show()" (will show fullscreen on device).
QGuiApplication *app = SailfishApp::application(argc, argv);
registerQml();
QQuickView *view = SailfishApp::createView();
view->setSource(SailfishApp::pathToMainQml());
view->show();
return app->exec();
}