mirror of
https://github.com/HenkKalkwater/harbour-sailfin.git
synced 2024-11-22 01:05:17 +00:00
Switched to a sane build system (CMake)
This commit is contained in:
parent
9cfd6d7ee2
commit
228bcfb685
21
CMakeLists.txt
Normal file
21
CMakeLists.txt
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
cmake_minimum_required(VERSION 3.11)
|
||||||
|
project(harbour-sailfin)
|
||||||
|
set (CMAKE_CXX_STANDARD 17)
|
||||||
|
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/")
|
||||||
|
set(CMAKE_AUTOMOC ON)
|
||||||
|
|
||||||
|
# Options
|
||||||
|
option(SAILFISHOS "Build SailfishOS version of application")
|
||||||
|
option(PLATFORM_QTQUICK "Build QtQuick version of application")
|
||||||
|
|
||||||
|
if(SAILFISHOS)
|
||||||
|
# Hardcode this less?
|
||||||
|
set(CMAKE_INSTALL_LIBDIR "${CMAKE_INSTALL_PREFIX}/share/harbour-sailfin/lib")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
add_subdirectory(core)
|
||||||
|
if(SAILFISHOS)
|
||||||
|
add_subdirectory(sailfish)
|
||||||
|
else()
|
||||||
|
add_subdirectory(qtquick)
|
||||||
|
endif()
|
39
cmake/FindSailfishApp.cmake
Normal file
39
cmake/FindSailfishApp.cmake
Normal file
|
@ -0,0 +1,39 @@
|
||||||
|
# - Try to find libsailfishapp
|
||||||
|
# Once done this will define
|
||||||
|
# SailfishApp_FOUND - System has libsailfishapp
|
||||||
|
# SailfishApp_INCLUDE_DIRS - The libsailfishapp include directories
|
||||||
|
# SailfishApp_LIBRARIES - The libraries needed to use libsailfishapp
|
||||||
|
# SailfishApp_DEFINITIONS - Compiler switches required for using libsailfishapp
|
||||||
|
|
||||||
|
find_package(PkgConfig)
|
||||||
|
pkg_check_modules(PC_SailfishApp QUIET sailfishapp)
|
||||||
|
set(SailfishApp_DEFINITIONS ${PC_SailfishApp_CFLAGS_OTHER})
|
||||||
|
|
||||||
|
find_path(SailfishApp_INCLUDE_DIR sailfishapp.h
|
||||||
|
HINTS ${PC_SailfishApp_INCLUDEDIR} ${PC_SailfishApp_INCLUDE_DIRS}
|
||||||
|
PATH_SUFFIXES sailfishapp )
|
||||||
|
|
||||||
|
find_library(SailfishApp_LIBRARY NAMES sailfishapp libsailfishapp
|
||||||
|
HINTS ${PC_SailfishApp_LIBDIR} ${PC_SailfishApp_LIBRARY_DIRS} )
|
||||||
|
|
||||||
|
include(FindPackageHandleStandardArgs)
|
||||||
|
# handle the QUIETLY and REQUIRED arguments and set LIBSailfishApp_FOUND to TRUE
|
||||||
|
# if all listed variables are TRUE
|
||||||
|
set(SailfishApp_VERSION ${PC_SAILFISHAPP_VERSION})
|
||||||
|
find_package_handle_standard_args(SailfishApp
|
||||||
|
FOUND_VAR SailfishApp_FOUND
|
||||||
|
REQUIRED_VARS
|
||||||
|
SailfishApp_LIBRARY
|
||||||
|
SailfishApp_INCLUDE_DIR
|
||||||
|
VERSION_VAR SailfishApp_VERSION)
|
||||||
|
|
||||||
|
if(SailfishApp_FOUND AND NOT TARGET Foo::Foo)
|
||||||
|
add_library(SailfishApp::SailfishApp UNKNOWN IMPORTED)
|
||||||
|
set_target_properties(SailfishApp::SailfishApp PROPERTIES
|
||||||
|
IMPORTED_LOCATION "${SailfishApp_LIBRARY}"
|
||||||
|
INTERFACE_COMPILE_OPTIONS "${PC_SailfishApp_CFLAGS_OTHER}"
|
||||||
|
INTERFACE_INCLUDE_DIRECTORIES "${SailfishApp_INCLUDE_DIR}"
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
mark_as_advanced(SailfishApp_INCLUDE_DIR SailfishApp_LIBRARY )
|
42
core/CMakeLists.txt
Normal file
42
core/CMakeLists.txt
Normal file
|
@ -0,0 +1,42 @@
|
||||||
|
project(jellyfin-qt)
|
||||||
|
find_package(Qt5 5.6 COMPONENTS Multimedia Network Qml WebSockets REQUIRED)
|
||||||
|
include(GNUInstallDirs)
|
||||||
|
|
||||||
|
set(jellyfin-qt_SOURCES
|
||||||
|
src/credentialmanager.cpp
|
||||||
|
src/jellyfin.cpp
|
||||||
|
src/jellyfinapiclient.cpp
|
||||||
|
src/jellyfinapimodel.cpp
|
||||||
|
src/jellyfindeviceprofile.cpp
|
||||||
|
src/jellyfinitem.cpp
|
||||||
|
src/jellyfinplaybackmanager.cpp
|
||||||
|
src/jellyfinwebsocket.cpp
|
||||||
|
src/jsonhelper.cpp
|
||||||
|
src/serverdiscoverymodel.cpp)
|
||||||
|
|
||||||
|
set(jellyfin-qt_HEADERS
|
||||||
|
include/JellyfinQt/credentialmanager.h
|
||||||
|
include/JellyfinQt/jellyfin.h
|
||||||
|
include/JellyfinQt/jellyfinapiclient.h
|
||||||
|
include/JellyfinQt/jellyfinapimodel.h
|
||||||
|
include/JellyfinQt/jellyfindeviceprofile.h
|
||||||
|
include/JellyfinQt/jellyfinitem.h
|
||||||
|
include/JellyfinQt/jellyfinplaybackmanager.h
|
||||||
|
include/JellyfinQt/jellyfinwebsocket.h
|
||||||
|
include/JellyfinQt/jsonhelper.h
|
||||||
|
include/JellyfinQt/serverdiscoverymodel.h)
|
||||||
|
|
||||||
|
add_definitions(-DSAILFIN_VERSION=\"${SAILFIN_VERSION}\")
|
||||||
|
add_library(jellyfin-qt ${jellyfin-qt_SOURCES} ${jellyfin-qt_HEADERS})
|
||||||
|
target_include_directories(jellyfin-qt
|
||||||
|
PUBLIC "include"
|
||||||
|
)
|
||||||
|
target_link_libraries(jellyfin-qt PUBLIC Qt5::Core Qt5::Multimedia Qt5::Network Qt5::Qml Qt5::WebSockets)
|
||||||
|
set_target_properties(jellyfin-qt PROPERTIES CXX_VISIBILITY_PRESET default)
|
||||||
|
install(TARGETS jellyfin-qt
|
||||||
|
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
|
||||||
|
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
|
||||||
|
INCLUDES DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
|
||||||
|
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
|
||||||
|
|
||||||
|
export(TARGETS jellyfin-qt FILE JellyfinQtConfig.cmake)
|
|
@ -1,34 +0,0 @@
|
||||||
TEMPLATE = lib
|
|
||||||
QT += qml multimedia network websockets
|
|
||||||
|
|
||||||
include(defines.pri)
|
|
||||||
include(../harbour-sailfin.pri)
|
|
||||||
|
|
||||||
SOURCES += \
|
|
||||||
src/credentialmanager.cpp \
|
|
||||||
src/jellyfin.cpp \
|
|
||||||
src/jellyfinapiclient.cpp \
|
|
||||||
src/jellyfinapimodel.cpp \
|
|
||||||
src/jellyfindeviceprofile.cpp \
|
|
||||||
src/jellyfinitem.cpp \
|
|
||||||
src/jellyfinplaybackmanager.cpp \
|
|
||||||
src/jellyfinwebsocket.cpp \
|
|
||||||
src/jsonhelper.cpp \
|
|
||||||
src/serverdiscoverymodel.cpp
|
|
||||||
|
|
||||||
HEADERS += \
|
|
||||||
include/credentialmanager.h \
|
|
||||||
include/jellyfin.h \
|
|
||||||
include/jellyfinapiclient.h \
|
|
||||||
include/jellyfinapimodel.h \
|
|
||||||
include/jellyfindeviceprofile.h \
|
|
||||||
include/jellyfinitem.h \
|
|
||||||
include/jellyfinplaybackmanager.h \
|
|
||||||
include/jellyfinwebsocket.h \
|
|
||||||
include/jsonhelper.h \
|
|
||||||
include/serverdiscoverymodel.h
|
|
||||||
|
|
||||||
VERSION = $$SAILFIN_VERSION
|
|
||||||
|
|
||||||
TARGET = jellyfin-qt
|
|
||||||
DESTDIR = lib
|
|
|
@ -1,2 +0,0 @@
|
||||||
message(Including $$_FILE_ from $$IN_PWD)
|
|
||||||
INCLUDEPATH += $$IN_PWD/include
|
|
16
core/include/JellyfinQt/jellyfin.h
Normal file
16
core/include/JellyfinQt/jellyfin.h
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
#ifndef JELLYFIN_H
|
||||||
|
#define JELLYFIN_H
|
||||||
|
|
||||||
|
#include <QtQml>
|
||||||
|
|
||||||
|
#include "JellyfinQt/jellyfinapiclient.h"
|
||||||
|
#include "JellyfinQt/jellyfinapimodel.h"
|
||||||
|
#include "JellyfinQt/jellyfinitem.h"
|
||||||
|
#include "JellyfinQt/serverdiscoverymodel.h"
|
||||||
|
#include "JellyfinQt/jellyfinplaybackmanager.h"
|
||||||
|
|
||||||
|
namespace Jellyfin {
|
||||||
|
void registerTypes();
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // JELLYFIN_H
|
|
@ -251,8 +251,7 @@ private:
|
||||||
*/
|
*/
|
||||||
class PublicUserModel : public ApiModel {
|
class PublicUserModel : public ApiModel {
|
||||||
public:
|
public:
|
||||||
explicit PublicUserModel (QObject *parent = nullptr)
|
explicit PublicUserModel (QObject *parent = nullptr);
|
||||||
: ApiModel ("/users/public", false, false, parent) { }
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -270,44 +269,37 @@ public slots:
|
||||||
|
|
||||||
class UserViewModel : public ApiModel {
|
class UserViewModel : public ApiModel {
|
||||||
public:
|
public:
|
||||||
explicit UserViewModel (QObject *parent = nullptr)
|
explicit UserViewModel (QObject *parent = nullptr);
|
||||||
: ApiModel ("/Users/{{user}}/Views", true, false, parent) {}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class UserItemModel : public ItemModel {
|
class UserItemModel : public ItemModel {
|
||||||
public:
|
public:
|
||||||
explicit UserItemModel (QObject *parent = nullptr)
|
explicit UserItemModel (QObject *parent = nullptr);
|
||||||
: ItemModel ("/Users/{{user}}/Items", true, false, parent) {}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class UserItemResumeModel : public ItemModel {
|
class UserItemResumeModel : public ItemModel {
|
||||||
public:
|
public:
|
||||||
explicit UserItemResumeModel (QObject *parent = nullptr)
|
explicit UserItemResumeModel (QObject *parent = nullptr);
|
||||||
: ItemModel ("/Users/{{user}}/Items/Resume", true, false, parent) {}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class UserItemLatestModel : public ItemModel {
|
class UserItemLatestModel : public ItemModel {
|
||||||
public:
|
public:
|
||||||
explicit UserItemLatestModel (QObject *parent = nullptr)
|
explicit UserItemLatestModel (QObject *parent = nullptr);
|
||||||
: ItemModel ("/Users/{{user}}/Items/Latest", false, false, parent) {}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class ShowNextUpModel : public ItemModel {
|
class ShowNextUpModel : public ItemModel {
|
||||||
public:
|
public:
|
||||||
explicit ShowNextUpModel (QObject *parent = nullptr)
|
explicit ShowNextUpModel (QObject *parent = nullptr);
|
||||||
: ItemModel("/Shows/NextUp", true, true, parent) {}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class ShowSeasonsModel : public ItemModel {
|
class ShowSeasonsModel : public ItemModel {
|
||||||
public:
|
public:
|
||||||
explicit ShowSeasonsModel (QObject *parent = nullptr)
|
explicit ShowSeasonsModel (QObject *parent = nullptr);
|
||||||
: ItemModel ("/Shows/{{show}}/Seasons", true, true, parent) {}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class ShowEpisodesModel : public ItemModel {
|
class ShowEpisodesModel : public ItemModel {
|
||||||
public:
|
public:
|
||||||
explicit ShowEpisodesModel (QObject *parent = nullptr)
|
explicit ShowEpisodesModel (QObject *parent = nullptr);
|
||||||
: ItemModel ("/Shows/{{show}}/Episodes", true, true, parent) {}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -1,16 +0,0 @@
|
||||||
#ifndef JELLYFIN_H
|
|
||||||
#define JELLYFIN_H
|
|
||||||
|
|
||||||
#include <QtQml>
|
|
||||||
|
|
||||||
#include "jellyfinapiclient.h"
|
|
||||||
#include "jellyfinapimodel.h"
|
|
||||||
#include "jellyfinitem.h"
|
|
||||||
#include "serverdiscoverymodel.h"
|
|
||||||
#include "jellyfinplaybackmanager.h"
|
|
||||||
|
|
||||||
namespace Jellyfin {
|
|
||||||
void registerTypes();
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif // JELLYFIN_H
|
|
|
@ -17,7 +17,7 @@ License along with this library; if not, write to the Free Software
|
||||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "credentialmanager.h"
|
#include "JellyfinQt/credentialmanager.h"
|
||||||
|
|
||||||
CredentialsManager * CredentialsManager::newInstance(QObject *parent) {
|
CredentialsManager * CredentialsManager::newInstance(QObject *parent) {
|
||||||
return new FallbackCredentialsManager(parent);
|
return new FallbackCredentialsManager(parent);
|
||||||
|
|
|
@ -1,4 +1,22 @@
|
||||||
#include "jellyfin.h"
|
/*
|
||||||
|
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
|
||||||
|
*/
|
||||||
|
#include "JellyfinQt/jellyfin.h"
|
||||||
namespace Jellyfin {
|
namespace Jellyfin {
|
||||||
|
|
||||||
void registerTypes() {
|
void registerTypes() {
|
||||||
|
|
|
@ -17,7 +17,7 @@ License along with this library; if not, write to the Free Software
|
||||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "jellyfinapiclient.h"
|
#include "JellyfinQt/jellyfinapiclient.h"
|
||||||
|
|
||||||
namespace Jellyfin {
|
namespace Jellyfin {
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,7 @@ License along with this library; if not, write to the Free Software
|
||||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "jellyfinapimodel.h"
|
#include "JellyfinQt/jellyfinapimodel.h"
|
||||||
|
|
||||||
namespace Jellyfin {
|
namespace Jellyfin {
|
||||||
ApiModel::ApiModel(QString path, bool hasRecordResponse, bool addUserId, QObject *parent)
|
ApiModel::ApiModel(QString path, bool hasRecordResponse, bool addUserId, QObject *parent)
|
||||||
|
@ -240,6 +240,29 @@ void ItemModel::onUserDataChanged(const QString &itemId, QSharedPointer<UserData
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
PublicUserModel::PublicUserModel(QObject *parent)
|
||||||
|
: ApiModel ("/users/public", false, false, parent) { }
|
||||||
|
|
||||||
|
UserViewModel::UserViewModel(QObject *parent)
|
||||||
|
: ApiModel ("/Users/{{user}}/Views", true, false, parent) {}
|
||||||
|
|
||||||
|
UserItemModel::UserItemModel(QObject *parent)
|
||||||
|
: ItemModel ("/Users/{{user}}/Items", true, false, parent) {}
|
||||||
|
|
||||||
|
UserItemResumeModel::UserItemResumeModel(QObject *parent)
|
||||||
|
: ItemModel ("/Users/{{user}}/Items/Resume", true, false, parent) {}
|
||||||
|
|
||||||
|
UserItemLatestModel::UserItemLatestModel(QObject *parent)
|
||||||
|
: ItemModel ("/Users/{{user}}/Items/Latest", false, false, parent) {}
|
||||||
|
|
||||||
|
ShowNextUpModel::ShowNextUpModel(QObject *parent)
|
||||||
|
: ItemModel("/Shows/NextUp", true, true, parent) {}
|
||||||
|
|
||||||
|
ShowSeasonsModel::ShowSeasonsModel(QObject *parent)
|
||||||
|
: ItemModel ("/Shows/{{show}}/Seasons", true, true, parent) {}
|
||||||
|
|
||||||
|
ShowEpisodesModel::ShowEpisodesModel(QObject *parent)
|
||||||
|
: ItemModel ("/Shows/{{show}}/Episodes", true, true, parent) {}
|
||||||
|
|
||||||
void registerModels(const char *URI) {
|
void registerModels(const char *URI) {
|
||||||
qmlRegisterUncreatableType<ApiModel>(URI, 1, 0, "ApiModel", "Is enum and base class");
|
qmlRegisterUncreatableType<ApiModel>(URI, 1, 0, "ApiModel", "Is enum and base class");
|
||||||
|
|
|
@ -17,7 +17,7 @@ License along with this library; if not, write to the Free Software
|
||||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "jellyfindeviceprofile.h"
|
#include "JellyfinQt/jellyfindeviceprofile.h"
|
||||||
|
|
||||||
namespace Jellyfin {
|
namespace Jellyfin {
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,7 @@ License along with this library; if not, write to the Free Software
|
||||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "jellyfinitem.h"
|
#include "JellyfinQt/jellyfinitem.h"
|
||||||
|
|
||||||
namespace Jellyfin {
|
namespace Jellyfin {
|
||||||
const QRegularExpression JsonSerializable::m_listExpression = QRegularExpression("^QList<\\s*([a-zA-Z0-9]*)\\s*\\*?\\s*>$");
|
const QRegularExpression JsonSerializable::m_listExpression = QRegularExpression("^QList<\\s*([a-zA-Z0-9]*)\\s*\\*?\\s*>$");
|
||||||
|
|
|
@ -17,7 +17,7 @@ License along with this library; if not, write to the Free Software
|
||||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "jellyfinplaybackmanager.h"
|
#include "JellyfinQt/jellyfinplaybackmanager.h"
|
||||||
|
|
||||||
namespace Jellyfin {
|
namespace Jellyfin {
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@ You should have received a copy of the GNU Lesser General Public
|
||||||
License along with this library; if not, write to the Free Software
|
License along with this library; if not, write to the Free Software
|
||||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
*/
|
*/
|
||||||
#include "jellyfinwebsocket.h"
|
#include "JellyfinQt/jellyfinwebsocket.h"
|
||||||
|
|
||||||
namespace Jellyfin {
|
namespace Jellyfin {
|
||||||
WebSocket::WebSocket(ApiClient *client)
|
WebSocket::WebSocket(ApiClient *client)
|
||||||
|
|
|
@ -1,4 +1,22 @@
|
||||||
#include "jsonhelper.h"
|
/*
|
||||||
|
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
|
||||||
|
*/
|
||||||
|
#include "JellyfinQt/jsonhelper.h"
|
||||||
|
|
||||||
namespace Jellyfin {
|
namespace Jellyfin {
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@ You should have received a copy of the GNU Lesser General Public
|
||||||
License along with this library; if not, write to the Free Software
|
License along with this library; if not, write to the Free Software
|
||||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
*/
|
*/
|
||||||
#include "serverdiscoverymodel.h"
|
#include "JellyfinQt/serverdiscoverymodel.h"
|
||||||
|
|
||||||
namespace Jellyfin {
|
namespace Jellyfin {
|
||||||
ServerDiscoveryModel::ServerDiscoveryModel(QObject *parent)
|
ServerDiscoveryModel::ServerDiscoveryModel(QObject *parent)
|
||||||
|
|
|
@ -1,14 +0,0 @@
|
||||||
TEMPLATE = app
|
|
||||||
|
|
||||||
SOURCES += \
|
|
||||||
src/main.cpp
|
|
||||||
|
|
||||||
include(../harbour-sailfin.pri)
|
|
||||||
|
|
||||||
# Include our library
|
|
||||||
|
|
||||||
LIBS += -L$$OUT_PWD/../core/lib -ljellyfin-qt
|
|
||||||
core.files += ../core/lib
|
|
||||||
core.path = /usr/share/$${TARGET}
|
|
||||||
|
|
||||||
INSTALLS += core
|
|
|
@ -1,7 +0,0 @@
|
||||||
!defined(SAILFIN_VERSION, var) {
|
|
||||||
SAILFIN_VERSION = "0.0.0-unknown"
|
|
||||||
}
|
|
||||||
QMAKE_CXXFLAGS += -std=c++17
|
|
||||||
|
|
||||||
# Help, something keeps eating my quotes and backslashes
|
|
||||||
DEFINES += "SAILFIN_VERSION=\"\\\"$$SAILFIN_VERSION\\\"\""
|
|
|
@ -1,28 +0,0 @@
|
||||||
TEMPLATE = subdirs
|
|
||||||
SUBDIRS = core
|
|
||||||
|
|
||||||
core.subdir = core
|
|
||||||
|
|
||||||
defined(OS_SAILFISHOS, var){
|
|
||||||
SUBDIRS += sailfish
|
|
||||||
sailfish.subdir = sailfish
|
|
||||||
sailfish.depends = core
|
|
||||||
}
|
|
||||||
defined(OS_DESKTOP, var) {
|
|
||||||
SUBDIRS += desktop
|
|
||||||
desktop.subdir = desktop
|
|
||||||
desktop.depends = core
|
|
||||||
}
|
|
||||||
|
|
||||||
message($$SUBDIRS)
|
|
||||||
|
|
||||||
# German translation is enabled as an example. If you aren't
|
|
||||||
# planning to localize your app, remember to comment out the
|
|
||||||
# following TRANSLATIONS line. And also do not forget to
|
|
||||||
# modify the localized app name in the the .desktop file.
|
|
||||||
# TRANSLATIONS += \
|
|
||||||
|
|
||||||
DISTFILES += \
|
|
||||||
sailfish/qml/pages/itemdetails/PhotoPage.qml
|
|
||||||
|
|
||||||
|
|
47
qtquick/CMakeLists.txt
Normal file
47
qtquick/CMakeLists.txt
Normal file
|
@ -0,0 +1,47 @@
|
||||||
|
find_package(Qt5 COMPONENTS Gui Qml Quick)
|
||||||
|
set(sailfin_SOURCES
|
||||||
|
src/main.cpp)
|
||||||
|
|
||||||
|
set(sailfin_QML_SOURCES
|
||||||
|
qml/Constants.qml
|
||||||
|
qml/Utils.js
|
||||||
|
qml/components/GlassyBackground.qml
|
||||||
|
qml/components/IconListItem.qml
|
||||||
|
qml/components/LibraryItemDelegate.qml
|
||||||
|
qml/components/MoreSection.qml
|
||||||
|
qml/components/PlainLabel.qml
|
||||||
|
qml/components/PlayToolbar.qml
|
||||||
|
qml/components/RemoteImage.qml
|
||||||
|
qml/components/Shim.qml
|
||||||
|
qml/components/UserGridDelegate.qml
|
||||||
|
qml/components/VideoPlayer.qml
|
||||||
|
qml/components/VideoTrackSelector.qml
|
||||||
|
qml/components/itemdetails/SeasonDetails.qml
|
||||||
|
qml/components/videoplayer/VideoError.qml
|
||||||
|
qml/components/videoplayer/VideoHud.qml
|
||||||
|
qml/cover/CoverPage.qml
|
||||||
|
qml/cover/PosterCover.qml
|
||||||
|
qml/cover/VideoCover.qml
|
||||||
|
qml/pages/LegalPage.qml
|
||||||
|
qml/pages/MainPage.qml
|
||||||
|
qml/pages/AboutPage.qml
|
||||||
|
qml/harbour-sailfin.qml
|
||||||
|
qml/pages/SettingsPage.qml
|
||||||
|
qml/pages/VideoPage.qml
|
||||||
|
qml/pages/itemdetails/BaseDetailPage.qml
|
||||||
|
qml/pages/itemdetails/CollectionPage.qml
|
||||||
|
qml/pages/itemdetails/EpisodePage.qml
|
||||||
|
qml/pages/itemdetails/FilmPage.qml
|
||||||
|
qml/pages/itemdetails/MusicAlbumPage.qml
|
||||||
|
qml/pages/itemdetails/SeasonPage.qml
|
||||||
|
qml/pages/itemdetails/SeriesPage.qml
|
||||||
|
qml/pages/itemdetails/UnsupportedPage.qml
|
||||||
|
qml/pages/itemdetails/VideoPage.qml
|
||||||
|
qml/pages/setup/AddServerConnectingPage.qml
|
||||||
|
qml/pages/setup/LoginDialog.qml
|
||||||
|
qml/qmldir)
|
||||||
|
|
||||||
|
add_custom_target(harbour-sailfin-qml ${sailfin_QML_SOURCES})
|
||||||
|
|
||||||
|
add_executable(sailfin ${sailfin_SOURCES})
|
||||||
|
target_link_libraries(sailfin PUBLIC Qt5::Gui Qt5::Qml Qt5::Quick jellyfin-qt)
|
|
@ -1,7 +1,9 @@
|
||||||
#include <QGuiApplication>
|
#include <QGuiApplication>
|
||||||
|
#include <JellyfinQt/jellyfin.h>
|
||||||
|
|
||||||
int main(int argc, char** argv) {
|
int main(int argc, char** argv) {
|
||||||
QGuiApplication app(argc, argv);
|
QGuiApplication app(argc, argv);
|
||||||
|
Jellyfin::registerTypes();
|
||||||
|
|
||||||
return app.exec();
|
return app.exec();
|
||||||
}
|
}
|
|
@ -12,7 +12,7 @@ Sources:
|
||||||
- '%{name}-%{version}.tar.bz2'
|
- '%{name}-%{version}.tar.bz2'
|
||||||
Description: |
|
Description: |
|
||||||
Play video's and music from your Jellyfin media player on your Sailfish device
|
Play video's and music from your Jellyfin media player on your Sailfish device
|
||||||
Builder: qmake5
|
Builder: cmake
|
||||||
|
|
||||||
# This section specifies build dependencies that are resolved using pkgconfig.
|
# This section specifies build dependencies that are resolved using pkgconfig.
|
||||||
# This is the preferred way of specifying build dependencies for your package.
|
# This is the preferred way of specifying build dependencies for your package.
|
||||||
|
@ -43,9 +43,9 @@ Macros:
|
||||||
- '__provides_exclude_from; ^%{_datadir}/.*$'
|
- '__provides_exclude_from; ^%{_datadir}/.*$'
|
||||||
- '__requires_exclude; ^libjellyfin-qt.*$'
|
- '__requires_exclude; ^libjellyfin-qt.*$'
|
||||||
|
|
||||||
QMakeOptions:
|
ConfigOptions:
|
||||||
- OS_SAILFISHOS=1
|
- -DSAILFISHOS=1
|
||||||
- SAILFIN_VERSION='%{version}-%{release}'
|
- -DSAILFIN_VERSION='%{version}-%{release}'
|
||||||
|
|
||||||
# For more information about yaml and what's supported in Sailfish OS
|
# For more information about yaml and what's supported in Sailfish OS
|
||||||
# build system, please see https://wiki.merproject.org/wiki/Spectacle
|
# build system, please see https://wiki.merproject.org/wiki/Spectacle
|
||||||
|
|
37
sailfish/CMakeLists.txt
Normal file
37
sailfish/CMakeLists.txt
Normal file
|
@ -0,0 +1,37 @@
|
||||||
|
project(harbour-sailfin-sailfish)
|
||||||
|
|
||||||
|
# find_library(SAILFISH sailfishapp 1.0 REQUIRED)
|
||||||
|
find_package(Qt5 COMPONENTS Gui Qml Quick)
|
||||||
|
find_package(SailfishApp 1.0 REQUIRED)
|
||||||
|
|
||||||
|
set(harbour-sailfin_SOURCES
|
||||||
|
src/harbour-sailfin.cpp)
|
||||||
|
|
||||||
|
add_executable(harbour-sailfin ${harbour-sailfin_SOURCES})
|
||||||
|
target_link_libraries(harbour-sailfin PRIVATE Qt5::Gui Qt5::Qml Qt5::Quick SailfishApp::SailfishApp jellyfin-qt)
|
||||||
|
|
||||||
|
install(TARGETS harbour-sailfin
|
||||||
|
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
|
||||||
|
|
||||||
|
install(DIRECTORY qml
|
||||||
|
DESTINATION share/harbour-sailfin
|
||||||
|
)
|
||||||
|
install(DIRECTORY translations
|
||||||
|
DESTINATION share/harbour-sailfin
|
||||||
|
FILES_MATCHING PATTERN "*.qm"
|
||||||
|
)
|
||||||
|
install(FILES harbour-sailfin.desktop
|
||||||
|
DESTINATION share/applications
|
||||||
|
)
|
||||||
|
install(FILES icons/86x86/harbour-sailfin.png
|
||||||
|
DESTINATION share/icons/hicolor/86x86/apps
|
||||||
|
)
|
||||||
|
install(FILES icons/108x108/harbour-sailfin.png
|
||||||
|
DESTINATION share/icons/hicolor/108x108/apps
|
||||||
|
)
|
||||||
|
install(FILES icons/128x128/harbour-sailfin.png
|
||||||
|
DESTINATION share/icons/hicolor/128x128/apps
|
||||||
|
)
|
||||||
|
install(FILES icons/172x172/harbour-sailfin.png
|
||||||
|
DESTINATION share/icons/hicolor/172x172/apps
|
||||||
|
)
|
|
@ -1,79 +0,0 @@
|
||||||
# NOTICE:
|
|
||||||
#
|
|
||||||
# Application name defined in TARGET has a corresponding QML filename.
|
|
||||||
# If name defined in TARGET is changed, the following needs to be done
|
|
||||||
# to match new name:
|
|
||||||
# - corresponding QML filename must be changed
|
|
||||||
# - desktop icon filename must be changed
|
|
||||||
# - desktop filename must be changed
|
|
||||||
# - icon definition filename in desktop file must be changed
|
|
||||||
# - translation filenames have to be changed
|
|
||||||
|
|
||||||
# The name of your application
|
|
||||||
TARGET = harbour-sailfin
|
|
||||||
|
|
||||||
#INCLUDEPATH += ../core/include
|
|
||||||
#DEPENDPATH += ../core
|
|
||||||
#LIBS += -Lcore -lcore
|
|
||||||
include(../core/defines.pri)
|
|
||||||
include(../harbour-sailfin.pri)
|
|
||||||
|
|
||||||
# include our shared library and install it
|
|
||||||
|
|
||||||
LIBS += -L$$OUT_PWD/../core/lib -ljellyfin-qt
|
|
||||||
core.files += ../core/lib
|
|
||||||
core.path = /usr/share/$${TARGET}
|
|
||||||
|
|
||||||
INSTALLS += core
|
|
||||||
|
|
||||||
# Other configuration
|
|
||||||
|
|
||||||
CONFIG += sailfishapp # c++17
|
|
||||||
|
|
||||||
DISTFILES += \
|
|
||||||
qml/Constants.qml \
|
|
||||||
qml/Utils.js \
|
|
||||||
qml/components/GlassyBackground.qml \
|
|
||||||
qml/components/IconListItem.qml \
|
|
||||||
qml/components/LibraryItemDelegate.qml \
|
|
||||||
qml/components/MoreSection.qml \
|
|
||||||
qml/components/PlainLabel.qml \
|
|
||||||
qml/components/PlayToolbar.qml \
|
|
||||||
qml/components/RemoteImage.qml \
|
|
||||||
qml/components/Shim.qml \
|
|
||||||
qml/components/UserGridDelegate.qml \
|
|
||||||
qml/components/VideoPlayer.qml \
|
|
||||||
qml/components/VideoTrackSelector.qml \
|
|
||||||
qml/components/itemdetails/SeasonDetails.qml \
|
|
||||||
qml/components/videoplayer/VideoError.qml \
|
|
||||||
qml/components/videoplayer/VideoHud.qml \
|
|
||||||
qml/cover/CoverPage.qml \
|
|
||||||
qml/cover/PosterCover.qml \
|
|
||||||
qml/cover/VideoCover.qml \
|
|
||||||
qml/pages/LegalPage.qml \
|
|
||||||
qml/pages/MainPage.qml \
|
|
||||||
qml/pages/AboutPage.qml \
|
|
||||||
qml/harbour-sailfin.qml \
|
|
||||||
qml/pages/SettingsPage.qml \
|
|
||||||
qml/pages/VideoPage.qml \
|
|
||||||
qml/pages/itemdetails/BaseDetailPage.qml \
|
|
||||||
qml/pages/itemdetails/CollectionPage.qml \
|
|
||||||
qml/pages/itemdetails/EpisodePage.qml \
|
|
||||||
qml/pages/itemdetails/FilmPage.qml \
|
|
||||||
qml/pages/itemdetails/MusicAlbumPage.qml \
|
|
||||||
qml/pages/itemdetails/SeasonPage.qml \
|
|
||||||
qml/pages/itemdetails/SeriesPage.qml \
|
|
||||||
qml/pages/itemdetails/UnsupportedPage.qml \
|
|
||||||
qml/pages/itemdetails/VideoPage.qml \
|
|
||||||
qml/pages/setup/AddServerConnectingPage.qml \
|
|
||||||
qml/pages/setup/LoginDialog.qml \
|
|
||||||
qml/qmldir
|
|
||||||
|
|
||||||
SOURCES += \
|
|
||||||
src/harbour-sailfin.cpp
|
|
||||||
|
|
||||||
SAILFISHAPP_ICONS = 86x86 108x108 128x128 172x172
|
|
||||||
|
|
||||||
# to disable building translations every time, comment out the
|
|
||||||
# following CONFIG line
|
|
||||||
CONFIG += sailfishapp_i18n
|
|
|
@ -28,7 +28,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
|
||||||
#include <sailfishapp.h>
|
#include <sailfishapp.h>
|
||||||
|
|
||||||
#include <jellyfin.h>
|
#include <JellyfinQt/jellyfin.h>
|
||||||
|
|
||||||
int main(int argc, char *argv[]) {
|
int main(int argc, char *argv[]) {
|
||||||
// SailfishApp::main() will display "qml/harbour-sailfin.qml", if you need more
|
// SailfishApp::main() will display "qml/harbour-sailfin.qml", if you need more
|
||||||
|
|
Loading…
Reference in a new issue