mirror of
https://github.com/HenkKalkwater/harbour-sailfin.git
synced 2025-09-04 01:42:44 +00:00
Make libJellyfinQt a proper qml plugin
This commit is contained in:
parent
96ecd8e7d8
commit
64ad37707c
9 changed files with 1923 additions and 58 deletions
|
@ -101,7 +101,7 @@ endif()
|
|||
|
||||
|
||||
|
||||
add_library(JellyfinQt ${JellyfinQt_SOURCES} ${JellyfinQt_HEADERS})
|
||||
add_library(JellyfinQt ${JellyfinQt_SOURCES} ${JellyfinQt_HEADERS} qmldir JellyfinQt.qmltypes)
|
||||
|
||||
if(${CMAKE_VERSION} VERSION_GREATER "3.16.0")
|
||||
if(BUILD_PRECOMPILED_HEADERS)
|
||||
|
@ -128,4 +128,29 @@ install(TARGETS JellyfinQt
|
|||
INCLUDES DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
|
||||
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
|
||||
|
||||
add_custom_target(qmltypes
|
||||
COMMAND qmlplugindump -nonrelocatable nl.netsoj.chris.Jellyfin 1.0 > $$PWD/JellyfinQt.qmltypes)
|
||||
|
||||
add_custom_command(
|
||||
TARGET JellyfinQt
|
||||
POST_BUILD
|
||||
COMMAND
|
||||
${CMAKE_COMMAND} -E copy
|
||||
${CMAKE_CURRENT_LIST_DIR}/qmldir
|
||||
$<TARGET_FILE_DIR:JellyfinQt>/qmldir
|
||||
)
|
||||
|
||||
add_custom_command(
|
||||
TARGET JellyfinQt
|
||||
POST_BUILD
|
||||
COMMAND
|
||||
${CMAKE_COMMAND} -E copy
|
||||
${CMAKE_CURRENT_LIST_DIR}/JellyfinQt.qmltypes
|
||||
$<TARGET_FILE_DIR:JellyfinQt>/JellyfinQt.qmltypes
|
||||
)
|
||||
|
||||
|
||||
set(QML_IMPORT_PATH $<TARGET_FILE_DIR:JellyfinQt> CACHE PATH "")
|
||||
install(FILES $<TARGET_FILE_DIR:JellyfinQt>/qmldir DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
||||
|
||||
export(TARGETS JellyfinQt FILE JellyfinQtConfig.cmake)
|
||||
|
|
1828
core/JellyfinQt.qmltypes
Normal file
1828
core/JellyfinQt.qmltypes
Normal file
File diff suppressed because it is too large
Load diff
|
@ -19,35 +19,18 @@
|
|||
#ifndef JELLYFIN_H
|
||||
#define JELLYFIN_H
|
||||
|
||||
#include <QQmlExtensionPlugin>
|
||||
#include <QtQml>
|
||||
|
||||
#include "model/item.h"
|
||||
#include "dto/itemfields.h"
|
||||
#include "dto/mediastream.h"
|
||||
#include "dto/nameguidpair.h"
|
||||
#include "dto/userdto.h"
|
||||
#include "dto/useritemdatadto.h"
|
||||
|
||||
#include "apiclient.h"
|
||||
#include "apimodel.h"
|
||||
#include "serverdiscoverymodel.h"
|
||||
#include "websocket.h"
|
||||
#include "viewmodel/item.h"
|
||||
#include "viewmodel/itemmodel.h"
|
||||
#include "viewmodel/loader.h"
|
||||
#include "viewmodel/mediastream.h"
|
||||
#include "viewmodel/modelstatus.h"
|
||||
#include "viewmodel/platformmediacontrol.h"
|
||||
#include "viewmodel/playbackmanager.h"
|
||||
#include "viewmodel/playlist.h"
|
||||
#include "viewmodel/settings.h"
|
||||
#include "viewmodel/userdata.h"
|
||||
#include "viewmodel/usermodel.h"
|
||||
#include "viewmodel/user.h"
|
||||
|
||||
namespace Jellyfin {
|
||||
|
||||
void registerTypes(const char *uri = "nl.netsoj.chris.Jellyfin");
|
||||
class JellyfinPlugin : public QQmlExtensionPlugin {
|
||||
Q_OBJECT
|
||||
Q_PLUGIN_METADATA(IID QQmlExtensionInterface_iid)
|
||||
public:
|
||||
void registerTypes(const char *uri) override;
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
module nl.netsoj.chris.Jellyfin
|
||||
plugin JellyfinQt
|
|
@ -17,9 +17,34 @@
|
|||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
#include "JellyfinQt/jellyfin.h"
|
||||
|
||||
#include "JellyfinQt/model/item.h"
|
||||
#include "JellyfinQt/dto/itemfields.h"
|
||||
#include "JellyfinQt/dto/mediastream.h"
|
||||
#include "JellyfinQt/dto/nameguidpair.h"
|
||||
#include "JellyfinQt/dto/userdto.h"
|
||||
#include "JellyfinQt/dto/useritemdatadto.h"
|
||||
|
||||
#include "JellyfinQt/apiclient.h"
|
||||
#include "JellyfinQt/apimodel.h"
|
||||
#include "JellyfinQt/serverdiscoverymodel.h"
|
||||
#include "JellyfinQt/websocket.h"
|
||||
#include "JellyfinQt/viewmodel/item.h"
|
||||
#include "JellyfinQt/viewmodel/itemmodel.h"
|
||||
#include "JellyfinQt/viewmodel/loader.h"
|
||||
#include "JellyfinQt/viewmodel/mediastream.h"
|
||||
#include "JellyfinQt/viewmodel/modelstatus.h"
|
||||
#include "JellyfinQt/viewmodel/platformmediacontrol.h"
|
||||
#include "JellyfinQt/viewmodel/playbackmanager.h"
|
||||
#include "JellyfinQt/viewmodel/playlist.h"
|
||||
#include "JellyfinQt/viewmodel/settings.h"
|
||||
#include "JellyfinQt/viewmodel/userdata.h"
|
||||
#include "JellyfinQt/viewmodel/usermodel.h"
|
||||
#include "JellyfinQt/viewmodel/user.h"
|
||||
|
||||
namespace Jellyfin {
|
||||
|
||||
void registerTypes(const char *uri) {
|
||||
void JellyfinPlugin::registerTypes(const char *uri) {
|
||||
qmlRegisterType<ApiClient>(uri, 1, 0, "ApiClient");
|
||||
qmlRegisterType<ServerDiscoveryModel>(uri, 1, 0, "ServerDiscoveryModel");
|
||||
qmlRegisterType<ViewModel::PlaybackManager>(uri, 1, 0, "PlaybackManager");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue