mirror of
https://github.com/HenkKalkwater/harbour-sailfin.git
synced 2025-09-04 09:42:45 +00:00
Deserialized a list! Restructured project!
I finally got deserializing lists working. Exposing them to QML was not a trivial task either. Note that I didn't do it the clean way. Nested lists are not supported. But it works! Because I got so frustarted at one point trying to implement things the right way, I restructured the project to seperate the Sailfish code from the Qt code and created a new, empty desktop project. The Qt code has been transformed into a happy little library, to which the Sailfish OS application links. Note that QMake doesn't seem to strip the library for some reason.
This commit is contained in:
parent
4e3395c4e5
commit
1e80ceb697
77 changed files with 507 additions and 213 deletions
50
sailfish/src/harbour-sailfin.cpp
Normal file
50
sailfish/src/harbour-sailfin.cpp
Normal file
|
@ -0,0 +1,50 @@
|
|||
/*
|
||||
Sailfin: a Jellyfin client written using Qt
|
||||
Copyright (C) 2020 Chris Josten
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifdef QT_QML_DEBUG
|
||||
#include <QtQuick>
|
||||
#endif
|
||||
|
||||
#include <QJSEngine>
|
||||
#include <QGuiApplication>
|
||||
#include <QQuickView>
|
||||
#include <QQmlEngine>
|
||||
|
||||
#include <sailfishapp.h>
|
||||
|
||||
#include <jellyfin.h>
|
||||
|
||||
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);
|
||||
Jellyfin::registerTypes();
|
||||
QQuickView *view = SailfishApp::createView();
|
||||
view->setSource(SailfishApp::pathToMainQml());
|
||||
view->show();
|
||||
|
||||
return app->exec();
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue