mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-09-06 04:02:54 +02:00
Compare commits
91 Commits
unify-down
...
master
Author | SHA1 | Date | |
---|---|---|---|
|
ad59c9acde | ||
|
2d7b7e4514 | ||
|
c1d9d431fd | ||
|
90ec6f0dc7 | ||
|
115b3f7521 | ||
|
bcd92ed508 | ||
|
6c01a6a997 | ||
|
5b6aecd8d0 | ||
|
77acc1cd66 | ||
|
4d3ee34903 | ||
|
4ee462db4c | ||
|
57c387bba5 | ||
|
d693bbf33f | ||
|
4fb44c931b | ||
|
27e8a665cf | ||
|
fdca99e57d | ||
|
e3bb74ce25 | ||
|
4aa06f524c | ||
|
8c3dc90f76 | ||
|
ba5759d453 | ||
|
18b42539e4 | ||
|
299f033ef9 | ||
|
777b312191 | ||
|
1ab3ed9f93 | ||
|
9327204c78 | ||
|
60672e2d0c | ||
|
4375c8e0c4 | ||
|
092313cd7f | ||
|
783e853c2a | ||
|
368032f399 | ||
|
ec2b9d84eb | ||
|
378f8262cf | ||
|
3f012ac9f8 | ||
|
d7cc6b5719 | ||
|
d5c8026a9e | ||
|
0ec2df0ac6 | ||
|
84ec28e476 | ||
|
62feb25f5c | ||
|
80d2fa48ec | ||
|
4815dd78c1 | ||
|
3b1e0b3cf1 | ||
|
a563993b71 | ||
|
57bc920534 | ||
|
be919f74f9 | ||
|
bdc3238e6e | ||
|
333806ef4a | ||
|
084084db22 | ||
|
a6cb6a92e6 | ||
|
2b95da1a32 | ||
|
25da5bdbc5 | ||
|
d7b9c5464d | ||
|
d96dc74353 | ||
|
73091bec21 | ||
|
021223f6cc | ||
|
7302047e9a | ||
|
119a7ebdb8 | ||
|
af0cb18972 | ||
|
34c1f88171 | ||
|
00f602e102 | ||
|
c838959248 | ||
|
97a407f837 | ||
|
3b6ba36e83 | ||
|
cf6a37ae45 | ||
|
690a87f1eb | ||
|
6842da7240 | ||
|
6910e5dd3b | ||
|
584aa76582 | ||
|
7e96285132 | ||
|
c996a8b90e | ||
|
c705013ee1 | ||
|
84360aed2f | ||
|
ada03e1a8d | ||
|
3a71da5705 | ||
|
214e310c91 | ||
|
ed9a027644 | ||
|
3e2d74128d | ||
|
84ed59f4be | ||
|
5dd36cbd4e | ||
|
7e38d94fe5 | ||
|
28ee9180c8 | ||
|
09e9a6e960 | ||
|
ffa098e52d | ||
|
a439427ca5 | ||
|
a9505f75c5 | ||
|
7e54e506df | ||
|
abc00b4758 | ||
|
77e9b69679 | ||
|
58b640d389 | ||
|
1a5f073437 | ||
|
c9ef7e74d8 | ||
|
525068a706 |
16
.github/workflows/ccpp.yml
vendored
Normal file
16
.github/workflows/ccpp.yml
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
name: C/C++ CI
|
||||
|
||||
on: [push]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: tomahawkmusicplayer/ubuntu:latest
|
||||
env:
|
||||
MIX_ENV: test
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@master
|
||||
- name: Build and test
|
||||
run: /usr/local/bin/build-and-test.sh
|
272
CMakeLists.txt
272
CMakeLists.txt
@@ -2,17 +2,25 @@ PROJECT( tomahawk )
|
||||
CMAKE_MINIMUM_REQUIRED( VERSION 2.8.12 )
|
||||
CMAKE_POLICY(SET CMP0017 NEW)
|
||||
CMAKE_POLICY(SET CMP0022 NEW)
|
||||
IF(POLICY CMP0075)
|
||||
CMAKE_POLICY(SET CMP0075 NEW)
|
||||
ENDIF()
|
||||
|
||||
# TODO:
|
||||
# Update to NEW and fix things up
|
||||
CMAKE_POLICY(SET CMP0023 OLD)
|
||||
CMAKE_POLICY(SET CMP0023 NEW)
|
||||
|
||||
# Let AUTOMOC and AUTOUIC process generated files
|
||||
IF(POLICY CMP0071)
|
||||
CMAKE_POLICY(SET CMP0071 NEW)
|
||||
ENDIF()
|
||||
|
||||
# TODO:
|
||||
# Disable automatic qtmain linking
|
||||
CMAKE_POLICY(SET CMP0020 OLD)
|
||||
|
||||
find_package(ECM 1.7.0 REQUIRED NO_MODULE)
|
||||
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR} "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules" )
|
||||
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules" ${ECM_MODULE_PATH})
|
||||
|
||||
|
||||
|
||||
@@ -89,8 +97,7 @@ endif()
|
||||
option(BUILD_GUI "Build Tomahawk with GUI" ON)
|
||||
option(BUILD_TESTS "Build Tomahawk with unit tests" ${BUILD_NO_RELEASE})
|
||||
option(BUILD_TOOLS "Build Tomahawk helper tools" ${BUILD_NO_RELEASE})
|
||||
option(BUILD_HATCHET "Build the Hatchet plugin" ON)
|
||||
option(BUILD_WITH_QT4 "Build Tomahawk with Qt4 instead of Qt5" OFF)
|
||||
option(BUILD_HATCHET "Build the Hatchet plugin" OFF)
|
||||
|
||||
if(UNIX AND NOT APPLE)
|
||||
set(CRASHREPORTER_ENABLED_BY_DEFAULT OFF)
|
||||
@@ -99,8 +106,6 @@ else()
|
||||
endif()
|
||||
option(WITH_CRASHREPORTER "Build with CrashReporter" ${CRASHREPORTER_ENABLED_BY_DEFAULT})
|
||||
option(WITH_BINARY_ATTICA "Enable support for downloading binary resolvers automatically" ON)
|
||||
option(LEGACY_KDE_INTEGRATION "Install tomahawk.protocol file, deprecated since 4.6.0" OFF)
|
||||
option(WITH_KDE4 "Build with support for KDE specific stuff" ON)
|
||||
|
||||
# build options for development purposes
|
||||
option(SANITIZE_ADDRESS "Enable Address Sanitizer for memory error detection" OFF)
|
||||
@@ -161,162 +166,45 @@ INCLUDE( MacroLogFeature )
|
||||
|
||||
message( STATUS "Building Tomahawk ${TOMAHAWK_VERSION} ***" )
|
||||
|
||||
if( NOT BUILD_WITH_QT4 )
|
||||
find_package(Qt5Core QUIET)
|
||||
if( Qt5Core_DIR )
|
||||
# CMAKE 2.8.13+/3.0.0+ requires these for IMPORTed targets
|
||||
find_package(Qt5Concurrent REQUIRED)
|
||||
find_package(Qt5Svg REQUIRED)
|
||||
find_package(Qt5UiTools REQUIRED)
|
||||
find_package(Qt5WebKitWidgets REQUIRED)
|
||||
find_package(Qt5Widgets REQUIRED)
|
||||
find_package(Qt5Xml REQUIRED)
|
||||
find_package(Qt5X11Extras NO_MODULE QUIET)
|
||||
find_package(Qt5Core REQUIRED)
|
||||
find_package(Qt5Concurrent REQUIRED)
|
||||
find_package(Qt5Gui REQUIRED)
|
||||
find_package(Qt5Network REQUIRED)
|
||||
find_package(Qt5Sql REQUIRED)
|
||||
find_package(Qt5Svg REQUIRED)
|
||||
find_package(Qt5UiTools REQUIRED)
|
||||
find_package(Qt5WebKitWidgets REQUIRED)
|
||||
find_package(Qt5Widgets REQUIRED)
|
||||
find_package(Qt5Xml REQUIRED)
|
||||
find_package(Qt5X11Extras NO_MODULE QUIET)
|
||||
|
||||
if(Qt5X11Extras_FOUND)
|
||||
set(HAVE_X11 TRUE)
|
||||
else()
|
||||
set(HAVE_X11 FALSE)
|
||||
endif()
|
||||
|
||||
message(STATUS "Found Qt5!")
|
||||
|
||||
if( UNIX AND NOT APPLE )
|
||||
# We need this to find the paths to qdbusxml2cpp and co
|
||||
find_package(Qt5DBus REQUIRED)
|
||||
endif()
|
||||
|
||||
if(APPLE)
|
||||
find_package(Qt5MacExtras REQUIRED)
|
||||
endif()
|
||||
|
||||
if(WIN32)
|
||||
find_package(Qt5WinExtras REQUIRED)
|
||||
endif()
|
||||
|
||||
macro(qt_wrap_ui)
|
||||
qt5_wrap_ui(${ARGN})
|
||||
endmacro()
|
||||
|
||||
macro(qt_add_resources)
|
||||
qt5_add_resources(${ARGN})
|
||||
endmacro()
|
||||
|
||||
find_package(Qt5LinguistTools REQUIRED)
|
||||
macro(qt_add_translation)
|
||||
qt5_add_translation(${ARGN})
|
||||
endmacro()
|
||||
|
||||
if( UNIX AND NOT APPLE )
|
||||
macro(qt_add_dbus_interface)
|
||||
qt5_add_dbus_interface(${ARGN})
|
||||
endmacro()
|
||||
|
||||
macro(qt_add_dbus_adaptor)
|
||||
qt5_add_dbus_adaptor(${ARGN})
|
||||
endmacro()
|
||||
endif()
|
||||
|
||||
macro(setup_qt)
|
||||
endmacro()
|
||||
|
||||
set(QT_RCC_EXECUTABLE "${Qt5Core_RCC_EXECUTABLE}")
|
||||
#FIXME: CrashReporter depends on deprecated QHttp
|
||||
set(WITH_KDE4 OFF)
|
||||
endif()
|
||||
endif()
|
||||
if( NOT Qt5Core_DIR )
|
||||
message(STATUS "Could not find Qt5, searching for Qt4 instead...")
|
||||
|
||||
if(NOT FORCE_QT4)
|
||||
message(FATAL_ERROR "Qt4 support is broken, if you plan to fix it, add -DFORCE_QT4=ON to your cmake arguments otherwise you should compile Tomahawk with Qt5")
|
||||
endif()
|
||||
|
||||
set(NEEDED_QT4_COMPONENTS "QtCore" "QtXml" "QtNetwork")
|
||||
if( BUILD_GUI )
|
||||
list(APPEND NEEDED_QT4_COMPONENTS "QtGui" "QtWebkit" "QtUiTools" "QtSvg")
|
||||
endif()
|
||||
if( BUILD_TESTS )
|
||||
list(APPEND NEEDED_QT4_COMPONENTS "QtTest")
|
||||
endif()
|
||||
|
||||
macro_optional_find_package(Qt4 4.7.0 COMPONENTS ${NEEDED_QT4_COMPONENTS} )
|
||||
macro_log_feature(QT4_FOUND "Qt" "A cross-platform application and UI framework" "http://qt-project.org" TRUE "" "If you see this, although libqt4-devel is installed, check whether the \n qtwebkit-devel package and whatever contains QtUiTools is installed too")
|
||||
|
||||
macro(qt5_use_modules)
|
||||
endmacro()
|
||||
|
||||
macro(qt_wrap_ui)
|
||||
qt4_wrap_ui(${ARGN})
|
||||
endmacro()
|
||||
|
||||
macro(qt_add_resources)
|
||||
qt4_add_resources(${ARGN})
|
||||
endmacro()
|
||||
|
||||
macro(qt_add_translation)
|
||||
qt4_add_translation(${ARGN})
|
||||
endmacro()
|
||||
|
||||
macro(qt_add_dbus_interface)
|
||||
qt4_add_dbus_interface(${ARGN})
|
||||
endmacro()
|
||||
|
||||
macro(qt_add_dbus_adaptor)
|
||||
qt4_add_dbus_adaptor(${ARGN})
|
||||
endmacro()
|
||||
|
||||
macro(setup_qt)
|
||||
if( NOT BUILD_GUI )
|
||||
set(QT_DONT_USE_QTGUI TRUE)
|
||||
endif()
|
||||
if( UNIX AND NOT APPLE )
|
||||
set(QT_USE_QTDBUS TRUE)
|
||||
endif()
|
||||
set(QT_USE_QTSQL TRUE)
|
||||
set(QT_USE_QTNETWORK TRUE)
|
||||
set(QT_USE_QTXML TRUE)
|
||||
set(QT_USE_QTWEBKIT TRUE)
|
||||
|
||||
include( ${QT_USE_FILE} )
|
||||
endmacro()
|
||||
|
||||
# Qt5 C++11 Macros not defined within Qt4
|
||||
# TODO: Add C++11 support
|
||||
tomahawk_add_definitions( "-DQ_DECL_FINAL=" )
|
||||
tomahawk_add_definitions( "-DQ_DECL_OVERRIDE=" )
|
||||
endif()
|
||||
|
||||
if( Qt5Core_DIR )
|
||||
set( TOMAHAWK_QT5_TMP TRUE)
|
||||
else( Qt5Core_DIR )
|
||||
set( TOMAHAWK_QT5_TMP FALSE )
|
||||
endif( Qt5Core_DIR )
|
||||
set( TOMAHAWK_QT5 ${TOMAHAWK_QT5_TMP} CACHE BOOL "Build Tomahawk with Qt5")
|
||||
|
||||
if( BUILD_GUI AND UNIX AND NOT APPLE )
|
||||
macro_optional_find_package( X11 )
|
||||
macro_log_feature(X11_FOUND "X11" "The Xorg libraries" "http://www.x.org/wiki/" TRUE "" "Xorg libraries are used by libqnetwm to bring windows to front reliably")
|
||||
endif()
|
||||
|
||||
include(CheckCXXCompilerFlag)
|
||||
check_cxx_compiler_flag( "-std=c++11" CXX11_FOUND )
|
||||
check_cxx_compiler_flag( "-std=c++0x" CXX0X_FOUND )
|
||||
check_cxx_compiler_flag( "-stdlib=libc++" LIBCPP_FOUND )
|
||||
if(CXX11_FOUND)
|
||||
tomahawk_add_cxx_flags( "-std=c++11" )
|
||||
elseif(CXX0X_FOUND)
|
||||
tomahawk_add_cxx_flags( "-std=c++0x" )
|
||||
if(Qt5X11Extras_FOUND)
|
||||
set(HAVE_X11 TRUE)
|
||||
else()
|
||||
message(STATUS "${CMAKE_CXX_COMPILER} does not support C++11, please use a
|
||||
different compiler")
|
||||
endif()
|
||||
if(("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR APPLE) AND LIBCPP_FOUND)
|
||||
tomahawk_add_cxx_flags( "-stdlib=libc++" )
|
||||
set(HAVE_X11 FALSE)
|
||||
endif()
|
||||
|
||||
macro_optional_find_package(Echonest 2.3.0)
|
||||
macro_log_feature(ECHONEST_FOUND "Echonest" "Qt library for communicating with The Echo Nest" "http://projects.kde.org/libechonest" TRUE "" "libechonest 2.3.0 is needed for dynamic playlists and the infosystem")
|
||||
if( UNIX AND NOT APPLE )
|
||||
# We need this to find the paths to qdbusxml2cpp and co
|
||||
find_package(Qt5DBus REQUIRED)
|
||||
endif()
|
||||
|
||||
if(APPLE)
|
||||
find_package(Qt5MacExtras REQUIRED)
|
||||
endif()
|
||||
|
||||
if(WIN32)
|
||||
find_package(Qt5WinExtras REQUIRED)
|
||||
endif()
|
||||
|
||||
find_package(Qt5LinguistTools REQUIRED)
|
||||
|
||||
set(QT_RCC_EXECUTABLE "${Qt5Core_RCC_EXECUTABLE}")
|
||||
# FIXME: CrashReporter depends on deprecated QHttp
|
||||
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
set(CMAKE_CXX_EXTENSIONS OFF)
|
||||
|
||||
find_package(Boost REQUIRED COMPONENTS filesystem system)
|
||||
macro_log_feature(Boost_FOUND "Boost" "Provides free peer-reviewed portable C++ source libraries" "http://www.boost.org" TRUE "" "") #FIXME: give useful explanation
|
||||
@@ -324,15 +212,7 @@ macro_log_feature(Boost_FOUND "Boost" "Provides free peer-reviewed portable C++
|
||||
macro_optional_find_package(Lucene++ 3.0.0)
|
||||
macro_log_feature(LUCENEPP_FOUND "Lucene++" "The open-source, C++ search engine" "https://github.com/luceneplusplus/LucenePlusPlus/" TRUE "" "Lucene++ is used for indexing the collection")
|
||||
|
||||
if( NOT TOMAHAWK_QT5 )
|
||||
macro_optional_find_package(QJSON 0.8.1)
|
||||
macro_log_feature(QJSON_FOUND "QJson" "Qt library that maps JSON data to QVariant objects" "http://qjson.sf.net" TRUE "" "libqjson is used for encoding communication between Tomahawk instances")
|
||||
ENDIF()
|
||||
|
||||
macro_optional_find_package(Taglib 1.8.0)
|
||||
macro_log_feature(TAGLIB_FOUND "TagLib" "Audio Meta-Data Library" "http://developer.kde.org/~wheeler/taglib.html" TRUE "" "taglib is needed for reading meta data from audio files")
|
||||
include( CheckTagLibFileName )
|
||||
check_taglib_filename( COMPLEX_TAGLIB_FILENAME )
|
||||
find_package(Taglib 1.8.0 REQUIRED)
|
||||
|
||||
macro_optional_find_package(Sparsehash)
|
||||
macro_log_feature(SPARSEHASH_FOUND "Sparsehash"
|
||||
@@ -347,23 +227,15 @@ macro_log_feature(GNUTLS_FOUND "GnuTLS"
|
||||
"http://gnutls.org/" TRUE ""
|
||||
"GnuTLS is needed for serving the Playdar/HTTP API via TLS")
|
||||
|
||||
if( TOMAHAWK_QT5 )
|
||||
macro_optional_find_package(Qca-qt5)
|
||||
if(Qca-qt5_DIR)
|
||||
set(QCA2_FOUND ON CACHE BOOL "QCA2 was found")
|
||||
set(QCA2_LIBRARIES "qca-qt5" CACHE STRING "QCA2 Qt5 target")
|
||||
endif()
|
||||
else()
|
||||
macro_optional_find_package(QCA2)
|
||||
macro_optional_find_package(Qca-qt5)
|
||||
if(Qca-qt5_DIR)
|
||||
set(QCA2_FOUND ON CACHE BOOL "QCA2 was found")
|
||||
set(QCA2_LIBRARIES "qca-qt5" CACHE STRING "QCA2 Qt5 target")
|
||||
endif()
|
||||
macro_log_feature(QCA2_FOUND "QCA2" "Provides encryption and signing functions necessary for some resolvers and accounts" "http://delta.affinix.com/qca/" TRUE "" "")
|
||||
|
||||
if( TOMAHAWK_QT5 )
|
||||
macro_optional_find_package(KF5Attica 1.0.0)
|
||||
set(LIBATTICA_FOUND ${KF5Attica_FOUND})
|
||||
else()
|
||||
macro_optional_find_package(LibAttica 0.4.0)
|
||||
endif()
|
||||
macro_optional_find_package(KF5Attica 1.0.0)
|
||||
set(LIBATTICA_FOUND ${KF5Attica_FOUND})
|
||||
macro_log_feature(LIBATTICA_FOUND "libattica" "Provides support for installation of resolvers from the Tomahawk website" "http://download.kde.org/stable/attica/" TRUE "" "")
|
||||
|
||||
macro_optional_find_package(QuaZip)
|
||||
@@ -379,21 +251,13 @@ macro_optional_find_package(LibLastFm 1.0.0)
|
||||
macro_log_feature(LIBLASTFM_FOUND "liblastfm" "Qt library for the Last.fm webservices" "https://github.com/lastfm/liblastfm" TRUE "" "liblastfm is needed for scrobbling tracks to Last.fm and fetching cover artwork")
|
||||
|
||||
if( NOT APPLE )
|
||||
if( TOMAHAWK_QT5 )
|
||||
macro_optional_find_package(Qt5Keychain 0.1.0)
|
||||
else()
|
||||
macro_optional_find_package(QtKeychain 0.1.0)
|
||||
endif()
|
||||
macro_log_feature(QTKEYCHAIN_FOUND "QtKeychain" "Provides support for secure credentials storage" "https://github.com/frankosterfeld/qtkeychain" TRUE "" "")
|
||||
macro_optional_find_package(Qt5Keychain 0.1.0)
|
||||
macro_log_feature(Qt5Keychain_FOUND "QtKeychain" "Provides support for secure credentials storage" "https://github.com/frankosterfeld/qtkeychain" TRUE "" "")
|
||||
endif()
|
||||
|
||||
if( UNIX AND NOT APPLE )
|
||||
macro_optional_find_package(TelepathyQt 0.9.3)
|
||||
if ( TOMAHAWK_QT5 )
|
||||
macro_log_feature(TelepathyQt5_FOUND "Telepathy-Qt" "Telepathy-Qt is a Qt high-level binding for Telepathy, a D-Bus framework for unifying real time communication." FALSE "" "Telepathy-Qt is needed for sharing Jabber/GTalk accounts with Telepathy.\n")
|
||||
else ( TOMAHAWK_QT5)
|
||||
macro_log_feature(TelepathyQt4_FOUND "Telepathy-Qt" "Telepathy-Qt is a Qt high-level binding for Telepathy, a D-Bus framework for unifying real time communication." FALSE "" "Telepathy-Qt is needed for sharing Jabber/GTalk accounts with Telepathy.\n")
|
||||
endif()
|
||||
macro_log_feature(TelepathyQt5_FOUND "Telepathy-Qt" "Telepathy-Qt is a Qt high-level binding for Telepathy, a D-Bus framework for unifying real time communication." FALSE "" "Telepathy-Qt is needed for sharing Jabber/GTalk accounts with Telepathy.\n")
|
||||
endif()
|
||||
|
||||
# we need pthreads too
|
||||
@@ -438,23 +302,7 @@ add_subdirectory(${THIRDPARTY_DIR}/libportfwd)
|
||||
|
||||
#### submodules end
|
||||
|
||||
|
||||
if (WITH_KDE4)
|
||||
macro_optional_find_package(KDE4)
|
||||
macro_optional_find_package(KDE4Installed)
|
||||
endif(WITH_KDE4)
|
||||
macro_log_feature(KDE4_FOUND "KDE4" "Provides support for configuring Telepathy Accounts from inside Tomahawk" "https://www.kde.org" FALSE "" "")
|
||||
|
||||
IF( KDE4_FOUND )
|
||||
IF( CMAKE_C_FLAGS )
|
||||
# KDE4 adds and removes some compiler flags that we don't like
|
||||
# (only for gcc not for clang e.g.)
|
||||
STRING( REPLACE "-std=iso9899:1990" "" CLEAN_C_FLAGS ${CMAKE_C_FLAGS} )
|
||||
SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fexceptions" )
|
||||
ENDIF()
|
||||
ELSE()
|
||||
SET( CLEAN_C_FLAGS ${CMAKE_C_FLAGS} )
|
||||
ENDIF()
|
||||
SET( CLEAN_C_FLAGS ${CMAKE_C_FLAGS} )
|
||||
|
||||
#show dep log
|
||||
macro_display_feature_log()
|
||||
@@ -467,11 +315,6 @@ CONFIGURE_FILE(
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
|
||||
IMMEDIATE @ONLY)
|
||||
|
||||
# KDE4 defines an uninstall target for us automatically (and at least with Qt4 Phonon does as well no matter if kdelibs was found)
|
||||
# IF( NOT KDE4_FOUND )
|
||||
# ADD_CUSTOM_TARGET(uninstall "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake")
|
||||
# ENDIF()
|
||||
|
||||
IF( ( NOT APPLE ) AND ( NOT SANITIZE_ADDRESS ))
|
||||
# Make linking as strict on linux as it is on osx. Then we don't break linking on mac so often
|
||||
#
|
||||
@@ -501,6 +344,7 @@ ADD_SUBDIRECTORY( src )
|
||||
ADD_SUBDIRECTORY( admin )
|
||||
|
||||
IF(BUILD_TESTS)
|
||||
find_package(Qt5Test REQUIRED)
|
||||
enable_testing()
|
||||
ADD_SUBDIRECTORY( src/tests )
|
||||
ENDIF()
|
||||
|
@@ -1,15 +0,0 @@
|
||||
# taglib changed filenames to be a char/wchar struct on some platforms, need to check for it
|
||||
macro (CHECK_TAGLIB_FILENAME TAGLIB_FILENAME_COMPLEX)
|
||||
include (CheckCXXSourceCompiles)
|
||||
set (CMAKE_REQUIRED_FLAGS ${TAGLIB_CFLAGS})
|
||||
set (CMAKE_REQUIRED_INCLUDES ${TAGLIB_INCLUDES})
|
||||
set (CMAKE_REQUIRED_LIBRARIES ${TAGLIB_LIBRARIES})
|
||||
check_cxx_source_compiles(
|
||||
"#include <tfile.h>
|
||||
int main()
|
||||
{
|
||||
TagLib::FileName fileName1(\"char\");
|
||||
TagLib::FileName fileName2(L\"wchar\");
|
||||
return 0;
|
||||
}" ${TAGLIB_FILENAME_COMPLEX})
|
||||
endmacro (CHECK_TAGLIB_FILENAME)
|
@@ -1,42 +0,0 @@
|
||||
# - Find libechonest
|
||||
# Find the libechonest includes and the libechonest libraries
|
||||
# This module defines
|
||||
# ECHONEST_INCLUDE_DIR, root echonest include dir. Include echonest includes with echonest/foo.h
|
||||
# ECHONEST_LIBRARIES, the path to libechonest
|
||||
# ECHONEST_FOUND, whether libechonest was found
|
||||
|
||||
FIND_PACKAGE(PkgConfig QUIET)
|
||||
|
||||
if( TOMAHAWK_QT5 )
|
||||
set(LIBECHONEST_SUFFIX "5")
|
||||
endif()
|
||||
|
||||
PKG_CHECK_MODULES(PC_ECHONEST QUIET libechonest${LIBECHONEST_SUFFIX})
|
||||
|
||||
FIND_PATH(ECHONEST_INCLUDE_DIR NAMES echonest${LIBECHONEST_SUFFIX}/Track.h
|
||||
HINTS
|
||||
${PC_ECHONEST_INCLUDEDIR}
|
||||
${PC_ECHONEST_INCLUDE_DIRS}
|
||||
${CMAKE_INSTALL_INCLUDEDIR}
|
||||
${KDE4_INCLUDE_DIR}
|
||||
)
|
||||
|
||||
FIND_LIBRARY(ECHONEST_LIBRARIES NAMES echonest${LIBECHONEST_SUFFIX}
|
||||
HINTS
|
||||
${PC_ECHONEST_LIBDIR}
|
||||
${PC_ECHONEST_LIBRARY_DIRS}
|
||||
${CMAKE_INSTALL_LIBDIR}
|
||||
${KDE4_LIB_DIR}
|
||||
)
|
||||
|
||||
IF(ECHONEST_LIBRARIES AND ECHONEST_INCLUDE_DIR AND NOT PC_ECHONEST_VERSION)
|
||||
MESSAGE(WARNING "You don't have pkg-config and so the libechonest version check does not work!")
|
||||
set(PC_ECHONEST_VERSION "999.9.9")
|
||||
ENDIF()
|
||||
|
||||
INCLUDE(FindPackageHandleStandardArgs)
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Echonest
|
||||
REQUIRED_VARS ECHONEST_LIBRARIES ECHONEST_INCLUDE_DIR
|
||||
VERSION_VAR PC_ECHONEST_VERSION)
|
||||
|
||||
MARK_AS_ADVANCED(ECHONEST_INCLUDE_DIR ECHONEST_LIBRARIES)
|
@@ -6,31 +6,22 @@
|
||||
# LIBJREEN_FOUND, whether libjreen was found
|
||||
|
||||
FIND_PACKAGE(PkgConfig QUIET)
|
||||
if( TOMAHAWK_QT5 )
|
||||
set(JREEN_LIB_SUFFIX "-qt5")
|
||||
set(JREEN_INCLUDE_SUFFIX ${JREEN_LIB_SUFFIX})
|
||||
else()
|
||||
set(JREEN_INCLUDE_SUFFIX "-qt4")
|
||||
endif()
|
||||
PKG_CHECK_MODULES(PC_JREEN QUIET libjreen${JREEN_LIB_SUFFIX})
|
||||
PKG_CHECK_MODULES(PC_JREEN QUIET libjreen-qt5)
|
||||
|
||||
FIND_PATH(JREEN_INCLUDE_DIR NAMES jreen/jreen.h
|
||||
HINTS
|
||||
${PC_JREEN_INCLUDEDIR}
|
||||
${PC_JREEN_INCLUDE_DIRS}
|
||||
${CMAKE_INSTALL_INCLUDEDIR}
|
||||
${KDE4_INCLUDE_DIR}
|
||||
PATH_SUFFIXES
|
||||
jreen${JREEN_INCLUDE_SUFFIX}
|
||||
|
||||
jreen-qt5
|
||||
)
|
||||
|
||||
FIND_LIBRARY(JREEN_LIBRARIES NAMES jreen${JREEN_LIB_SUFFIX}
|
||||
FIND_LIBRARY(JREEN_LIBRARIES NAMES jreen-qt5
|
||||
HINTS
|
||||
${PC_JREEN_LIBDIR}
|
||||
${PC_JREEN_LIBRARY_DIRS}
|
||||
${CMAKE_INSTALL_LIBDIR}
|
||||
${KDE4_LIB_DIR}
|
||||
)
|
||||
|
||||
IF(JREEN_LIBRARIES AND JREEN_INCLUDE_DIR AND NOT PC_JREEN_VERSION)
|
||||
|
@@ -1,20 +0,0 @@
|
||||
# Simple hack to detect wether KDE4 is *installed* -- not anything about the development environment!
|
||||
|
||||
FILE(TO_CMAKE_PATH "$ENV{KDEDIRS}" _KDEDIRS)
|
||||
|
||||
# For KDE4 kde-config has been renamed to kde4-config
|
||||
FIND_PROGRAM(KDE4_KDECONFIG_EXECUTABLE NAMES kde4-config
|
||||
# the suffix must be used since KDEDIRS can be a list of directories which don't have bin/ appended
|
||||
PATH_SUFFIXES bin
|
||||
HINTS
|
||||
${CMAKE_INSTALL_PREFIX}
|
||||
${_KDEDIRS}
|
||||
/opt/kde4
|
||||
ONLY_CMAKE_FIND_ROOT_PATH
|
||||
)
|
||||
|
||||
IF (KDE4_KDECONFIG_EXECUTABLE)
|
||||
SET (KDE4_INSTALLED TRUE)
|
||||
message(STATUS "KDE4 is installed, will install protocol file")
|
||||
ENDIF (KDE4_KDECONFIG_EXECUTABLE)
|
||||
|
@@ -7,21 +7,15 @@
|
||||
# (c) Dominik Schmidt <dev@dominik-schmidt.de>
|
||||
#
|
||||
|
||||
if( TOMAHAWK_QT5 )
|
||||
set(LASTFM_LIB_SUFFIX "5")
|
||||
endif()
|
||||
|
||||
# Include dir
|
||||
find_path(LIBLASTFM_INCLUDE_DIR
|
||||
# Track.h doesn't exist in liblastfm-0.3.1, was called Track back then
|
||||
NAMES lastfm${LASTFM_LIB_SUFFIX}/Track.h
|
||||
PATHS ${KDE4_INCLUDE_DIR}
|
||||
NAMES lastfm5/Track.h
|
||||
)
|
||||
|
||||
# Finally the library itself
|
||||
find_library(LIBLASTFM_LIBRARY
|
||||
NAMES lastfm${LASTFM_LIB_SUFFIX}
|
||||
PATHS ${KDE4_LIB_DIR}
|
||||
NAMES lastfm5
|
||||
)
|
||||
|
||||
set(LIBLASTFM_LIBRARIES ${LIBLASTFM_LIBRARY})
|
||||
|
@@ -74,10 +74,10 @@ FIND_PATH(LUCENEPP_LIBRARY_DIR
|
||||
IF (LUCENEPP_LIBRARY_DIR)
|
||||
MESSAGE(STATUS "Found Lucene++ library dir: ${LUCENEPP_LIBRARY_DIR}")
|
||||
|
||||
IF (LUCENEPP_VERSION STRLESS "${LUCENEPP_MIN_VERSION}")
|
||||
IF (LUCENEPP_VERSION VERSION_LESS "${LUCENEPP_MIN_VERSION}")
|
||||
MESSAGE(ERROR " Lucene++ version ${LUCENEPP_VERSION} is less than the required minimum ${LUCENEPP_MIN_VERSION}")
|
||||
SET(LUCENEPP_GOOD_VERSION FALSE)
|
||||
ENDIF (LUCENEPP_VERSION STRLESS "${LUCENEPP_MIN_VERSION}")
|
||||
ENDIF (LUCENEPP_VERSION VERSION_LESS "${LUCENEPP_MIN_VERSION}")
|
||||
ENDIF (LUCENEPP_LIBRARY_DIR)
|
||||
|
||||
IF(LUCENEPP_INCLUDE_DIR AND LUCENEPP_LIBRARIES AND LUCENEPP_LIBRARY_DIR AND LUCENEPP_GOOD_VERSION)
|
||||
|
@@ -1,89 +0,0 @@
|
||||
# - Try to find the OggVorbis libraries
|
||||
# Once done this will define
|
||||
#
|
||||
# OGGVORBIS_FOUND - system has OggVorbis
|
||||
# OGGVORBIS_VERSION - set either to 1 or 2
|
||||
# OGGVORBIS_INCLUDE_DIR - the OggVorbis include directory
|
||||
# OGGVORBIS_LIBRARIES - The libraries needed to use OggVorbis
|
||||
# OGG_LIBRARY - The Ogg library
|
||||
# VORBIS_LIBRARY - The Vorbis library
|
||||
# VORBISFILE_LIBRARY - The VorbisFile library
|
||||
# VORBISENC_LIBRARY - The VorbisEnc library
|
||||
|
||||
# Copyright (c) 2006, Richard Laerkaeng, <richard@goteborg.utfors.se>
|
||||
#
|
||||
# Redistribution and use is allowed according to the terms of the BSD license.
|
||||
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
|
||||
|
||||
|
||||
include (CheckLibraryExists)
|
||||
|
||||
find_path(VORBIS_INCLUDE_DIR vorbis/vorbisfile.h)
|
||||
find_path(OGG_INCLUDE_DIR ogg/ogg.h)
|
||||
|
||||
find_library(OGG_LIBRARY NAMES ogg)
|
||||
find_library(VORBIS_LIBRARY NAMES vorbis)
|
||||
find_library(VORBISFILE_LIBRARY NAMES vorbisfile)
|
||||
find_library(VORBISENC_LIBRARY NAMES vorbisenc)
|
||||
|
||||
mark_as_advanced(VORBIS_INCLUDE_DIR OGG_INCLUDE_DIR
|
||||
OGG_LIBRARY VORBIS_LIBRARY VORBISFILE_LIBRARY VORBISENC_LIBRARY)
|
||||
|
||||
|
||||
if (VORBIS_INCLUDE_DIR AND VORBIS_LIBRARY AND VORBISFILE_LIBRARY AND VORBISENC_LIBRARY)
|
||||
set(OGGVORBIS_FOUND TRUE)
|
||||
|
||||
set(OGGVORBIS_LIBRARIES ${OGG_LIBRARY} ${VORBIS_LIBRARY} ${VORBISFILE_LIBRARY} ${VORBISENC_LIBRARY})
|
||||
|
||||
set(_CMAKE_REQUIRED_LIBRARIES_TMP ${CMAKE_REQUIRED_LIBRARIES})
|
||||
set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${OGGVORBIS_LIBRARIES})
|
||||
check_library_exists(vorbis vorbis_bitrate_addblock "" HAVE_LIBVORBISENC2)
|
||||
set(CMAKE_REQUIRED_LIBRARIES ${_CMAKE_REQUIRED_LIBRARIES_TMP})
|
||||
|
||||
if (HAVE_LIBVORBISENC2)
|
||||
set (OGGVORBIS_VERSION 2)
|
||||
else (HAVE_LIBVORBISENC2)
|
||||
set (OGGVORBIS_VERSION 1)
|
||||
endif (HAVE_LIBVORBISENC2)
|
||||
|
||||
else (VORBIS_INCLUDE_DIR AND VORBIS_LIBRARY AND VORBISFILE_LIBRARY AND VORBISENC_LIBRARY)
|
||||
set (OGGVORBIS_VERSION)
|
||||
set(OGGVORBIS_FOUND FALSE)
|
||||
endif (VORBIS_INCLUDE_DIR AND VORBIS_LIBRARY AND VORBISFILE_LIBRARY AND VORBISENC_LIBRARY)
|
||||
|
||||
|
||||
if (OGGVORBIS_FOUND)
|
||||
if (NOT OggVorbis_FIND_QUIETLY)
|
||||
message(STATUS "Found OggVorbis: ${OGGVORBIS_LIBRARIES}")
|
||||
endif (NOT OggVorbis_FIND_QUIETLY)
|
||||
else (OGGVORBIS_FOUND)
|
||||
if (OggVorbis_FIND_REQUIRED)
|
||||
message(FATAL_ERROR "Could NOT find OggVorbis libraries")
|
||||
endif (OggVorbis_FIND_REQUIRED)
|
||||
if (NOT OggVorbis_FIND_QUITELY)
|
||||
message(STATUS "Could NOT find OggVorbis libraries")
|
||||
endif (NOT OggVorbis_FIND_QUITELY)
|
||||
endif (OGGVORBIS_FOUND)
|
||||
|
||||
#check_include_files(vorbis/vorbisfile.h HAVE_VORBISFILE_H)
|
||||
#check_library_exists(ogg ogg_page_version "" HAVE_LIBOGG)
|
||||
#check_library_exists(vorbis vorbis_info_init "" HAVE_LIBVORBIS)
|
||||
#check_library_exists(vorbisfile ov_open "" HAVE_LIBVORBISFILE)
|
||||
#check_library_exists(vorbisenc vorbis_info_clear "" HAVE_LIBVORBISENC)
|
||||
#check_library_exists(vorbis vorbis_bitrate_addblock "" HAVE_LIBVORBISENC2)
|
||||
|
||||
#if (HAVE_LIBOGG AND HAVE_VORBISFILE_H AND HAVE_LIBVORBIS AND HAVE_LIBVORBISFILE AND HAVE_LIBVORBISENC)
|
||||
# message(STATUS "Ogg/Vorbis found")
|
||||
# set (VORBIS_LIBS "-lvorbis -logg")
|
||||
# set (VORBISFILE_LIBS "-lvorbisfile")
|
||||
# set (VORBISENC_LIBS "-lvorbisenc")
|
||||
# set (OGGVORBIS_FOUND TRUE)
|
||||
# if (HAVE_LIBVORBISENC2)
|
||||
# set (HAVE_VORBIS 2)
|
||||
# else (HAVE_LIBVORBISENC2)
|
||||
# set (HAVE_VORBIS 1)
|
||||
# endif (HAVE_LIBVORBISENC2)
|
||||
#else (HAVE_LIBOGG AND HAVE_VORBISFILE_H AND HAVE_LIBVORBIS AND HAVE_LIBVORBISFILE AND HAVE_LIBVORBISENC)
|
||||
# message(STATUS "Ogg/Vorbis not found")
|
||||
#endif (HAVE_LIBOGG AND HAVE_VORBISFILE_H AND HAVE_LIBVORBIS AND HAVE_LIBVORBISFILE AND HAVE_LIBVORBISENC)
|
||||
|
@@ -1,29 +0,0 @@
|
||||
# Find QJSON - JSON handling library for Qt
|
||||
#
|
||||
# This module defines
|
||||
# QJSON_FOUND - whether the qsjon library was found
|
||||
# QJSON_LIBRARIES - the qjson library
|
||||
# QJSON_INCLUDE_DIR - the include path of the qjson library
|
||||
#
|
||||
|
||||
find_library (QJSON_LIBRARIES
|
||||
NAMES
|
||||
qjson
|
||||
PATHS
|
||||
${QJSON_LIBRARY_DIRS}
|
||||
${LIB_INSTALL_DIR}
|
||||
${KDE4_LIB_DIR}
|
||||
)
|
||||
|
||||
find_path (QJSON_INCLUDE_DIR
|
||||
NAMES
|
||||
qjson/parser.h
|
||||
PATHS
|
||||
${QJSON_INCLUDE_DIRS}
|
||||
${INCLUDE_INSTALL_DIR}
|
||||
${KDE4_INCLUDE_DIR}
|
||||
)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(QJSON DEFAULT_MSG QJSON_LIBRARIES QJSON_INCLUDE_DIR)
|
||||
|
@@ -5,22 +5,12 @@
|
||||
# QTSPARKLE_LIBRARY, the path to qtsparkle
|
||||
# QTSPARKLE_FOUND, whether qtsparkle was found
|
||||
|
||||
if( TOMAHAWK_QT5 )
|
||||
set(QTSPARKLE_SUFFIX "-qt5")
|
||||
else()
|
||||
set(QTSPARKLE_SUFFIX "")
|
||||
endif()
|
||||
|
||||
FIND_PATH(QTSPARKLE_INCLUDE_DIR NAMES qtsparkle${QTSPARKLE_SUFFIX}/Updater
|
||||
HINTS
|
||||
${CMAKE_INSTALL_INCLUDEDIR}
|
||||
${KDE4_INCLUDE_DIR}
|
||||
FIND_PATH(QTSPARKLE_INCLUDE_DIR NAMES qtsparkle-qt5/Updater
|
||||
HINTS ${CMAKE_INSTALL_INCLUDEDIR}
|
||||
)
|
||||
|
||||
FIND_LIBRARY(QTSPARKLE_LIBRARIES NAMES qtsparkle${QTSPARKLE_SUFFIX}
|
||||
HINTS
|
||||
${CMAKE_INSTALL_LIBDIR}
|
||||
${KDE4_LIB_DIR}
|
||||
FIND_LIBRARY(QTSPARKLE_LIBRARIES NAMES qtsparkle-qt5
|
||||
HINTS ${CMAKE_INSTALL_LIBDIR}
|
||||
)
|
||||
|
||||
INCLUDE(FindPackageHandleStandardArgs)
|
||||
|
@@ -9,18 +9,15 @@ IF (QUAZIP_INCLUDE_DIRS AND QUAZIP_LIBRARIES)
|
||||
# in cache already
|
||||
SET(QUAZIP_FOUND TRUE)
|
||||
ELSE (QUAZIP_INCLUDE_DIRS AND QUAZIP_LIBRARIES)
|
||||
IF (Qt5Core_FOUND)
|
||||
set(QUAZIP_LIB_VERSION_SUFFIX 5)
|
||||
ENDIF()
|
||||
IF (WIN32)
|
||||
FIND_PATH(QUAZIP_LIBRARY_DIR
|
||||
WIN32_DEBUG_POSTFIX d
|
||||
NAMES libquazip${QUAZIP_LIB_VERSION_SUFFIX}.dll
|
||||
NAMES libquazip5.dll
|
||||
HINTS "C:/Programme/" "C:/Program Files"
|
||||
PATH_SUFFIXES QuaZip/lib
|
||||
)
|
||||
FIND_LIBRARY(QUAZIP_LIBRARIES NAMES libquazip${QUAZIP_LIB_VERSION_SUFFIX}.dll HINTS ${QUAZIP_LIBRARY_DIR})
|
||||
FIND_PATH(QUAZIP_INCLUDE_DIR NAMES quazip.h HINTS ${QUAZIP_LIBRARY_DIR}/../ PATH_SUFFIXES include/quazip${QUAZIP_LIB_VERSION_SUFFIX})
|
||||
FIND_LIBRARY(QUAZIP_LIBRARIES NAMES libquazip5.dll HINTS ${QUAZIP_LIBRARY_DIR})
|
||||
FIND_PATH(QUAZIP_INCLUDE_DIR NAMES quazip.h HINTS ${QUAZIP_LIBRARY_DIR}/../ PATH_SUFFIXES include/quazip5)
|
||||
FIND_PATH(QUAZIP_ZLIB_INCLUDE_DIR NAMES zlib.h)
|
||||
ELSE(WIN32)
|
||||
FIND_PACKAGE(PkgConfig)
|
||||
@@ -28,12 +25,12 @@ ELSE (QUAZIP_INCLUDE_DIRS AND QUAZIP_LIBRARIES)
|
||||
pkg_check_modules(PC_QUAZIP quazip)
|
||||
FIND_LIBRARY(QUAZIP_LIBRARIES
|
||||
WIN32_DEBUG_POSTFIX d
|
||||
NAMES quazip${QUAZIP_LIB_VERSION_SUFFIX}
|
||||
NAMES quazip5
|
||||
HINTS /usr/lib /usr/lib64
|
||||
)
|
||||
FIND_PATH(QUAZIP_INCLUDE_DIR quazip.h
|
||||
HINTS /usr/include /usr/local/include
|
||||
PATH_SUFFIXES quazip${QUAZIP_LIB_VERSION_SUFFIX}
|
||||
PATH_SUFFIXES quazip5
|
||||
)
|
||||
FIND_PATH(QUAZIP_ZLIB_INCLUDE_DIR zlib.h HINTS /usr/include /usr/local/include)
|
||||
ENDIF (WIN32)
|
||||
|
@@ -1,89 +1,90 @@
|
||||
# - Try to find the Taglib library
|
||||
# Once done this will define
|
||||
#.rst:
|
||||
# FindTaglib
|
||||
# ----------
|
||||
#
|
||||
# TAGLIB_FOUND - system has the taglib library
|
||||
# TAGLIB_CFLAGS - the taglib cflags
|
||||
# TAGLIB_LIBRARIES - The libraries needed to use taglib
|
||||
|
||||
# Copyright (c) 2006, Laurent Montel, <montel@kde.org>
|
||||
# Try to find the Taglib library.
|
||||
#
|
||||
# Redistribution and use is allowed according to the terms of the BSD license.
|
||||
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
|
||||
# This will define the following variables:
|
||||
#
|
||||
# ``Taglib_FOUND``
|
||||
# True if the system has the taglib library of at least the minimum
|
||||
# version specified by the version parameter to find_package()
|
||||
# ``Taglib_INCLUDE_DIRS``
|
||||
# The taglib include dirs for use with target_include_directories
|
||||
# ``Taglib_LIBRARIES``
|
||||
# The taglib libraries for use with target_link_libraries()
|
||||
# ``Taglib_VERSION``
|
||||
# The version of taglib that was found
|
||||
#
|
||||
# If ``Taglib_FOUND`` is TRUE, it will also define the following imported
|
||||
# target:
|
||||
#
|
||||
# ``Taglib::Taglib``
|
||||
# The Taglib library
|
||||
#
|
||||
# Since 5.72.0
|
||||
#
|
||||
# SPDX-FileCopyrightText: 2006 Laurent Montel <montel@kde.org>
|
||||
# SPDX-FileCopyrightText: 2019 Heiko Becker <heirecka@exherbo.org>
|
||||
# SPDX-FileCopyrightText: 2020 Elvis Angelaccio <elvis.angelaccio@kde.org>
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
IF(TAGLIB_FOUND)
|
||||
MESSAGE(STATUS "Using manually specified taglib locations")
|
||||
ELSE()
|
||||
find_package(PkgConfig QUIET)
|
||||
|
||||
if(NOT TAGLIB_MIN_VERSION)
|
||||
set(TAGLIB_MIN_VERSION "1.6")
|
||||
endif(NOT TAGLIB_MIN_VERSION)
|
||||
pkg_search_module(PC_TAGLIB QUIET taglib)
|
||||
|
||||
if(NOT WIN32)
|
||||
find_program(TAGLIBCONFIG_EXECUTABLE NAMES taglib-config PATHS
|
||||
${BIN_INSTALL_DIR}
|
||||
)
|
||||
endif(NOT WIN32)
|
||||
find_path(Taglib_INCLUDE_DIRS
|
||||
NAMES tag.h
|
||||
PATH_SUFFIXES taglib
|
||||
HINTS ${PC_TAGLIB_INCLUDEDIR}
|
||||
)
|
||||
|
||||
#reset vars
|
||||
set(TAGLIB_LIBRARIES)
|
||||
set(TAGLIB_CFLAGS)
|
||||
find_library(Taglib_LIBRARIES
|
||||
NAMES tag
|
||||
HINTS ${PC_TAGLIB_LIBDIR}
|
||||
)
|
||||
|
||||
# MESSAGE( STATUS "PATHS: ${PATHS}")
|
||||
# if taglib-config has been found
|
||||
if(TAGLIBCONFIG_EXECUTABLE)
|
||||
set(Taglib_VERSION ${PC_TAGLIB_VERSION})
|
||||
|
||||
exec_program(${TAGLIBCONFIG_EXECUTABLE} ARGS --version RETURN_VALUE _return_VALUE OUTPUT_VARIABLE TAGLIB_VERSION)
|
||||
if (Taglib_INCLUDE_DIRS AND NOT Taglib_VERSION)
|
||||
if(EXISTS "${Taglib_INCLUDE_DIRS}/taglib.h")
|
||||
file(READ "${Taglib_INCLUDE_DIRS}/taglib.h" TAGLIB_H)
|
||||
|
||||
if(TAGLIB_VERSION VERSION_LESS "${TAGLIB_MIN_VERSION}")
|
||||
message(STATUS "TagLib version not found: version searched :${TAGLIB_MIN_VERSION}, found ${TAGLIB_VERSION}")
|
||||
set(TAGLIB_FOUND FALSE)
|
||||
else(TAGLIB_VERSION VERSION_LESS "${TAGLIB_MIN_VERSION}")
|
||||
string(REGEX MATCH "#define TAGLIB_MAJOR_VERSION[ ]+[0-9]+" TAGLIB_MAJOR_VERSION_MATCH ${TAGLIB_H})
|
||||
string(REGEX MATCH "#define TAGLIB_MINOR_VERSION[ ]+[0-9]+" TAGLIB_MINOR_VERSION_MATCH ${TAGLIB_H})
|
||||
string(REGEX MATCH "#define TAGLIB_PATCH_VERSION[ ]+[0-9]+" TAGLIB_PATCH_VERSION_MATCH ${TAGLIB_H})
|
||||
|
||||
exec_program(${TAGLIBCONFIG_EXECUTABLE} ARGS --libs RETURN_VALUE _return_VALUE OUTPUT_VARIABLE TAGLIB_LIBRARIES)
|
||||
string(REGEX REPLACE ".*_MAJOR_VERSION[ ]+(.*)" "\\1" TAGLIB_MAJOR_VERSION "${TAGLIB_MAJOR_VERSION_MATCH}")
|
||||
string(REGEX REPLACE ".*_MINOR_VERSION[ ]+(.*)" "\\1" TAGLIB_MINOR_VERSION "${TAGLIB_MINOR_VERSION_MATCH}")
|
||||
string(REGEX REPLACE ".*_PATCH_VERSION[ ]+(.*)" "\\1" TAGLIB_PATCH_VERSION "${TAGLIB_PATCH_VERSION_MATCH}")
|
||||
|
||||
exec_program(${TAGLIBCONFIG_EXECUTABLE} ARGS --cflags RETURN_VALUE _return_VALUE OUTPUT_VARIABLE TAGLIB_CFLAGS)
|
||||
set(Taglib_VERSION "${TAGLIB_MAJOR_VERSION}.${TAGLIB_MINOR_VERSION}.${TAGLIB_PATCH_VERSION}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(TAGLIB_LIBRARIES AND TAGLIB_CFLAGS)
|
||||
set(TAGLIB_FOUND TRUE)
|
||||
# message(STATUS "Found taglib: ${TAGLIB_LIBRARIES}")
|
||||
endif(TAGLIB_LIBRARIES AND TAGLIB_CFLAGS)
|
||||
string(REGEX REPLACE " *-I" ";" TAGLIB_INCLUDES "${TAGLIB_CFLAGS}")
|
||||
endif(TAGLIB_VERSION VERSION_LESS "${TAGLIB_MIN_VERSION}")
|
||||
mark_as_advanced(TAGLIB_CFLAGS TAGLIB_LIBRARIES TAGLIB_INCLUDES)
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(Taglib
|
||||
FOUND_VAR
|
||||
Taglib_FOUND
|
||||
REQUIRED_VARS
|
||||
Taglib_LIBRARIES
|
||||
Taglib_INCLUDE_DIRS
|
||||
VERSION_VAR
|
||||
Taglib_VERSION
|
||||
)
|
||||
|
||||
else(TAGLIBCONFIG_EXECUTABLE)
|
||||
if (Taglib_FOUND AND NOT TARGET Taglib::Taglib)
|
||||
add_library(Taglib::Taglib UNKNOWN IMPORTED)
|
||||
set_target_properties(Taglib::Taglib PROPERTIES
|
||||
IMPORTED_LOCATION "${Taglib_LIBRARIES}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${Taglib_INCLUDE_DIRS}"
|
||||
)
|
||||
endif()
|
||||
|
||||
include(FindLibraryWithDebug)
|
||||
include(FindPackageHandleStandardArgs)
|
||||
mark_as_advanced(Taglib_LIBRARIES Taglib_INCLUDE_DIRS)
|
||||
|
||||
find_path(TAGLIB_INCLUDES
|
||||
NAMES
|
||||
tag.h
|
||||
PATH_SUFFIXES taglib
|
||||
PATHS
|
||||
${KDE4_INCLUDE_DIR}
|
||||
${INCLUDE_INSTALL_DIR}
|
||||
)
|
||||
|
||||
find_library_with_debug(TAGLIB_LIBRARIES
|
||||
WIN32_DEBUG_POSTFIX d
|
||||
NAMES tag
|
||||
PATHS
|
||||
${KDE4_LIB_DIR}
|
||||
${LIB_INSTALL_DIR}
|
||||
)
|
||||
|
||||
find_package_handle_standard_args(Taglib DEFAULT_MSG
|
||||
TAGLIB_INCLUDES TAGLIB_LIBRARIES)
|
||||
endif(TAGLIBCONFIG_EXECUTABLE)
|
||||
ENDIF()
|
||||
|
||||
if(TAGLIB_FOUND)
|
||||
if(NOT Taglib_FIND_QUIETLY AND TAGLIBCONFIG_EXECUTABLE)
|
||||
message(STATUS "Found TagLib: ${TAGLIB_LIBRARIES}")
|
||||
endif(NOT Taglib_FIND_QUIETLY AND TAGLIBCONFIG_EXECUTABLE)
|
||||
else(TAGLIB_FOUND)
|
||||
if(Taglib_FIND_REQUIRED)
|
||||
message(FATAL_ERROR "Could not find Taglib")
|
||||
endif(Taglib_FIND_REQUIRED)
|
||||
endif(TAGLIB_FOUND)
|
||||
include(FeatureSummary)
|
||||
set_package_properties(Taglib PROPERTIES
|
||||
URL "https://taglib.org/"
|
||||
DESCRIPTION "A library for reading and editing the meta-data of audio formats"
|
||||
)
|
||||
|
@@ -2,25 +2,14 @@
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
|
||||
if( NOT BUILD_WITH_QT4 )
|
||||
find_package(TelepathyQt5 NO_MODULE)
|
||||
set(TelepathyQt_FOUND ${TelepathyQt5_FOUND})
|
||||
set(TELEPATHY_QT_VERSION ${TELEPATHY_QT5_VERSION})
|
||||
set(TELEPATHY_QT_INSTALL_DIR ${TELEPATHY_QT5_INSTALL_DIR})
|
||||
set(TELEPATHY_QT_INCLUDE_DIR ${TELEPATHY_QT5_INCLUDE_DIR})
|
||||
set(TELEPATHY_QT_LIB_DIR ${TELEPATHY_QT5_LIB_DIR})
|
||||
set(TELEPATHY_QT_SHARE_DIR ${TELEPATHY_QT5_SHARE_DIR})
|
||||
set(TELEPATHY_QT_LIBRARIES ${TELEPATHY_QT5_LIBRARIES})
|
||||
else()
|
||||
find_package(TelepathyQt4 NO_MODULE)
|
||||
set(TelepathyQt_FOUND ${TelepathyQt4_FOUND})
|
||||
set(TELEPATHY_QT_VERSION ${TELEPATHY_QT4_VERSION})
|
||||
set(TELEPATHY_QT_INSTALL_DIR ${TELEPATHY_QT4_INSTALL_DIR})
|
||||
set(TELEPATHY_QT_INCLUDE_DIR ${TELEPATHY_QT4_INCLUDE_DIR})
|
||||
set(TELEPATHY_QT_LIB_DIR ${TELEPATHY_QT4_LIB_DIR})
|
||||
set(TELEPATHY_QT_SHARE_DIR ${TELEPATHY_QT4_SHARE_DIR})
|
||||
set(TELEPATHY_QT_LIBRARIES ${TELEPATHY_QT4_LIBRARIES})
|
||||
endif()
|
||||
find_package(TelepathyQt5 NO_MODULE)
|
||||
set(TelepathyQt_FOUND ${TelepathyQt5_FOUND})
|
||||
set(TELEPATHY_QT_VERSION ${TELEPATHY_QT5_VERSION})
|
||||
set(TELEPATHY_QT_INSTALL_DIR ${TELEPATHY_QT5_INSTALL_DIR})
|
||||
set(TELEPATHY_QT_INCLUDE_DIR ${TELEPATHY_QT5_INCLUDE_DIR})
|
||||
set(TELEPATHY_QT_LIB_DIR ${TELEPATHY_QT5_LIB_DIR})
|
||||
set(TELEPATHY_QT_SHARE_DIR ${TELEPATHY_QT5_SHARE_DIR})
|
||||
set(TELEPATHY_QT_LIBRARIES ${TELEPATHY_QT5_LIBRARIES})
|
||||
|
||||
set(TELEPATHY_QT_FOUND ${TelepathyQt_FOUND})
|
||||
|
||||
|
@@ -1,182 +0,0 @@
|
||||
# - Define GNU standard installation directories
|
||||
# Provides install directory variables as defined for GNU software:
|
||||
# http://www.gnu.org/prep/standards/html_node/Directory-Variables.html
|
||||
# Inclusion of this module defines the following variables:
|
||||
# CMAKE_INSTALL_<dir> - destination for files of a given type
|
||||
# CMAKE_INSTALL_FULL_<dir> - corresponding absolute path
|
||||
# where <dir> is one of:
|
||||
# BINDIR - user executables (bin)
|
||||
# SBINDIR - system admin executables (sbin)
|
||||
# LIBEXECDIR - program executables (libexec)
|
||||
# SYSCONFDIR - read-only single-machine data (etc)
|
||||
# SHAREDSTATEDIR - modifiable architecture-independent data (com)
|
||||
# LOCALSTATEDIR - modifiable single-machine data (var)
|
||||
# LIBDIR - object code libraries (lib or lib64)
|
||||
# INCLUDEDIR - C header files (include)
|
||||
# OLDINCLUDEDIR - C header files for non-gcc (/usr/include)
|
||||
# DATAROOTDIR - read-only architecture-independent data root (share)
|
||||
# DATADIR - read-only architecture-independent data (DATAROOTDIR)
|
||||
# INFODIR - info documentation (DATAROOTDIR/info)
|
||||
# LOCALEDIR - locale-dependent data (DATAROOTDIR/locale)
|
||||
# MANDIR - man documentation (DATAROOTDIR/man)
|
||||
# DOCDIR - documentation root (DATAROOTDIR/doc/PROJECT_NAME)
|
||||
# Each CMAKE_INSTALL_<dir> value may be passed to the DESTINATION options of
|
||||
# install() commands for the corresponding file type. If the includer does
|
||||
# not define a value the above-shown default will be used and the value will
|
||||
# appear in the cache for editing by the user.
|
||||
# Each CMAKE_INSTALL_FULL_<dir> value contains an absolute path constructed
|
||||
# from the corresponding destination by prepending (if necessary) the value
|
||||
# of CMAKE_INSTALL_PREFIX.
|
||||
|
||||
#=============================================================================
|
||||
# Copyright 2011 Nikita Krupen'ko <krnekit@gmail.com>
|
||||
# Copyright 2011 Kitware, Inc.
|
||||
#
|
||||
# Distributed under the OSI-approved BSD License (the "License");
|
||||
# see accompanying file Copyright.txt for details.
|
||||
#
|
||||
# This software is distributed WITHOUT ANY WARRANTY; without even the
|
||||
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
# See the License for more information.
|
||||
#=============================================================================
|
||||
# (To distribute this file outside of CMake, substitute the full
|
||||
# License text for the above reference.)
|
||||
|
||||
# Installation directories
|
||||
#
|
||||
if(NOT DEFINED CMAKE_INSTALL_BINDIR)
|
||||
set(CMAKE_INSTALL_BINDIR "bin" CACHE PATH "user executables (bin)")
|
||||
endif()
|
||||
|
||||
if(NOT DEFINED CMAKE_INSTALL_SBINDIR)
|
||||
set(CMAKE_INSTALL_SBINDIR "sbin" CACHE PATH "system admin executables (sbin)")
|
||||
endif()
|
||||
|
||||
if(NOT DEFINED CMAKE_INSTALL_LIBEXECDIR)
|
||||
set(CMAKE_INSTALL_LIBEXECDIR "libexec" CACHE PATH "program executables (libexec)")
|
||||
endif()
|
||||
|
||||
if(NOT DEFINED CMAKE_INSTALL_SYSCONFDIR)
|
||||
set(CMAKE_INSTALL_SYSCONFDIR "etc" CACHE PATH "read-only single-machine data (etc)")
|
||||
endif()
|
||||
|
||||
if(NOT DEFINED CMAKE_INSTALL_SHAREDSTATEDIR)
|
||||
set(CMAKE_INSTALL_SHAREDSTATEDIR "com" CACHE PATH "modifiable architecture-independent data (com)")
|
||||
endif()
|
||||
|
||||
if(NOT DEFINED CMAKE_INSTALL_LOCALSTATEDIR)
|
||||
set(CMAKE_INSTALL_LOCALSTATEDIR "var" CACHE PATH "modifiable single-machine data (var)")
|
||||
endif()
|
||||
|
||||
if(NOT DEFINED CMAKE_INSTALL_LIBDIR)
|
||||
set(_LIBDIR_DEFAULT "lib")
|
||||
# Override this default 'lib' with 'lib64' iff:
|
||||
# - we are on Linux system but NOT cross-compiling
|
||||
# - we are NOT on debian
|
||||
# - we are on a 64 bits system
|
||||
# reason is: amd64 ABI: http://www.x86-64.org/documentation/abi.pdf
|
||||
# Note that the future of multi-arch handling may be even
|
||||
# more complicated than that: http://wiki.debian.org/Multiarch
|
||||
if(CMAKE_SYSTEM_NAME MATCHES "Linux"
|
||||
AND NOT CMAKE_CROSSCOMPILING
|
||||
AND NOT EXISTS "/etc/debian_version")
|
||||
if(NOT DEFINED CMAKE_SIZEOF_VOID_P)
|
||||
message(AUTHOR_WARNING
|
||||
"Unable to determine default CMAKE_INSTALL_LIBDIR directory because no target architecture is known. "
|
||||
"Please enable at least one language before including GNUInstallDirs.")
|
||||
else()
|
||||
if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
|
||||
set(_LIBDIR_DEFAULT "lib64")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
set(CMAKE_INSTALL_LIBDIR "${_LIBDIR_DEFAULT}" CACHE PATH "object code libraries (${_LIBDIR_DEFAULT})")
|
||||
endif()
|
||||
|
||||
if(NOT DEFINED CMAKE_INSTALL_INCLUDEDIR)
|
||||
set(CMAKE_INSTALL_INCLUDEDIR "include" CACHE PATH "C header files (include)")
|
||||
endif()
|
||||
|
||||
if(NOT DEFINED CMAKE_INSTALL_OLDINCLUDEDIR)
|
||||
set(CMAKE_INSTALL_OLDINCLUDEDIR "/usr/include" CACHE PATH "C header files for non-gcc (/usr/include)")
|
||||
endif()
|
||||
|
||||
if(NOT DEFINED CMAKE_INSTALL_DATAROOTDIR)
|
||||
set(CMAKE_INSTALL_DATAROOTDIR "share" CACHE PATH "read-only architecture-independent data root (share)")
|
||||
endif()
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Values whose defaults are relative to DATAROOTDIR. Store empty values in
|
||||
# the cache and store the defaults in local variables if the cache values are
|
||||
# not set explicitly. This auto-updates the defaults as DATAROOTDIR changes.
|
||||
|
||||
if(NOT CMAKE_INSTALL_DATADIR)
|
||||
set(CMAKE_INSTALL_DATADIR "" CACHE PATH "read-only architecture-independent data (DATAROOTDIR)")
|
||||
set(CMAKE_INSTALL_DATADIR "${CMAKE_INSTALL_DATAROOTDIR}")
|
||||
endif()
|
||||
|
||||
if(NOT CMAKE_INSTALL_INFODIR)
|
||||
set(CMAKE_INSTALL_INFODIR "" CACHE PATH "info documentation (DATAROOTDIR/info)")
|
||||
set(CMAKE_INSTALL_INFODIR "${CMAKE_INSTALL_DATAROOTDIR}/info")
|
||||
endif()
|
||||
|
||||
if(NOT CMAKE_INSTALL_LOCALEDIR)
|
||||
set(CMAKE_INSTALL_LOCALEDIR "" CACHE PATH "locale-dependent data (DATAROOTDIR/locale)")
|
||||
set(CMAKE_INSTALL_LOCALEDIR "${CMAKE_INSTALL_DATAROOTDIR}/locale")
|
||||
endif()
|
||||
|
||||
if(NOT CMAKE_INSTALL_MANDIR)
|
||||
set(CMAKE_INSTALL_MANDIR "" CACHE PATH "man documentation (DATAROOTDIR/man)")
|
||||
set(CMAKE_INSTALL_MANDIR "${CMAKE_INSTALL_DATAROOTDIR}/man")
|
||||
endif()
|
||||
|
||||
if(NOT CMAKE_INSTALL_DOCDIR)
|
||||
set(CMAKE_INSTALL_DOCDIR "" CACHE PATH "documentation root (DATAROOTDIR/doc/PROJECT_NAME)")
|
||||
set(CMAKE_INSTALL_DOCDIR "${CMAKE_INSTALL_DATAROOTDIR}/doc/${PROJECT_NAME}")
|
||||
endif()
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
mark_as_advanced(
|
||||
CMAKE_INSTALL_BINDIR
|
||||
CMAKE_INSTALL_SBINDIR
|
||||
CMAKE_INSTALL_LIBEXECDIR
|
||||
CMAKE_INSTALL_SYSCONFDIR
|
||||
CMAKE_INSTALL_SHAREDSTATEDIR
|
||||
CMAKE_INSTALL_LOCALSTATEDIR
|
||||
CMAKE_INSTALL_LIBDIR
|
||||
CMAKE_INSTALL_INCLUDEDIR
|
||||
CMAKE_INSTALL_OLDINCLUDEDIR
|
||||
CMAKE_INSTALL_DATAROOTDIR
|
||||
CMAKE_INSTALL_DATADIR
|
||||
CMAKE_INSTALL_INFODIR
|
||||
CMAKE_INSTALL_LOCALEDIR
|
||||
CMAKE_INSTALL_MANDIR
|
||||
CMAKE_INSTALL_DOCDIR
|
||||
)
|
||||
|
||||
# Result directories
|
||||
#
|
||||
foreach(dir
|
||||
BINDIR
|
||||
SBINDIR
|
||||
LIBEXECDIR
|
||||
SYSCONFDIR
|
||||
SHAREDSTATEDIR
|
||||
LOCALSTATEDIR
|
||||
LIBDIR
|
||||
INCLUDEDIR
|
||||
OLDINCLUDEDIR
|
||||
DATAROOTDIR
|
||||
DATADIR
|
||||
INFODIR
|
||||
LOCALEDIR
|
||||
MANDIR
|
||||
DOCDIR
|
||||
)
|
||||
if(NOT IS_ABSOLUTE ${CMAKE_INSTALL_${dir}})
|
||||
set(CMAKE_INSTALL_FULL_${dir} "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_${dir}}")
|
||||
else()
|
||||
set(CMAKE_INSTALL_FULL_${dir} "${CMAKE_INSTALL_${dir}}")
|
||||
endif()
|
||||
endforeach()
|
@@ -93,7 +93,7 @@ MACRO(MACRO_LOG_FEATURE _var _package _description _url ) # _required _minvers _
|
||||
FILE(APPEND "${_LOGFILENAME}" "${_logtext}\n")
|
||||
|
||||
IF(COMMAND SET_PACKAGE_INFO) # in FeatureSummary.cmake since CMake 2.8.3
|
||||
SET_PACKAGE_INFO("${_package}" "\"${_description}\"" "${_url}" "\"${_comments}\"")
|
||||
SET_PACKAGE_PROPERTIES("${_package}" PROPERTIES DESCRIPTION "\"${_description}\"" URL "${_url}" PURPOSE "\"${_comments}\"")
|
||||
ENDIF(COMMAND SET_PACKAGE_INFO)
|
||||
|
||||
ENDMACRO(MACRO_LOG_FEATURE)
|
||||
|
2
Docker/Docker.variables
Normal file
2
Docker/Docker.variables
Normal file
@@ -0,0 +1,2 @@
|
||||
DOCKER_IMAGE_NAME=tomahawkmusicplayer/ubuntu
|
||||
DOCKER_IMAGE_VER=latest
|
149
Docker/Dockerfile
Normal file
149
Docker/Dockerfile
Normal file
@@ -0,0 +1,149 @@
|
||||
FROM ubuntu:19.04 as base
|
||||
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y --no-install-recommends \
|
||||
build-essential \
|
||||
ca-certificates \
|
||||
ninja-build \
|
||||
openssh-client \
|
||||
curl \
|
||||
gnupg2 \
|
||||
gosu \
|
||||
wget \
|
||||
locales \
|
||||
git \
|
||||
subversion \
|
||||
make \
|
||||
pkg-config \
|
||||
unzip \
|
||||
xz-utils \
|
||||
software-properties-common \
|
||||
sudo \
|
||||
apt-utils \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# LLVM/Clang
|
||||
ENV CLANG_VERSION=9
|
||||
RUN wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - \
|
||||
&& apt-add-repository "deb http://apt.llvm.org/disco/ llvm-toolchain-disco-$CLANG_VERSION main" \
|
||||
&& apt-get update && apt-get install -y \
|
||||
clang-$CLANG_VERSION \
|
||||
clang-tidy-$CLANG_VERSION \
|
||||
clang-format-$CLANG_VERSION \
|
||||
llvm-$CLANG_VERSION-dev \
|
||||
libclang-$CLANG_VERSION-dev \
|
||||
&& update-alternatives \
|
||||
--install /usr/bin/clang clang /usr/bin/clang-$CLANG_VERSION 100 \
|
||||
--slave /usr/bin/clang++ clang++ /usr/bin/clang++-$CLANG_VERSION \
|
||||
--slave /usr/bin/clang-tidy clang-tidy /usr/bin/clang-tidy-$CLANG_VERSION \
|
||||
--slave /usr/bin/clang-format clang-format /usr/bin/clang-format-$CLANG_VERSION
|
||||
|
||||
# GCC
|
||||
ENV GCC_VERSION=9
|
||||
RUN sudo apt-get update \
|
||||
&& sudo apt-get install -y --no-install-recommends \
|
||||
g++-$GCC_VERSION \
|
||||
gcc-$GCC_VERSION \
|
||||
&& sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 100 --slave /usr/bin/g++ g++ /usr/bin/g++-9 --slave /usr/bin/gcov gcov /usr/bin/gcov-9
|
||||
|
||||
# Tomahawk deps
|
||||
RUN sudo apt-get update \
|
||||
&& apt-get install -y --no-install-recommends \
|
||||
cmake \
|
||||
libattica-dev \
|
||||
libboost-dev \
|
||||
libboost-filesystem-dev \
|
||||
libboost-iostreams-dev \
|
||||
libboost-thread-dev \
|
||||
libfftw3-dev \
|
||||
libgnutls28-dev \
|
||||
libgsasl7-dev \
|
||||
liblastfm-dev \
|
||||
liblastfm5-dev \
|
||||
liblucene++-dev \
|
||||
libphonon-dev \
|
||||
libphononexperimental-dev \
|
||||
libqca-qt5-2-dev \
|
||||
libqca2-dev \
|
||||
libqca2-plugins \
|
||||
libqjson-dev \
|
||||
libqt5svg5-dev \
|
||||
libqt5webkit5-dev \
|
||||
libqt5webkit5\
|
||||
libsamplerate0-dev \
|
||||
libsparsehash-dev \
|
||||
libssl-dev \
|
||||
libtelepathy-qt5-dev \
|
||||
libvlc-dev \
|
||||
libvlccore-dev \
|
||||
libx11-dev \
|
||||
libz-dev \
|
||||
qt5-default \
|
||||
qtbase5-dev \
|
||||
qttools5-dev \
|
||||
qttools5-dev-tools \
|
||||
zlib1g-dev \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
RUN git clone --depth 1 https://github.com/zaphoyd/websocketpp.git --branch master --single-branch websocketpp \
|
||||
&& mkdir websocketpp/build && cd websocketpp/build \
|
||||
&& cmake .. \
|
||||
&& sudo cmake --build . -j 16 --target install \
|
||||
&& cd ../.. \
|
||||
&& rm -r websocketpp
|
||||
|
||||
RUN git clone --depth 1 https://github.com/frankosterfeld/qtkeychain.git --branch master --single-branch qtkeychain \
|
||||
&& mkdir qtkeychain/build && cd qtkeychain/build \
|
||||
&& cmake .. \
|
||||
&& sudo cmake --build . -j 16 --target install \
|
||||
&& cd ../.. \
|
||||
&& rm -r qtkeychain
|
||||
|
||||
RUN git clone --depth 1 https://github.com/taglib/taglib.git --branch master --single-branch taglib \
|
||||
&& mkdir taglib/build && cd taglib/build \
|
||||
&& cmake -DCMAKE_INSTALL_PREFIX=/usr \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DBUILD_SHARED_LIBS=ON .. \
|
||||
&& sudo cmake --build . -j 16 --target install \
|
||||
&& cd ../.. \
|
||||
&& rm -r taglib
|
||||
|
||||
RUN git clone --depth 1 https://anongit.kde.org/extra-cmake-modules.git --branch master --single-branch ecm \
|
||||
&& mkdir ecm/build && cd ecm/build \
|
||||
&& cmake -DCMAKE_BUILD_TYPE=Release .. \
|
||||
&& sudo cmake --build . -j 16 --target install \
|
||||
&& cd ../.. \
|
||||
&& rm -r ecm
|
||||
|
||||
RUN git clone --depth 1 https://github.com/KDE/attica.git --branch master --single-branch attica \
|
||||
&& mkdir attica/build && cd attica/build \
|
||||
&& cmake -DCMAKE_BUILD_TYPE=Release .. \
|
||||
&& sudo cmake --build . -j 16 --target install \
|
||||
&& cd ../.. \
|
||||
&& rm -r attica
|
||||
|
||||
RUN git clone --depth 1 https://github.com/stachenov/quazip.git --branch master --single-branch quazip \
|
||||
&& mkdir quazip/build && cd quazip/build \
|
||||
&& cmake -DCMAKE_BUILD_TYPE=Release .. \
|
||||
&& sudo cmake --build . -j 16 --target install \
|
||||
&& cd ../.. \
|
||||
&& rm -r quazip
|
||||
|
||||
RUN git clone --depth 1 https://github.com/euroelessar/jreen.git --branch master --single-branch jreen \
|
||||
&& mkdir jreen/build && cd jreen/build \
|
||||
&& cmake -DCMAKE_BUILD_TYPE=Release .. \
|
||||
&& sudo cmake --build . -j 16 --target install \
|
||||
&& cd ../.. \
|
||||
&& rm -r jreen
|
||||
|
||||
# Language
|
||||
ENV LANG=en_US.UTF-8
|
||||
RUN echo "$LANG UTF-8" > /etc/locale.gen && locale-gen $LANG && update-locale LANG=$LANG
|
||||
|
||||
#entrypoint, if it is last here makes it easy to build new image without rebuilding all layers
|
||||
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
|
||||
COPY build-and-test.sh /usr/local/bin/build-and-test.sh
|
||||
RUN chmod +x /usr/local/bin/build-and-test.sh
|
||||
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
|
||||
|
||||
WORKDIR /tmp/workspace
|
8
Docker/build-and-test.sh
Executable file
8
Docker/build-and-test.sh
Executable file
@@ -0,0 +1,8 @@
|
||||
#!/bin/bash
|
||||
|
||||
mkdir build
|
||||
cd build
|
||||
cmake -G Ninja -DCMAKE_BUILD_TYPE=${BUILD_TYPE:-Debug} ..
|
||||
ninja
|
||||
ninja install
|
||||
env CTEST_OUTPUT_ON_FAILURE=1 ninja test
|
79
Docker/docker-commands.sh
Executable file
79
Docker/docker-commands.sh
Executable file
@@ -0,0 +1,79 @@
|
||||
#!/bin/bash
|
||||
|
||||
get_repository_root(){
|
||||
local REPOSITORY_ROOT="$(git rev-parse --show-toplevel)"
|
||||
echo "$REPOSITORY_ROOT"
|
||||
}
|
||||
|
||||
get_repository_subdir(){
|
||||
REPOSITORY_ROOT=$(get_repository_root)
|
||||
CUR_DIR=$(pwd)
|
||||
SUB_DIR=$(echo "$CUR_DIR" | grep -oP "^$REPOSITORY_ROOT\K.*")
|
||||
echo "$SUB_DIR"
|
||||
}
|
||||
|
||||
# Run commands inside docker container
|
||||
_docker_run() {
|
||||
REPOSITORY_ROOT=$(get_repository_root)
|
||||
SUB_DIR=$(get_repository_subdir)
|
||||
|
||||
echo "SUB_DIR: " "$SUB_DIR"
|
||||
|
||||
source $REPOSITORY_ROOT/Docker/Docker.variables
|
||||
echo "Starting container: " "$DOCKER_IMAGE_NAME:$DOCKER_IMAGE_VER"
|
||||
|
||||
echo "Got command: " "$*"
|
||||
USER_ID=$(id -u $USER)
|
||||
echo "Using USER_ID:" $USER_ID
|
||||
|
||||
docker run --env LOCAL_USER_ID=$USER_ID \
|
||||
--rm \
|
||||
--volume $REPOSITORY_ROOT:/tmp/workspace \
|
||||
--workdir /tmp/workspace$SUB_DIR \
|
||||
--env "TERM=xterm-256color" \
|
||||
--tty \
|
||||
--privileged \
|
||||
"$DOCKER_IMAGE_NAME:$DOCKER_IMAGE_VER" \
|
||||
$*
|
||||
}
|
||||
|
||||
# 1st command: Run make target inside docker
|
||||
docker-make() {
|
||||
_docker_run make "${@}"
|
||||
}
|
||||
|
||||
# 2nd command: Run bash command inside docker
|
||||
docker-run() {
|
||||
_docker_run "${@}"
|
||||
}
|
||||
|
||||
# 3rd command: Run bash interactive inside docker
|
||||
docker-interactive() {
|
||||
REPOSITORY_ROOT=$(get_repository_root)
|
||||
SUB_DIR=$(get_repository_subdir)
|
||||
|
||||
echo "SUB_DIR: " "$SUB_DIR"
|
||||
|
||||
source $REPOSITORY_ROOT/Docker/Docker.variables
|
||||
echo "Starting container: " "$DOCKER_IMAGE_NAME:$DOCKER_IMAGE_VER"
|
||||
|
||||
echo "Got command: " "$*"
|
||||
USER_ID=$(id -u $USER)
|
||||
echo "Using USER_ID:" $USER_ID
|
||||
|
||||
docker run --env LOCAL_USER_ID=$USER_ID \
|
||||
--rm \
|
||||
--interactive \
|
||||
--volume $REPOSITORY_ROOT:/tmp/workspace \
|
||||
--workdir /tmp/workspace$SUB_DIR \
|
||||
--env "TERM=xterm-256color" \
|
||||
--tty \
|
||||
"$DOCKER_IMAGE_NAME:$DOCKER_IMAGE_VER" /bin/bash
|
||||
}
|
||||
|
||||
docker-help() {
|
||||
echo "docker-make - Run a make target inside docker container"
|
||||
echo "docker-run - Run a specific bash command inside docker container and remove container on exit"
|
||||
echo "docker-interactive - Start an interactive bash session inside docker container and remove it on exit"
|
||||
echo "docker-help - Show this help text"
|
||||
}
|
30
Docker/entrypoint.sh
Executable file
30
Docker/entrypoint.sh
Executable file
@@ -0,0 +1,30 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Add local user
|
||||
# Either use the LOCAL_USER_ID if passed in at runtime or
|
||||
# fallback
|
||||
USER_ID=${LOCAL_USER_ID:-9001}
|
||||
USER=docker
|
||||
UPWD=Docker!
|
||||
|
||||
echo "Starting with USER: $USER and UID : $USER_ID"
|
||||
useradd --shell /bin/bash -u $USER_ID -o -c "docker user" -m "$USER"
|
||||
export HOME=/home/$USER
|
||||
|
||||
# Add user to sudoers
|
||||
echo "docker ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/10-installer
|
||||
# Add root password
|
||||
echo "root":$UPWD | chpasswd
|
||||
# Add user password
|
||||
echo "$USER:$UPWD" | chpasswd
|
||||
|
||||
if [ -z "$CLANG_VERSION" ]; then
|
||||
echo "No CLANG_VERSION set"
|
||||
else
|
||||
echo "alias clang=clang-$CLANG_VERSION" >> $HOME/.bashrc
|
||||
echo "alias clang-tidy=clang-tidy-$CLANG_VERSION" >> $HOME/.bashrc
|
||||
echo "alias clang-format=clang-format-$CLANG_VERSION" >> $HOME/.bashrc
|
||||
fi
|
||||
|
||||
# Startup user
|
||||
exec gosu "$USER" "$@"
|
@@ -39,18 +39,10 @@ Tomahawk provides some tools that help highlight where crashes (of course we onl
|
||||
|
||||
Build the account plugin for Hatchet (http://hatchet.is). Requires [websocketpp](https://github.com/zaphoyd/websocketpp).
|
||||
|
||||
##### ```BUILD_WITH_QT4``` (boolean) (default: ON)
|
||||
|
||||
This enforces CMake to link against Qt4 regardless of whether Qt5 was found or not. Currently Qt4 is still our main development target, so this is still recommended. If you feel adventurous or are preparing Qt5 repositories for your distribution, feel free to give ```-DBUILD_WITH_QT4=OFF``` a shot.
|
||||
|
||||
##### ```WITH_CRASHREPORTER``` (boolean) (default: ON)
|
||||
|
||||
The crash reporter is built by default if libcrashreporter-qt is available in ```thirdparty/libcrashreporter-qt/``` (for example via git submodule). Usually distributions don't allow packagers to upload debug symbols to the Tomahawk HQ so to give crash reports more meaning for us, that's why we have no standardised submit process in place yet. If you can do that in your distribution, please get in touch with us!
|
||||
|
||||
##### ```WITH_KDE``` (boolean) (default: ON)
|
||||
|
||||
The KDE Telepathy plugin to configure Telepathy accounts from our Telepathy plugin can be disabled, if for some reason KDE is available in your build environment but you don't need this plugin.
|
||||
|
||||
##### ```WITH_UPOWER``` (boolean) (default on Linux: ON)
|
||||
|
||||
Build with support for UPower events.
|
||||
|
17
README.md
17
README.md
@@ -1,3 +1,7 @@
|
||||
# This project is essentially abandoned
|
||||
There is no one working on it.
|
||||
There isn't much sense in adding any new issues in the issue tracker unless you want to fix them yourself.
|
||||
|
||||
# WHAT TOMAHAWK IS
|
||||
|
||||
Tomahawk is a free multi-source and cross-platform music player. An application that can play not only your local files, but also stream from services like Spotify, Beats, SoundCloud, Google Music, YouTube and many others. You can even connect with your friends' Tomahawks, share your musical gems or listen along with them. Let the music play!
|
||||
@@ -63,23 +67,22 @@ You can download one of our nightly or stable builds:
|
||||
|
||||
### Detailed Build Instructions
|
||||
|
||||
| Linux: | [Arch](http://wiki.tomahawk-player.org/index.php/Building_ArchLinux_package) **-** [Debian](http://wiki.tomahawk-player.org/index.php/Building_on_Debian) **-** [Fedora](http://wiki.tomahawk-player.org/index.php/Building_on_Fedora) **-** [openSUSE](http://wiki.tomahawk-player.org/index.php/Building_on_openSUSE) **-** [Ubuntu](http://wiki.tomahawk-player.org/index.php/Building_on_Ubuntu) |
|
||||
| Linux: | [Arch](https://github.com/tomahawk-player/tomahawk/wiki/ArchLinux---Build-Instructions) **-** [Debian](https://github.com/tomahawk-player/tomahawk/wiki/Debian-Build-Instructions) **-** [Fedora](https://github.com/tomahawk-player/tomahawk/wiki/Fedora-Build-Instructions) **-** [Ubuntu](https://github.com/tomahawk-player/tomahawk/wiki/Ubuntu---Build-Instructions) |
|
||||
|------:|:------|
|
||||
| **Windows**: | [**Windows**](http://wiki.tomahawk-player.org/index.php/Building_Windows_Binary) |
|
||||
| **Mac**: | [**OS X**](http://wiki.tomahawk-player.org/index.php/Building_OS_X_Application_Bundle) |
|
||||
| **Windows**: | [**Windows**](https://github.com/tomahawk-player/tomahawk/wiki/Windows-Build-Instructions) |
|
||||
| **Mac**: | [**OS X**](https://github.com/tomahawk-player/tomahawk/wiki/OS-X---Build-Instructions) |
|
||||
|
||||
### Dependencies
|
||||
|
||||
Required dependencies:
|
||||
|
||||
* [CMake 3](http://www.cmake.org/)
|
||||
* [Qt 5.4.0](http://qt-project.org/)
|
||||
* [Qt >= 5.4.0](http://qt-project.org/)
|
||||
* [VLC 2.1.0](https://videolan.org/vlc/)
|
||||
* [SQLite 3.6.22](http://www.sqlite.org/)
|
||||
* [TagLib 1.8](https://taglib.github.io/)
|
||||
* [Boost 1.3](http://www.boost.org/)
|
||||
* [Lucene++ 3.0.6](https://github.com/luceneplusplus/LucenePlusPlus/)
|
||||
* [libechonest 2.3.1](http://projects.kde.org/projects/playground/libs/libechonest/)
|
||||
* [Attica 5.6.0](http://ftp.kde.org/stable/attica/)
|
||||
* [QuaZip 0.4.3](http://quazip.sourceforge.net/)
|
||||
* [liblastfm 1.0.9](https://github.com/lastfm/liblastfm/)
|
||||
@@ -87,6 +90,10 @@ Required dependencies:
|
||||
* [Sparsehash](https://code.google.com/p/sparsehash/)
|
||||
* [GnuTLS](http://gnutls.org/)
|
||||
|
||||
If you are using Qt>5.6 you need to build and install QtWebKit
|
||||
|
||||
* [QtWebKit](https://github.com/qt/qtwebkit)
|
||||
|
||||
The following dependencies are optional (but *recommended*):
|
||||
|
||||
* [Jreen 1.1.1](http://qutim.org/jreen/)
|
||||
|
@@ -25,13 +25,13 @@ function(tomahawk_add_library)
|
||||
include_directories(${CMAKE_CURRENT_BINARY_DIR})
|
||||
|
||||
if(LIBRARY_UI)
|
||||
qt_wrap_ui(LIBRARY_UI_SOURCES ${LIBRARY_UI})
|
||||
qt5_wrap_ui(LIBRARY_UI_SOURCES ${LIBRARY_UI})
|
||||
list(APPEND LIBRARY_SOURCES ${LIBRARY_UI_SOURCES})
|
||||
endif()
|
||||
|
||||
# add resources from current dir
|
||||
if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/resources.qrc")
|
||||
qt_add_resources(LIBRARY_RC_SOURCES "resources.qrc")
|
||||
qt5_add_resources(LIBRARY_RC_SOURCES "resources.qrc")
|
||||
list(APPEND LIBRARY_SOURCES ${LIBRARY_RC_SOURCES})
|
||||
unset(LIBRARY_RC_SOURCES)
|
||||
endif()
|
||||
@@ -45,9 +45,6 @@ function(tomahawk_add_library)
|
||||
add_library(${target} SHARED ${LIBRARY_SOURCES})
|
||||
endif()
|
||||
|
||||
# HACK: add qt modules - every lib should define its own set of modules
|
||||
qt5_use_modules(${target} Core Network Widgets Sql Xml ${LIBRARY_QT5_MODULES})
|
||||
|
||||
# definitions - can this be moved into set_target_properties below?
|
||||
add_definitions(${QT_DEFINITIONS})
|
||||
set_target_properties(${target} PROPERTIES AUTOMOC TRUE)
|
||||
@@ -70,12 +67,12 @@ function(tomahawk_add_library)
|
||||
endif()
|
||||
|
||||
# add link targets
|
||||
target_link_libraries(${target} ${TOMAHAWK_LIBRARIES})
|
||||
target_link_libraries(${target} PRIVATE ${TOMAHAWK_LIBRARIES})
|
||||
if(LIBRARY_LINK_LIBRARIES)
|
||||
target_link_libraries(${target} ${LIBRARY_LINK_LIBRARIES})
|
||||
target_link_libraries(${target} PUBLIC ${LIBRARY_LINK_LIBRARIES})
|
||||
endif()
|
||||
if(LIBRARY_LINK_PRIVATE_LIBRARIES)
|
||||
target_link_libraries(${target} LINK_PRIVATE ${LIBRARY_LINK_PRIVATE_LIBRARIES})
|
||||
target_link_libraries(${target} PRIVATE ${LIBRARY_LINK_PRIVATE_LIBRARIES})
|
||||
endif()
|
||||
|
||||
# add soversion
|
||||
|
@@ -1,103 +1,3 @@
|
||||
#FIXME: this duplicates top level cmakelists: how can we reduce code duplication?
|
||||
|
||||
set( TOMAHAWK_QT5 @TOMAHAWK_QT5@ )
|
||||
|
||||
if(TOMAHAWK_QT5)
|
||||
# CMAKE 2.8.13+/3.0.0+ requires these for IMPORTed targets
|
||||
find_package(Qt5Core REQUIRED)
|
||||
find_package(Qt5Concurrent REQUIRED)
|
||||
find_package(Qt5Svg REQUIRED)
|
||||
find_package(Qt5UiTools REQUIRED)
|
||||
find_package(Qt5WebKitWidgets REQUIRED)
|
||||
find_package(Qt5Widgets REQUIRED)
|
||||
find_package(Qt5Xml REQUIRED)
|
||||
find_package(Qt5Sql REQUIRED)
|
||||
|
||||
macro(qt_wrap_ui)
|
||||
qt5_wrap_ui(${ARGN})
|
||||
endmacro()
|
||||
|
||||
macro(qt_add_resources)
|
||||
qt5_add_resources(${ARGN})
|
||||
endmacro()
|
||||
|
||||
find_package(Qt5LinguistTools REQUIRED)
|
||||
macro(qt_add_translation)
|
||||
qt5_add_translation(${ARGN})
|
||||
endmacro()
|
||||
|
||||
if( UNIX AND NOT APPLE )
|
||||
# We need this to find the paths to qdbusxml2cpp and co
|
||||
find_package(Qt5DBus REQUIRED)
|
||||
endif()
|
||||
|
||||
if(APPLE)
|
||||
find_package(Qt5MacExtras REQUIRED)
|
||||
endif()
|
||||
|
||||
if(WIN32)
|
||||
find_package(Qt5WinExtras REQUIRED)
|
||||
endif()
|
||||
|
||||
macro(qt_wrap_ui)
|
||||
qt5_wrap_ui(${ARGN})
|
||||
endmacro()
|
||||
|
||||
macro(qt_add_resources)
|
||||
qt5_add_resources(${ARGN})
|
||||
endmacro()
|
||||
|
||||
find_package(Qt5LinguistTools REQUIRED)
|
||||
macro(qt_add_translation)
|
||||
qt5_add_translation(${ARGN})
|
||||
endmacro()
|
||||
|
||||
if( UNIX AND NOT APPLE )
|
||||
macro(qt_add_dbus_interface)
|
||||
qt5_add_dbus_interface(${ARGN})
|
||||
endmacro()
|
||||
|
||||
macro(qt_add_dbus_adaptor)
|
||||
qt5_add_dbus_adaptor(${ARGN})
|
||||
endmacro()
|
||||
endif()
|
||||
|
||||
macro(setup_qt)
|
||||
endmacro()
|
||||
|
||||
set(QT_RCC_EXECUTABLE "${Qt5Core_RCC_EXECUTABLE}")
|
||||
#FIXME: CrashReporter depends on deprecated QHttp
|
||||
set(WITH_KDE4 OFF)
|
||||
|
||||
else(TOMAHAWK_QT5)
|
||||
find_package(Qt4 COMPONENTS QtNetwork QtCore QtGui QtSql REQUIRED)
|
||||
include( ${QT_USE_FILE} )
|
||||
|
||||
set(NEEDED_QT4_COMPONENTS "QtCore" "QtXml" "QtNetwork")
|
||||
if(BUILD_GUI OR NOT DEFINED BUILD_GUI)
|
||||
list(APPEND NEEDED_QT4_COMPONENTS "QtGui" "QtWebkit" "QtUiTools" "QtSvg")
|
||||
endif()
|
||||
|
||||
find_package(Qt4 4.7.0 COMPONENTS ${NEEDED_QT4_COMPONENTS})
|
||||
include( ${QT_USE_FILE} )
|
||||
|
||||
macro(qt5_use_modules)
|
||||
endmacro()
|
||||
|
||||
macro(qt_wrap_ui)
|
||||
qt4_wrap_ui(${ARGN})
|
||||
endmacro()
|
||||
|
||||
macro(qt_add_resources)
|
||||
qt4_add_resources(${ARGN})
|
||||
endmacro()
|
||||
|
||||
macro(qt_add_translation)
|
||||
qt4_add_translation(${ARGN})
|
||||
endmacro()
|
||||
endif(TOMAHAWK_QT5)
|
||||
|
||||
|
||||
if(NOT TOMAHAWK_CMAKE_DIR)
|
||||
set(TOMAHAWK_CMAKE_DIR ${CMAKE_CURRENT_LIST_DIR})
|
||||
endif()
|
||||
|
@@ -1,12 +0,0 @@
|
||||
[Protocol]
|
||||
exec=/path/to/binary "%u"
|
||||
protocol=tomahawk
|
||||
input=none
|
||||
output=none
|
||||
helper=true
|
||||
listing=
|
||||
reading=false
|
||||
writing=false
|
||||
makedir=false
|
||||
deleting=false
|
||||
|
@@ -275,6 +275,9 @@ Tomahawk.Resolver = {
|
||||
getStreamUrl: function (params) {
|
||||
return params;
|
||||
},
|
||||
getDownloadUrl: function (params) {
|
||||
return params;
|
||||
},
|
||||
resolve: function() {
|
||||
},
|
||||
_adapter_resolve: function (params) {
|
||||
@@ -1763,6 +1766,9 @@ Tomahawk.Collection = {
|
||||
this.settings.capabilities = [Tomahawk.Collection.BrowseCapability.Artists,
|
||||
Tomahawk.Collection.BrowseCapability.Albums,
|
||||
Tomahawk.Collection.BrowseCapability.Tracks];
|
||||
if (!this.settings.weight && this.resolver && this.resolver.settings.weight) {
|
||||
this.settings.weight = this.resolver.settings.weight;
|
||||
}
|
||||
return this.settings;
|
||||
},
|
||||
|
||||
@@ -1771,6 +1777,14 @@ Tomahawk.Collection = {
|
||||
return this.resolver.getStreamUrl(params);
|
||||
}
|
||||
|
||||
return params;
|
||||
},
|
||||
|
||||
getDownloadUrl: function(params) {
|
||||
if(this.resolver) {
|
||||
return this.resolver.getDownloadUrl(params);
|
||||
}
|
||||
|
||||
return params;
|
||||
}
|
||||
};
|
||||
|
@@ -19,9 +19,11 @@ macro(add_tomahawk_translations language)
|
||||
set( tomahawk_i18n_qrc_content "${tomahawk_i18n_qrc_content}</qresource>\n" )
|
||||
set( tomahawk_i18n_qrc_content "${tomahawk_i18n_qrc_content}</RCC>\n" )
|
||||
|
||||
file( WRITE ${CMAKE_BINARY_DIR}/lang/tomahawk_i18n.qrc "${tomahawk_i18n_qrc_content}" )
|
||||
# Write file and configure it aferwards to make it a BYPRODUCT: https://gitlab.kitware.com/cmake/cmake/issues/16367
|
||||
file( WRITE ${CMAKE_BINARY_DIR}/lang/tomahawk_i18n.qrc.in "${tomahawk_i18n_qrc_content}" )
|
||||
configure_file(${CMAKE_BINARY_DIR}/lang/tomahawk_i18n.qrc.in ${CMAKE_BINARY_DIR}/lang/tomahawk_i18n.qrc COPYONLY)
|
||||
|
||||
qt_add_translation(QM_FILES ${TS_FILES})
|
||||
qt5_add_translation(QM_FILES ${TS_FILES})
|
||||
|
||||
## HACK HACK HACK - around rcc limitations to allow out of source-tree building
|
||||
set( trans_file tomahawk_i18n )
|
||||
|
@@ -1,7 +1,5 @@
|
||||
include( ${PROJECT_BINARY_DIR}/TomahawkUse.cmake )
|
||||
|
||||
setup_qt()
|
||||
|
||||
include_directories( ${CMAKE_CURRENT_BINARY_DIR}/libtomahawk )
|
||||
include_directories( ${CMAKE_CURRENT_LIST_DIR}/libtomahawk )
|
||||
|
||||
|
@@ -25,11 +25,6 @@
|
||||
#include "utils/Logger.h"
|
||||
#include "TomahawkSettings.h"
|
||||
|
||||
// Forward Declarations breaking QSharedPointer
|
||||
#if QT_VERSION < QT_VERSION_CHECK( 5, 0, 0 )
|
||||
#include "Source.h"
|
||||
#endif
|
||||
|
||||
|
||||
// remove now playing status after PAUSE_TIMEOUT seconds
|
||||
static const int PAUSE_TIMEOUT = 10;
|
||||
|
@@ -44,12 +44,12 @@ namespace Tomahawk {
|
||||
void publishTune( QUrl url, Tomahawk::InfoSystem::InfoStringHash trackInfo );
|
||||
|
||||
public slots:
|
||||
void notInCacheSlot( const Tomahawk::InfoSystem::InfoStringHash criteria, Tomahawk::InfoSystem::InfoRequestData requestData );
|
||||
void notInCacheSlot( const Tomahawk::InfoSystem::InfoStringHash criteria, Tomahawk::InfoSystem::InfoRequestData requestData ) override;
|
||||
|
||||
protected slots:
|
||||
void init();
|
||||
void pushInfo( Tomahawk::InfoSystem::InfoPushData pushData );
|
||||
void getInfo( Tomahawk::InfoSystem::InfoRequestData requestData );
|
||||
void init() override;
|
||||
void pushInfo( Tomahawk::InfoSystem::InfoPushData pushData ) override;
|
||||
void getInfo( Tomahawk::InfoSystem::InfoRequestData requestData ) override;
|
||||
|
||||
private slots:
|
||||
void audioStarted( const Tomahawk::InfoSystem::PushInfoPair& pushInfoPair );
|
||||
|
@@ -66,29 +66,6 @@ using namespace Accounts;
|
||||
#define TOMAHAWK_CAP_NODE_NAME QLatin1String( "http://tomahawk-player.org/" )
|
||||
|
||||
|
||||
#if QT_VERSION <= QT_VERSION_CHECK( 5, 0, 0 )
|
||||
void
|
||||
JreenMessageHandler( QtMsgType type, const char *msg )
|
||||
{
|
||||
switch ( type )
|
||||
{
|
||||
case QtDebugMsg:
|
||||
tDebug( LOGTHIRDPARTY ).nospace() << JREEN_LOG_INFIX << ":" << "Debug:" << msg;
|
||||
break;
|
||||
case QtWarningMsg:
|
||||
tDebug( LOGTHIRDPARTY ).nospace() << JREEN_LOG_INFIX << ":" << "Warning:" << msg;
|
||||
break;
|
||||
case QtCriticalMsg:
|
||||
tDebug( LOGTHIRDPARTY ).nospace() << JREEN_LOG_INFIX << ":" << "Critical:" << msg;
|
||||
break;
|
||||
case QtFatalMsg:
|
||||
tDebug( LOGTHIRDPARTY ).nospace() << JREEN_LOG_INFIX << ":" << "Fatal:" << msg;
|
||||
abort();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
XmppSipPlugin::XmppSipPlugin( Account* account )
|
||||
: SipPlugin( account )
|
||||
, m_state( Account::Disconnected )
|
||||
@@ -96,9 +73,6 @@ XmppSipPlugin::XmppSipPlugin( Account* account )
|
||||
, m_xmlConsole( nullptr )
|
||||
, m_pubSubManager( nullptr )
|
||||
{
|
||||
#if QT_VERSION <= QT_VERSION_CHECK( 5, 0, 0 )
|
||||
Jreen::Logger::addHandler( JreenMessageHandler );
|
||||
#endif
|
||||
|
||||
m_currentUsername = readUsername();
|
||||
m_currentServer = readServer();
|
||||
|
@@ -54,14 +54,14 @@ public:
|
||||
Account::ConnectionState connectionState() const;
|
||||
|
||||
public slots:
|
||||
void connectPlugin();
|
||||
void disconnectPlugin();
|
||||
void connectPlugin() override;
|
||||
void disconnectPlugin() override;
|
||||
|
||||
void advertise();
|
||||
|
||||
virtual void sendSipInfos( const Tomahawk::peerinfo_ptr& /* receiver */, const QList<SipInfo>& /* info */ ) {}
|
||||
virtual void sendSipInfos( const Tomahawk::peerinfo_ptr& /* receiver */, const QList<SipInfo>& /* info */ ) override {}
|
||||
void broadcastMsg( const QString& ) {}
|
||||
bool addContact( const QString&, AddContactOptions, const QString& ) { return false; }
|
||||
bool addContact( const QString&, AddContactOptions, const QString& ) override { return false; }
|
||||
|
||||
private slots:
|
||||
void lanHostFound( const QString& host, int port, const QString& name, const QString& nodeid );
|
||||
|
@@ -3,13 +3,11 @@ cmake_policy(SET CMP0017 NEW)
|
||||
|
||||
set(TOMAHAWK_CRASH_REPORTER_TARGET ${TOMAHAWK_BASE_TARGET_NAME}_crash_reporter)
|
||||
|
||||
setup_qt()
|
||||
|
||||
list(APPEND crashreporter_SOURCES main.cpp)
|
||||
list(APPEND crashreporter_RC resources.qrc)
|
||||
|
||||
qt_wrap_ui( crashreporter_UI_HEADERS ${crashreporter_UI} )
|
||||
qt_add_resources( crashreporter_RC_RCC ${crashreporter_RC} )
|
||||
qt5_wrap_ui( crashreporter_UI_HEADERS ${crashreporter_UI} )
|
||||
qt5_add_resources( crashreporter_RC_RCC ${crashreporter_RC} )
|
||||
|
||||
|
||||
if(BUILD_RELEASE)
|
||||
@@ -43,7 +41,7 @@ target_link_libraries( ${TOMAHAWK_CRASH_REPORTER_TARGET}
|
||||
${QT_LIBRARIES}
|
||||
)
|
||||
|
||||
target_link_libraries(${TOMAHAWK_CRASH_REPORTER_TARGET} Qt5::Widgets Qt5::Network)
|
||||
|
||||
set_target_properties(${TOMAHAWK_CRASH_REPORTER_TARGET} PROPERTIES AUTOMOC ON)
|
||||
install(TARGETS ${TOMAHAWK_CRASH_REPORTER_TARGET} RUNTIME DESTINATION ${CMAKE_INSTALL_LIBEXECDIR})
|
||||
|
||||
qt5_use_modules(${TOMAHAWK_CRASH_REPORTER_TARGET} Widgets Network)
|
||||
|
@@ -1,5 +1,4 @@
|
||||
include_directories(
|
||||
${ECHONEST_INCLUDE_DIR}
|
||||
${Boost_INCLUDE_DIR}
|
||||
)
|
||||
if(WIN32 OR APPLE)
|
||||
@@ -15,14 +14,13 @@ endif()
|
||||
endif(WIN32 OR APPLE)
|
||||
|
||||
list(APPEND simple_plugins
|
||||
Echonest
|
||||
Charts
|
||||
NewReleases
|
||||
Spotify
|
||||
#Spotify
|
||||
Hypem
|
||||
MusixMatch
|
||||
MusicBrainz
|
||||
Rovi
|
||||
#Rovi
|
||||
Discogs
|
||||
)
|
||||
|
||||
|
@@ -23,11 +23,7 @@
|
||||
#include "utils/Logger.h"
|
||||
#include "utils/NetworkAccessManager.h"
|
||||
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5,0,0)
|
||||
#include <echonest5/ArtistTypes.h>
|
||||
#else
|
||||
#include <echonest/ArtistTypes.h>
|
||||
#endif
|
||||
|
||||
#include <QNetworkConfiguration>
|
||||
|
||||
|
@@ -25,11 +25,7 @@
|
||||
#include "infosystem/InfoSystem.h"
|
||||
#include "infosystem/InfoSystemWorker.h"
|
||||
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5,0,0)
|
||||
#include <echonest5/Artist.h>
|
||||
#else
|
||||
#include <echonest/Artist.h>
|
||||
#endif
|
||||
|
||||
#include <QObject>
|
||||
|
||||
|
@@ -22,6 +22,7 @@
|
||||
#include "utils/TomahawkUtils.h"
|
||||
#include "utils/Logger.h"
|
||||
#include "utils/NetworkAccessManager.h"
|
||||
#include "TomahawkVersion.h"
|
||||
|
||||
#include <QNetworkReply>
|
||||
#include <QDomDocument>
|
||||
@@ -88,6 +89,16 @@ MusicBrainzPlugin::getInfo( Tomahawk::InfoSystem::InfoRequestData requestData )
|
||||
}
|
||||
}
|
||||
|
||||
QNetworkReply*
|
||||
MusicBrainzPlugin::getUrl(QUrl url, QVariant requestData)
|
||||
{
|
||||
QNetworkRequest request = QNetworkRequest( url );
|
||||
QByteArray userAgent = TomahawkUtils::userAgentString( TOMAHAWK_APPLICATION_NAME, TOMAHAWK_VERSION ).toUtf8();
|
||||
request.setRawHeader( "User-Agent", userAgent );
|
||||
QNetworkReply* reply = Tomahawk::Utils::nam()->get( request );
|
||||
reply->setProperty( "requestData", requestData );
|
||||
return reply;
|
||||
}
|
||||
|
||||
void
|
||||
MusicBrainzPlugin::notInCacheSlot( InfoStringHash criteria, InfoRequestData requestData )
|
||||
@@ -111,8 +122,7 @@ MusicBrainzPlugin::notInCacheSlot( InfoStringHash criteria, InfoRequestData requ
|
||||
TomahawkUtils::urlAddQueryItem( url, "limit", "100" );
|
||||
|
||||
tDebug() << Q_FUNC_INFO << url.toString();
|
||||
QNetworkReply* reply = Tomahawk::Utils::nam()->get( QNetworkRequest( url ) );
|
||||
reply->setProperty( "requestData", QVariant::fromValue< Tomahawk::InfoSystem::InfoRequestData >( requestData ) );
|
||||
QNetworkReply* reply = getUrl( url, QVariant::fromValue< Tomahawk::InfoSystem::InfoRequestData >( requestData ) );
|
||||
|
||||
connect( reply, SIGNAL( finished() ), SLOT( gotReleaseGroupsSlot() ) );
|
||||
|
||||
@@ -131,8 +141,7 @@ MusicBrainzPlugin::notInCacheSlot( InfoStringHash criteria, InfoRequestData requ
|
||||
TomahawkUtils::urlAddQueryItem( url, "limit", "100" );
|
||||
|
||||
tDebug() << Q_FUNC_INFO << url.toString();
|
||||
QNetworkReply* reply = Tomahawk::Utils::nam()->get( QNetworkRequest( url ) );
|
||||
reply->setProperty( "requestData", QVariant::fromValue< Tomahawk::InfoSystem::InfoRequestData >( requestData ) );
|
||||
QNetworkReply* reply = getUrl( url, QVariant::fromValue< Tomahawk::InfoSystem::InfoRequestData >( requestData ) );
|
||||
|
||||
connect( reply, SIGNAL( finished() ), SLOT( gotReleasesSlot() ) );
|
||||
|
||||
@@ -154,6 +163,7 @@ MusicBrainzPlugin::gotReleaseGroupsSlot()
|
||||
if ( !oldReply )
|
||||
return; //timeout will handle it
|
||||
oldReply->deleteLater();
|
||||
tDebug() << Q_FUNC_INFO << "HTTP response code:" << oldReply->attribute( QNetworkRequest::HttpStatusCodeAttribute ).toInt();
|
||||
|
||||
QDomDocument doc;
|
||||
doc.setContent( oldReply->readAll() );
|
||||
@@ -237,8 +247,7 @@ MusicBrainzPlugin::gotReleasesSlot()
|
||||
TomahawkUtils::urlAddQueryItem( url, "inc", "recordings" );
|
||||
tDebug() << Q_FUNC_INFO << url.toString();
|
||||
|
||||
QNetworkReply* newReply = Tomahawk::Utils::nam()->get( QNetworkRequest( url ) );
|
||||
newReply->setProperty( "requestData", oldReply->property( "requestData" ) );
|
||||
QNetworkReply* newReply = getUrl( url, oldReply->property( "requestData" ) );
|
||||
connect( newReply, SIGNAL( finished() ), SLOT( gotRecordingsSlot() ) );
|
||||
|
||||
break;
|
||||
@@ -261,6 +270,8 @@ MusicBrainzPlugin::gotRecordingsSlot()
|
||||
return; //timeout will handle it
|
||||
reply->deleteLater();
|
||||
|
||||
tDebug() << Q_FUNC_INFO << "HTTP response code:" << reply->attribute( QNetworkRequest::HttpStatusCodeAttribute ).toInt();
|
||||
|
||||
QDomDocument doc;
|
||||
doc.setContent( reply->readAll() );
|
||||
QDomNodeList mediumList = doc.elementsByTagName( "medium-list" );
|
||||
|
@@ -59,6 +59,7 @@ private slots:
|
||||
void gotReleaseGroupsSlot();
|
||||
void gotReleasesSlot();
|
||||
void gotRecordingsSlot();
|
||||
QNetworkReply* getUrl( QUrl url, QVariant requestData );
|
||||
};
|
||||
|
||||
}
|
||||
|
@@ -51,7 +51,7 @@ SnoreNotifyPlugin::SnoreNotifyPlugin()
|
||||
|
||||
Snore::SnoreCore &snore = Snore::SnoreCore::instance();
|
||||
snore.loadPlugins( Snore::SnorePlugin::Backend | Snore::SnorePlugin::SecondaryBackend );
|
||||
snore.setDefaultSettingsValue("Silent", true, Snore::LocalSetting );
|
||||
snore.setDefaultSettingsValue( {QStringLiteral("Silent"), Snore::LocalSetting}, true );
|
||||
|
||||
m_application = Snore::Application( qApp->applicationName(), m_defaultIcon );
|
||||
m_application.hints().setValue( "use-markup", true );
|
||||
|
@@ -2,13 +2,14 @@ SET(fdo_srcs
|
||||
fdonotify/FdoNotifyPlugin.cpp
|
||||
fdonotify/ImageConverter.cpp
|
||||
)
|
||||
SET(FDO_LINK_LIBRARIES ${LINK_LIBRARIES})
|
||||
qt_add_dbus_interface(fdo_srcs fdonotify/org.freedesktop.Notifications.xml
|
||||
SET(FDO_LINK_LIBRARIES ${LINK_LIBRARIES} Qt5::DBus)
|
||||
qt5_add_dbus_interface(fdo_srcs fdonotify/org.freedesktop.Notifications.xml
|
||||
FreedesktopNotificationsProxy)
|
||||
|
||||
tomahawk_add_plugin(fdonotify
|
||||
TYPE infoplugin EXPORT_MACRO INFOPLUGINDLLEXPORT_PRO
|
||||
SOURCES "${fdo_srcs}" LINK_LIBRARIES "${FDO_LINK_LIBRARIES}"
|
||||
SOURCES "${fdo_srcs}"
|
||||
LINK_LIBRARIES "${FDO_LINK_LIBRARIES}"
|
||||
)
|
||||
|
||||
INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_SOURCE_DIR} )
|
||||
@@ -16,9 +17,9 @@ SET(mpris_srcs
|
||||
mpris/MprisPlugin.cpp
|
||||
)
|
||||
|
||||
qt_add_dbus_adaptor(mpris_srcs mpris/MprisPluginRootAdaptor.xml
|
||||
qt5_add_dbus_adaptor(mpris_srcs mpris/MprisPluginRootAdaptor.xml
|
||||
mpris/MprisPlugin.h Tomahawk::InfoSystem::MprisPlugin MprisPluginRootAdaptor MprisPluginRootAdaptor)
|
||||
qt_add_dbus_adaptor(mpris_srcs mpris/MprisPluginPlayerAdaptor.xml
|
||||
qt5_add_dbus_adaptor(mpris_srcs mpris/MprisPluginPlayerAdaptor.xml
|
||||
mpris/MprisPlugin.h Tomahawk::InfoSystem::MprisPlugin MprisPluginPlayerAdaptor MprisPluginPlayerAdaptor)
|
||||
|
||||
tomahawk_add_plugin(mpris
|
||||
|
@@ -55,11 +55,6 @@
|
||||
#include <QDBusPendingCallWatcher>
|
||||
#include <QImage>
|
||||
|
||||
#if QT_VERSION < QT_VERSION_CHECK( 5, 0, 0 )
|
||||
// QTextDocument provides Qt::escape()
|
||||
#include <QTextDocument>
|
||||
#endif
|
||||
|
||||
namespace Tomahawk
|
||||
{
|
||||
|
||||
@@ -67,11 +62,7 @@ namespace InfoSystem
|
||||
{
|
||||
|
||||
QString escapeHtml( const QString& str ) {
|
||||
#if QT_VERSION >= QT_VERSION_CHECK( 5, 0, 0 )
|
||||
return str.toHtmlEscaped();
|
||||
#else
|
||||
return Qt::escape( str );
|
||||
#endif
|
||||
}
|
||||
|
||||
FdoNotifyPlugin::FdoNotifyPlugin()
|
||||
@@ -80,7 +71,7 @@ FdoNotifyPlugin::FdoNotifyPlugin()
|
||||
, m_wmSupportsBodyMarkup( false )
|
||||
{
|
||||
tDebug( LOGVERBOSE ) << Q_FUNC_INFO;
|
||||
m_supportedPushTypes << InfoNotifyUser << InfoNowPlaying << InfoTrackUnresolved << InfoNowStopped << InfoInboxReceived;
|
||||
m_supportedPushTypes << InfoNotifyUser << InfoNowPlaying << InfoNowResumed << InfoTrackUnresolved << InfoNowStopped << InfoInboxReceived;
|
||||
|
||||
// Query the window manager for its capabilties in styling notifications.
|
||||
notifications_interface = new org::freedesktop::Notifications( "org.freedesktop.Notifications", "/org/freedesktop/Notifications",
|
||||
@@ -139,6 +130,7 @@ FdoNotifyPlugin::pushInfo( Tomahawk::InfoSystem::InfoPushData pushData )
|
||||
return;
|
||||
|
||||
case Tomahawk::InfoSystem::InfoNowPlaying:
|
||||
case Tomahawk::InfoSystem::InfoNowResumed:
|
||||
nowPlaying( pushData.infoPair.second );
|
||||
return;
|
||||
|
||||
|
@@ -27,12 +27,6 @@
|
||||
|
||||
#include "../../InfoPluginDllMacro.h"
|
||||
|
||||
// Forward Declarations breaking QSharedPointer
|
||||
#if QT_VERSION < QT_VERSION_CHECK( 5, 0, 0 )
|
||||
#include "PlaylistInterface.h"
|
||||
#endif
|
||||
|
||||
|
||||
#include <QObject>
|
||||
#include <QVariant>
|
||||
#include <QtDBus/QtDBus>
|
||||
|
@@ -64,7 +64,7 @@ PlaylistDelegate::PlaylistDelegate()
|
||||
void
|
||||
PlaylistDelegate::paint( QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index ) const
|
||||
{
|
||||
QStyleOptionViewItemV4 opt = option;
|
||||
QStyleOptionViewItem opt = option;
|
||||
initStyleOption( &opt, QModelIndex() );
|
||||
qApp->style()->drawControl( QStyle::CE_ItemViewItem, &opt, painter );
|
||||
|
||||
|
@@ -30,11 +30,6 @@
|
||||
|
||||
#include <QCoreApplication>
|
||||
|
||||
// Forward Declarations breaking QSharedPointer
|
||||
#if QT_VERSION < QT_VERSION_CHECK( 5, 0, 0 )
|
||||
#include "Query.h"
|
||||
#endif
|
||||
|
||||
|
||||
ActionCollection* ActionCollection::s_instance = 0;
|
||||
ActionCollection* ActionCollection::instance()
|
||||
@@ -120,9 +115,12 @@ ActionCollection::initActions()
|
||||
m_actionCollection[ "createPlaylist" ] = new QAction( tr( "Create Playlist" ), this );
|
||||
m_actionCollection[ "createPlaylist" ]->setShortcut( QKeySequence( "Ctrl+N" ) );
|
||||
m_actionCollection[ "createPlaylist" ]->setShortcutContext( Qt::ApplicationShortcut );
|
||||
// echonest is dead, disable stations
|
||||
/*
|
||||
m_actionCollection[ "createStation" ] = new QAction( tr( "Create Station" ), this );
|
||||
m_actionCollection[ "createStation" ]->setShortcut( QKeySequence( "Ctrl+S" ) );
|
||||
m_actionCollection[ "createStation" ]->setShortcutContext( Qt::ApplicationShortcut );
|
||||
*/
|
||||
#ifdef Q_OS_MAC
|
||||
m_actionCollection[ "minimize" ] = new QAction( tr( "Minimize" ), this );
|
||||
m_actionCollection[ "minimize" ]->setShortcut( QKeySequence( "Ctrl+M" ) );
|
||||
@@ -171,7 +169,8 @@ ActionCollection::createMenuBar( QWidget *parent )
|
||||
controlsMenu->addAction( m_actionCollection[ "showOfflineSources" ] );
|
||||
controlsMenu->addSeparator();
|
||||
controlsMenu->addAction( m_actionCollection[ "createPlaylist" ] );
|
||||
controlsMenu->addAction( m_actionCollection[ "createStation" ] );
|
||||
// echonest is dead, disable stations
|
||||
// controlsMenu->addAction( m_actionCollection[ "createStation" ] );
|
||||
controlsMenu->addAction( m_actionCollection[ "importPlaylist" ] );
|
||||
controlsMenu->addAction( m_actionCollection[ "updateCollection" ] );
|
||||
controlsMenu->addAction( m_actionCollection[ "rescanCollection" ] );
|
||||
|
@@ -25,11 +25,6 @@
|
||||
#include <QPixmap>
|
||||
#include <QFuture>
|
||||
|
||||
// Forward Declarations breaking QSharedPointer
|
||||
#if QT_VERSION < QT_VERSION_CHECK( 5, 0, 0 )
|
||||
#include "collection/Collection.h"
|
||||
#endif
|
||||
|
||||
#include "infosystem/InfoSystem.h"
|
||||
#include "DllMacro.h"
|
||||
#include "Typedefs.h"
|
||||
|
@@ -74,9 +74,6 @@ set( libGuiSources
|
||||
playlist/dynamic/DynamicPlaylist.cpp
|
||||
playlist/dynamic/DynamicView.cpp
|
||||
playlist/dynamic/DynamicModel.cpp
|
||||
playlist/dynamic/echonest/EchonestGenerator.cpp
|
||||
playlist/dynamic/echonest/EchonestControl.cpp
|
||||
playlist/dynamic/echonest/EchonestSteerer.cpp
|
||||
playlist/dynamic/widgets/DynamicWidget.cpp
|
||||
playlist/dynamic/widgets/DynamicControlWrapper.cpp
|
||||
playlist/dynamic/widgets/DynamicControlList.cpp
|
||||
@@ -176,14 +173,6 @@ if(QCA2_FOUND)
|
||||
set( libGuiSources ${libGuiSources} utils/GroovesharkParser.cpp )
|
||||
endif()
|
||||
|
||||
if(UNIX AND NOT APPLE AND NOT Qt5Core_DIR)
|
||||
if(BUILD_GUI AND X11_FOUND)
|
||||
include_directories( ${THIRDPARTY_DIR}/libqnetwm )
|
||||
list(APPEND libSources ${libSources} ${THIRDPARTY_DIR}/libqnetwm/libqnetwm/netwm.cpp)
|
||||
list(APPEND LINK_LIBRARIES ${X11_LIBRARIES})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
list(APPEND libSources
|
||||
TomahawkSettings.cpp
|
||||
SourceList.cpp
|
||||
@@ -208,7 +197,6 @@ list(APPEND libSources
|
||||
PlaylistInterface.cpp
|
||||
UrlHandler.cpp
|
||||
|
||||
EchonestCatalogSynchronizer.cpp
|
||||
|
||||
accounts/AccountManager.cpp
|
||||
accounts/Account.cpp
|
||||
@@ -413,7 +401,6 @@ include_directories(
|
||||
|
||||
${QT_INCLUDE_DIR}
|
||||
${QJSON_INCLUDE_DIR}
|
||||
${ECHONEST_INCLUDE_DIR}
|
||||
${LUCENEPP_INCLUDE_DIRS}
|
||||
${LIBVLC_INCLUDE_DIR}
|
||||
${Boost_INCLUDE_DIR}
|
||||
@@ -427,9 +414,7 @@ IF(LIBATTICA_FOUND)
|
||||
SET( libGuiSources ${libGuiSources} AtticaManager.cpp )
|
||||
INCLUDE_DIRECTORIES( ${LIBATTICA_INCLUDE_DIR} )
|
||||
LIST(APPEND PRIVATE_LINK_LIBRARIES ${LIBATTICA_LIBRARIES} ${LibAttica_LIBRARIES} ${QUAZIP_LIBRARIES})
|
||||
IF( TOMAHAWK_QT5 )
|
||||
LIST(APPEND LINK_LIBRARIES KF5::Attica )
|
||||
ENDIF( TOMAHAWK_QT5 )
|
||||
LIST(APPEND LINK_LIBRARIES KF5::Attica)
|
||||
ENDIF(LIBATTICA_FOUND)
|
||||
|
||||
if(HAVE_X11)
|
||||
@@ -491,7 +476,7 @@ IF(BUILD_GUI)
|
||||
LIST(APPEND libSources ${libGuiSources} )
|
||||
ENDIF()
|
||||
|
||||
qt_wrap_ui(libUI_H ${libUI})
|
||||
qt5_wrap_ui(libUI_H ${libUI})
|
||||
|
||||
SET( libSources ${libSources} ${libUI_H} )
|
||||
|
||||
@@ -505,12 +490,12 @@ set_target_properties(
|
||||
OUTPUT_NAME ${TOMAHAWK_BASE_TARGET_NAME}
|
||||
)
|
||||
|
||||
|
||||
qt5_use_modules(${TOMAHAWK_LIBRARY} Widgets Network Sql WebKitWidgets Concurrent Xml UiTools Svg)
|
||||
IF(APPLE)
|
||||
qt5_use_modules(${TOMAHAWK_LIBRARY} MacExtras)
|
||||
ENDIF()
|
||||
|
||||
target_link_libraries(${TOMAHAWK_LIBRARY} PUBLIC
|
||||
Qt5::Widgets Qt5::Network Qt5::Sql Qt5::WebKitWidgets Qt5::Concurrent Qt5::Xml Qt5::UiTools Qt5::Svg
|
||||
)
|
||||
if(APPLE)
|
||||
target_link_libraries(${TOMAHAWK_LIBRARY} PRIVATE Qt5::MacExtras)
|
||||
endif()
|
||||
|
||||
IF(QCA2_FOUND)
|
||||
INCLUDE_DIRECTORIES( ${QCA2_INCLUDE_DIR} )
|
||||
@@ -519,11 +504,9 @@ ENDIF(QCA2_FOUND)
|
||||
|
||||
IF( UNIX AND NOT APPLE )
|
||||
LIST(APPEND LINK_LIBRARIES ${QT_QTDBUS_LIBRARIES} )
|
||||
qt5_use_modules(${TOMAHAWK_LIBRARY} DBus)
|
||||
ENDIF( UNIX AND NOT APPLE )
|
||||
|
||||
TARGET_LINK_LIBRARIES( ${TOMAHAWK_LIBRARY}
|
||||
LINK_PRIVATE
|
||||
TARGET_LINK_LIBRARIES(${TOMAHAWK_LIBRARY} PRIVATE
|
||||
${LIBVLC_LIBRARY}
|
||||
|
||||
# Thirdparty shipped with tomahawk
|
||||
@@ -531,11 +514,10 @@ TARGET_LINK_LIBRARIES( ${TOMAHAWK_LIBRARY}
|
||||
${QTKEYCHAIN_LIBRARIES}
|
||||
${PRIVATE_LINK_LIBRARIES}
|
||||
|
||||
LINK_PUBLIC
|
||||
PUBLIC
|
||||
# External deps
|
||||
${QJSON_LIBRARIES}
|
||||
${LUCENEPP_LIBRARIES}
|
||||
${ECHONEST_LIBRARIES}
|
||||
${QT_QTSQL_LIBRARY}
|
||||
${QT_QTUITOOLS_LIBRARY}
|
||||
${QT_QTGUI_LIBRARY}
|
||||
@@ -551,8 +533,13 @@ TARGET_LINK_LIBRARIES( ${TOMAHAWK_LIBRARY}
|
||||
)
|
||||
|
||||
# TagLib
|
||||
TARGET_LINK_LIBRARIES(${TOMAHAWK_LIBRARY} LINK_PUBLIC ${TAGLIB_LIBRARIES})
|
||||
TARGET_INCLUDE_DIRECTORIES(${TOMAHAWK_LIBRARY} PUBLIC ${TAGLIB_INCLUDES})
|
||||
target_link_libraries(${TOMAHAWK_LIBRARY} LINK_PUBLIC Taglib::Taglib)
|
||||
# Necessary workaround until we can depend on >1.11.1
|
||||
if (NOT Taglib_VERSION VERSION_GREATER 1.11.1)
|
||||
if(ZLIB_FOUND)
|
||||
target_link_libraries(${TOMAHAWK_LIBRARY} PUBLIC -lz)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
INSTALL( TARGETS ${TOMAHAWK_LIBRARY}
|
||||
EXPORT TomahawkLibraryDepends
|
||||
@@ -579,7 +566,7 @@ file( GLOB networkHeaders "network/*.h" )
|
||||
file( GLOB playlistHeaders "playlist/*.h" )
|
||||
file( GLOB playlistDynamicHeaders "playlist/dynamic/*.h" )
|
||||
file( GLOB playlistDynamicDatabaseHeaders "playlist/dynamic/database/*.h" )
|
||||
file( GLOB playlistDynamicEchonestHeaders "playlist/dynamic/echonest/*.h" )
|
||||
# file( GLOB playlistDynamicEchonestHeaders "playlist/dynamic/echonest/*.h" )
|
||||
file( GLOB playlistDynamicWidgetsHeaders "playlist/dynamic/widgets/*.h" )
|
||||
file( GLOB resolversHeaders "resolvers/*.h" )
|
||||
file( GLOB sipHeaders "sip/*.h" )
|
||||
@@ -608,7 +595,7 @@ install( FILES ${networkHeaders} DESTINATION include/libtomahawk/network )
|
||||
install( FILES ${playlistHeaders} DESTINATION include/libtomahawk/playlist )
|
||||
install( FILES ${playlistDynamicHeaders} DESTINATION include/libtomahawk/playlist/dynamic )
|
||||
install( FILES ${playlistDynamicDatabaseHeaders} DESTINATION include/libtomahawk/playlist/dynamic/database )
|
||||
install( FILES ${playlistDynamicEchonestHeaders} DESTINATION include/libtomahawk/playlist/dynamic/echonest )
|
||||
# install( FILES ${playlistDynamicEchonestHeaders} DESTINATION include/libtomahawk/playlist/dynamic/echonest )
|
||||
install( FILES ${playlistDynamicWidgetsHeaders} DESTINATION include/libtomahawk/playlist/dynamic/widgets )
|
||||
install( FILES ${resolversHeaders} DESTINATION include/libtomahawk/resolvers )
|
||||
install( FILES ${sipHeaders} DESTINATION include/libtomahawk/sip )
|
||||
|
@@ -206,22 +206,17 @@ DownloadJob::download()
|
||||
{
|
||||
if ( m_state == Running )
|
||||
return true;
|
||||
|
||||
setState( Running );
|
||||
|
||||
if ( m_result->resolvedByCollection() )
|
||||
{
|
||||
Tomahawk::ScriptCollection* collection = qobject_cast<Tomahawk::ScriptCollection*>( m_result->resolvedByCollection().data() );
|
||||
if ( collection )
|
||||
{
|
||||
QVariantMap arguments;
|
||||
arguments[ "url" ] = m_format.url;
|
||||
|
||||
// HACK: *shrug* WIP.
|
||||
Tomahawk::ScriptJob* job = collection->scriptObject()->invoke( "getStreamUrl", arguments );
|
||||
connect( job, SIGNAL( done(QVariantMap) ), SLOT( onUrlRetrieved(QVariantMap) ) );
|
||||
job->start();
|
||||
}
|
||||
if (m_result->resolvedBy() != nullptr) {
|
||||
Tomahawk::ScriptJob *job = m_result->resolvedBy()->getDownloadUrl( m_result, m_format );
|
||||
connect( job, SIGNAL( done(QVariantMap) ), SLOT( onUrlRetrieved(QVariantMap) ) );
|
||||
job->start();
|
||||
} else {
|
||||
onUrlRetrieved({{"url", m_format.url}});
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@@ -34,13 +34,8 @@
|
||||
#include "TomahawkSettings.h"
|
||||
#include "Track.h"
|
||||
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5,0,0)
|
||||
#include <echonest5/CatalogUpdateEntry.h>
|
||||
#include <echonest5/Config.h>
|
||||
#else
|
||||
#include <echonest/CatalogUpdateEntry.h>
|
||||
#include <echonest/Config.h>
|
||||
#endif
|
||||
|
||||
using namespace Tomahawk;
|
||||
|
||||
|
@@ -22,11 +22,7 @@
|
||||
#include "DllMacro.h"
|
||||
#include "Query.h"
|
||||
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5,0,0)
|
||||
#include <echonest5/Catalog.h>
|
||||
#else
|
||||
#include <echonest/Catalog.h>
|
||||
#endif
|
||||
|
||||
#include <QObject>
|
||||
#include <QQueue>
|
||||
|
@@ -46,12 +46,6 @@
|
||||
#include "TomahawkSettings.h"
|
||||
#include "ViewManager.h"
|
||||
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5,0,0)
|
||||
#include <echonest5/Playlist.h>
|
||||
#else
|
||||
#include <echonest/Playlist.h>
|
||||
#endif
|
||||
|
||||
#include <QMessageBox>
|
||||
#include <QFileInfo>
|
||||
|
||||
@@ -912,144 +906,144 @@ GlobalActionManager::loadDynamicPlaylist( const QUrl& url, bool station )
|
||||
{
|
||||
dyncontrol_ptr c = pl->generator()->createControl( "Artist" );
|
||||
c->setInput( param.second );
|
||||
c->setMatch( QString::number( (int)Echonest::DynamicPlaylist::ArtistRadioType ) );
|
||||
controls << c;
|
||||
// c->setMatch( QString::number( (int)Echonest::DynamicPlaylist::ArtistRadioType ) );
|
||||
// controls << c;
|
||||
}
|
||||
else if ( param.first == "artist_limitto" )
|
||||
{
|
||||
dyncontrol_ptr c = pl->generator()->createControl( "Artist" );
|
||||
c->setInput( param.second );
|
||||
c->setMatch( QString::number( (int)Echonest::DynamicPlaylist::ArtistType ) );
|
||||
controls << c;
|
||||
// c->setMatch( QString::number( (int)Echonest::DynamicPlaylist::ArtistType ) );
|
||||
// controls << c;
|
||||
}
|
||||
else if ( param.first == "description" )
|
||||
{
|
||||
dyncontrol_ptr c = pl->generator()->createControl( "Artist Description" );
|
||||
c->setInput( param.second );
|
||||
c->setMatch( QString::number( (int)Echonest::DynamicPlaylist::ArtistDescriptionType ) );
|
||||
controls << c;
|
||||
// c->setMatch( QString::number( (int)Echonest::DynamicPlaylist::ArtistDescriptionType ) );
|
||||
// controls << c;
|
||||
}
|
||||
else if ( param.first == "variety" )
|
||||
{
|
||||
dyncontrol_ptr c = pl->generator()->createControl( "Variety" );
|
||||
c->setInput( param.second );
|
||||
c->setMatch( QString::number( (int)Echonest::DynamicPlaylist::Variety ) );
|
||||
controls << c;
|
||||
// c->setMatch( QString::number( (int)Echonest::DynamicPlaylist::Variety ) );
|
||||
// controls << c;
|
||||
}
|
||||
else if ( param.first.startsWith( "tempo" ) )
|
||||
{
|
||||
dyncontrol_ptr c = pl->generator()->createControl( "Tempo" );
|
||||
int extra = param.first.endsWith( "_max" ) ? -1 : 0;
|
||||
c->setInput( param.second );
|
||||
c->setMatch( QString::number( (int)Echonest::DynamicPlaylist::MinTempo + extra ) );
|
||||
controls << c;
|
||||
// c->setMatch( QString::number( (int)Echonest::DynamicPlaylist::MinTempo + extra ) );
|
||||
// controls << c;
|
||||
}
|
||||
else if ( param.first.startsWith( "duration" ) )
|
||||
{
|
||||
dyncontrol_ptr c = pl->generator()->createControl( "Duration" );
|
||||
int extra = param.first.endsWith( "_max" ) ? -1 : 0;
|
||||
c->setInput( param.second );
|
||||
c->setMatch( QString::number( (int)Echonest::DynamicPlaylist::MinDuration + extra ) );
|
||||
controls << c;
|
||||
// c->setMatch( QString::number( (int)Echonest::DynamicPlaylist::MinDuration + extra ) );
|
||||
// controls << c;
|
||||
}
|
||||
else if ( param.first.startsWith( "loudness" ) )
|
||||
{
|
||||
dyncontrol_ptr c = pl->generator()->createControl( "Loudness" );
|
||||
int extra = param.first.endsWith( "_max" ) ? -1 : 0;
|
||||
c->setInput( param.second );
|
||||
c->setMatch( QString::number( (int)Echonest::DynamicPlaylist::MinLoudness + extra ) );
|
||||
controls << c;
|
||||
// c->setMatch( QString::number( (int)Echonest::DynamicPlaylist::MinLoudness + extra ) );
|
||||
// controls << c;
|
||||
}
|
||||
else if ( param.first.startsWith( "danceability" ) )
|
||||
{
|
||||
dyncontrol_ptr c = pl->generator()->createControl( "Danceability" );
|
||||
int extra = param.first.endsWith( "_max" ) ? 1 : 0;
|
||||
c->setInput( param.second );
|
||||
c->setMatch( QString::number( (int)Echonest::DynamicPlaylist::MinDanceability + extra ) );
|
||||
controls << c;
|
||||
// c->setMatch( QString::number( (int)Echonest::DynamicPlaylist::MinDanceability + extra ) );
|
||||
// controls << c;
|
||||
}
|
||||
else if ( param.first.startsWith( "energy" ) )
|
||||
{
|
||||
dyncontrol_ptr c = pl->generator()->createControl( "Energy" );
|
||||
int extra = param.first.endsWith( "_max" ) ? 1 : 0;
|
||||
c->setInput( param.second );
|
||||
c->setMatch( QString::number( (int)Echonest::DynamicPlaylist::MinEnergy + extra ) );
|
||||
controls << c;
|
||||
// c->setMatch( QString::number( (int)Echonest::DynamicPlaylist::MinEnergy + extra ) );
|
||||
// controls << c;
|
||||
}
|
||||
else if ( param.first.startsWith( "artist_familiarity" ) )
|
||||
{
|
||||
dyncontrol_ptr c = pl->generator()->createControl( "Artist Familiarity" );
|
||||
int extra = param.first.endsWith( "_max" ) ? -1 : 0;
|
||||
c->setInput( param.second );
|
||||
c->setMatch( QString::number( (int)Echonest::DynamicPlaylist::ArtistMinFamiliarity + extra ) );
|
||||
controls << c;
|
||||
// c->setMatch( QString::number( (int)Echonest::DynamicPlaylist::ArtistMinFamiliarity + extra ) );
|
||||
// controls << c;
|
||||
}
|
||||
else if ( param.first.startsWith( "artist_hotttnesss" ) )
|
||||
{
|
||||
dyncontrol_ptr c = pl->generator()->createControl( "Artist Hotttnesss" );
|
||||
int extra = param.first.endsWith( "_max" ) ? -1 : 0;
|
||||
c->setInput( param.second );
|
||||
c->setMatch( QString::number( (int)Echonest::DynamicPlaylist::ArtistMinHotttnesss + extra ) );
|
||||
controls << c;
|
||||
// c->setMatch( QString::number( (int)Echonest::DynamicPlaylist::ArtistMinHotttnesss + extra ) );
|
||||
// controls << c;
|
||||
}
|
||||
else if ( param.first.startsWith( "song_hotttnesss" ) )
|
||||
{
|
||||
dyncontrol_ptr c = pl->generator()->createControl( "Song Hotttnesss" );
|
||||
int extra = param.first.endsWith( "_max" ) ? -1 : 0;
|
||||
c->setInput( param.second );
|
||||
c->setMatch( QString::number( (int)Echonest::DynamicPlaylist::SongMinHotttnesss + extra ) );
|
||||
controls << c;
|
||||
// c->setMatch( QString::number( (int)Echonest::DynamicPlaylist::SongMinHotttnesss + extra ) );
|
||||
// controls << c;
|
||||
}
|
||||
else if ( param.first.startsWith( "longitude" ) )
|
||||
{
|
||||
dyncontrol_ptr c = pl->generator()->createControl( "Longitude" );
|
||||
int extra = param.first.endsWith( "_max" ) ? 1 : 0;
|
||||
c->setInput( param.second );
|
||||
c->setMatch( QString::number( (int)Echonest::DynamicPlaylist::ArtistMinLongitude + extra ) );
|
||||
controls << c;
|
||||
// c->setMatch( QString::number( (int)Echonest::DynamicPlaylist::ArtistMinLongitude + extra ) );
|
||||
// controls << c;
|
||||
}
|
||||
else if ( param.first.startsWith( "latitude" ) )
|
||||
{
|
||||
dyncontrol_ptr c = pl->generator()->createControl( "Latitude" );
|
||||
int extra = param.first.endsWith( "_max" ) ? 1 : 0;
|
||||
c->setInput( param.second );
|
||||
c->setMatch( QString::number( (int)Echonest::DynamicPlaylist::ArtistMinLatitude + extra ) );
|
||||
controls << c;
|
||||
// c->setMatch( QString::number( (int)Echonest::DynamicPlaylist::ArtistMinLatitude + extra ) );
|
||||
// controls << c;
|
||||
}
|
||||
else if ( param.first == "key" )
|
||||
{
|
||||
dyncontrol_ptr c = pl->generator()->createControl( "Key" );
|
||||
c->setInput( param.second );
|
||||
c->setMatch( QString::number( (int)Echonest::DynamicPlaylist::Key ) );
|
||||
controls << c;
|
||||
// c->setMatch( QString::number( (int)Echonest::DynamicPlaylist::Key ) );
|
||||
// controls << c;
|
||||
}
|
||||
else if ( param.first == "mode" )
|
||||
{
|
||||
dyncontrol_ptr c = pl->generator()->createControl( "Mode" );
|
||||
c->setInput( param.second );
|
||||
c->setMatch( QString::number( (int)Echonest::DynamicPlaylist::Mode ) );
|
||||
controls << c;
|
||||
// c->setMatch( QString::number( (int)Echonest::DynamicPlaylist::Mode ) );
|
||||
// controls << c;
|
||||
}
|
||||
else if ( param.first == "mood" )
|
||||
{
|
||||
dyncontrol_ptr c = pl->generator()->createControl( "Mood" );
|
||||
c->setInput( param.second );
|
||||
c->setMatch( QString::number( (int)Echonest::DynamicPlaylist::Mood ) );
|
||||
controls << c;
|
||||
// c->setMatch( QString::number( (int)Echonest::DynamicPlaylist::Mood ) );
|
||||
// controls << c;
|
||||
}
|
||||
else if ( param.first == "style" )
|
||||
{
|
||||
dyncontrol_ptr c = pl->generator()->createControl( "Style" );
|
||||
c->setInput( param.second );
|
||||
c->setMatch( QString::number( (int)Echonest::DynamicPlaylist::Style ) );
|
||||
controls << c;
|
||||
// c->setMatch( QString::number( (int)Echonest::DynamicPlaylist::Style ) );
|
||||
// controls << c;
|
||||
}
|
||||
else if ( param.first == "song" )
|
||||
{
|
||||
dyncontrol_ptr c = pl->generator()->createControl( "Song" );
|
||||
c->setInput( param.second );
|
||||
c->setMatch( QString::number( (int)Echonest::DynamicPlaylist::SongRadioType ) );
|
||||
controls << c;
|
||||
// c->setMatch( QString::number( (int)Echonest::DynamicPlaylist::SongRadioType ) );
|
||||
// controls << c;
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -29,11 +29,6 @@
|
||||
|
||||
#include <QAction>
|
||||
|
||||
// Forward Declarations breaking QSharedPointer
|
||||
#if QT_VERSION < QT_VERSION_CHECK( 5, 0, 0 )
|
||||
#include "Result.h"
|
||||
#endif
|
||||
|
||||
|
||||
using namespace Tomahawk;
|
||||
|
||||
|
@@ -289,9 +289,4 @@ private:
|
||||
|
||||
Q_DECLARE_METATYPE( QSharedPointer< Tomahawk::Playlist > )
|
||||
|
||||
#if QT_VERSION < QT_VERSION_CHECK( 5, 0, 0 )
|
||||
// Qt5 automatically generated this Metatype
|
||||
Q_DECLARE_METATYPE( QList< QSharedPointer< Tomahawk::Query > > )
|
||||
#endif
|
||||
|
||||
#endif // PLAYLIST_H
|
||||
|
@@ -194,7 +194,7 @@ Query::addResults( const QList< Tomahawk::result_ptr >& newresults )
|
||||
}*/
|
||||
|
||||
d->results << newresults;
|
||||
qStableSort( d->results.begin(), d->results.end(), std::bind( &Query::resultSorter, this, std::placeholders::_1, std::placeholders::_2 ) );
|
||||
sortResults();
|
||||
|
||||
// hook up signals, and check solved status
|
||||
foreach( const result_ptr& rp, newresults )
|
||||
@@ -258,7 +258,7 @@ Query::onResultStatusChanged()
|
||||
Q_D( Query );
|
||||
QMutexLocker lock( &d->mutex );
|
||||
if ( !d->results.isEmpty() )
|
||||
qStableSort( d->results.begin(), d->results.end(), std::bind( &Query::resultSorter, this, std::placeholders::_1, std::placeholders::_2 ) );
|
||||
sortResults();
|
||||
}
|
||||
|
||||
checkResults();
|
||||
@@ -273,6 +273,11 @@ Query::removeResult( const Tomahawk::result_ptr& result )
|
||||
Q_D( Query );
|
||||
QMutexLocker lock( &d->mutex );
|
||||
d->results.removeAll( result );
|
||||
if ( d->preferredResult == result )
|
||||
{
|
||||
d->preferredResult.clear();
|
||||
}
|
||||
sortResults();
|
||||
}
|
||||
|
||||
emit resultsRemoved( result );
|
||||
@@ -396,6 +401,15 @@ Query::id() const
|
||||
bool
|
||||
Query::resultSorter( const result_ptr& left, const result_ptr& right )
|
||||
{
|
||||
Q_D( Query );
|
||||
if ( !d->preferredResult.isNull() )
|
||||
{
|
||||
if ( d->preferredResult == left )
|
||||
return true;
|
||||
if ( d->preferredResult == right )
|
||||
return false;
|
||||
}
|
||||
|
||||
const float ls = left->isOnline() ? howSimilar( left ) : 0.0;
|
||||
const float rs = right->isOnline() ? howSimilar( right ) : 0.0;
|
||||
|
||||
@@ -427,6 +441,30 @@ Query::resultSorter( const result_ptr& left, const result_ptr& right )
|
||||
}
|
||||
|
||||
|
||||
result_ptr
|
||||
Query::preferredResult() const
|
||||
{
|
||||
Q_D( const Query );
|
||||
return d->preferredResult;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
Query::setPreferredResult( const result_ptr& result )
|
||||
{
|
||||
{
|
||||
Q_D( Query );
|
||||
QMutexLocker lock( &d->mutex );
|
||||
|
||||
Q_ASSERT( d->results.contains( result ) );
|
||||
d->preferredResult = result;
|
||||
sortResults();
|
||||
}
|
||||
|
||||
emit resultsChanged();
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
Query::setCurrentResolver( Tomahawk::Resolver* resolver )
|
||||
{
|
||||
@@ -622,6 +660,10 @@ float
|
||||
Query::howSimilar( const Tomahawk::result_ptr& r )
|
||||
{
|
||||
Q_D( Query );
|
||||
if (d->howSimilarCache.find(r->id()) != d->howSimilarCache.end())
|
||||
{
|
||||
return d->howSimilarCache[r->id()];
|
||||
}
|
||||
// result values
|
||||
const QString& rArtistname = r->track()->artistSortname();
|
||||
const QString& rAlbumname = r->track()->albumSortname();
|
||||
@@ -643,10 +685,12 @@ Query::howSimilar( const Tomahawk::result_ptr& r )
|
||||
qTrackname = queryTrack()->trackSortname();
|
||||
}
|
||||
|
||||
static const QRegExp filterOutChars = QRegExp(QString::fromUtf8("[-`´~!@#$%^&*()_—+=|:;<>«»,.?/{}\'\"\\[\\]\\\\]"));
|
||||
|
||||
//Cleanup symbols for minor naming differences
|
||||
qArtistname.remove(QRegExp(QString::fromUtf8("[-`~!@#$%^&*()_—+=|:;<>«»,.?/{}\'\"\\[\\]\\\\]")));
|
||||
qTrackname.remove(QRegExp(QString::fromUtf8("[-`~!@#$%^&*()_—+=|:;<>«»,.?/{}\'\"\\[\\]\\\\]")));
|
||||
qAlbumname.remove(QRegExp(QString::fromUtf8("[-`~!@#$%^&*()_—+=|:;<>«»,.?/{}\'\"\\[\\]\\\\]")));
|
||||
qArtistname.remove(filterOutChars);
|
||||
qTrackname.remove(filterOutChars);
|
||||
qAlbumname.remove(filterOutChars);
|
||||
|
||||
// normal edit distance
|
||||
const int artdist = TomahawkUtils::levenshtein( qArtistname, rArtistname );
|
||||
@@ -678,12 +722,16 @@ Query::howSimilar( const Tomahawk::result_ptr& r )
|
||||
const int mlatr = qMax( artistTrackname.length(), rArtistTrackname.length() );
|
||||
const float dcatr = (float)( mlatr - atrdist ) / mlatr;
|
||||
|
||||
return qMax( dctrk, qMax( dcatr, qMax( dcart, dcalb ) ) );
|
||||
float resultScore = qMax( dctrk, qMax( dcatr, qMax( dcart, dcalb ) ) );
|
||||
d->howSimilarCache[r->id()] = resultScore;
|
||||
return resultScore;
|
||||
}
|
||||
else
|
||||
{
|
||||
// weighted, so album match is worth less than track title
|
||||
return ( dcart * 4 + dcalb + dctrk * 5 ) / 10;
|
||||
float resultScore = ( dcart * 4 + dcalb + dctrk * 5 ) / 10;
|
||||
d->howSimilarCache[r->id()] = resultScore;
|
||||
return resultScore;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -734,3 +782,11 @@ Query::setWeakRef( QWeakPointer<Query> weakRef )
|
||||
Q_D( Query );
|
||||
d->ownRef = weakRef;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
Query::sortResults()
|
||||
{
|
||||
Q_D( Query );
|
||||
qStableSort( d->results.begin(), d->results.end(), std::bind( &Query::resultSorter, this, std::placeholders::_1, std::placeholders::_2 ) );
|
||||
}
|
||||
|
@@ -112,6 +112,8 @@ public:
|
||||
|
||||
/// sorter for list of results
|
||||
bool resultSorter( const result_ptr& left, const result_ptr& right );
|
||||
result_ptr preferredResult() const;
|
||||
void setPreferredResult( const result_ptr& result );
|
||||
|
||||
signals:
|
||||
void resultsAdded( const QList<Tomahawk::result_ptr>& );
|
||||
@@ -158,6 +160,7 @@ private:
|
||||
void setCurrentResolver( Tomahawk::Resolver* resolver );
|
||||
void clearResults();
|
||||
void checkResults();
|
||||
void sortResults();
|
||||
};
|
||||
|
||||
} //ns
|
||||
|
@@ -4,6 +4,7 @@
|
||||
#include "Query.h"
|
||||
|
||||
#include <QMutex>
|
||||
#include <map>
|
||||
|
||||
namespace Tomahawk
|
||||
{
|
||||
@@ -39,6 +40,7 @@ private:
|
||||
QList< Tomahawk::artist_ptr > artists;
|
||||
QList< Tomahawk::album_ptr > albums;
|
||||
QList< Tomahawk::result_ptr > results;
|
||||
Tomahawk::result_ptr preferredResult;
|
||||
|
||||
float score;
|
||||
bool solved;
|
||||
@@ -58,6 +60,8 @@ private:
|
||||
|
||||
mutable QMutex mutex;
|
||||
QWeakPointer< Tomahawk::Query > ownRef;
|
||||
|
||||
std::map<QString, float> howSimilarCache;
|
||||
};
|
||||
|
||||
} // Tomahawk
|
||||
|
@@ -1,13 +1,9 @@
|
||||
#include <QtPlugin>
|
||||
|
||||
#if QT_VERSION >= QT_VERSION_CHECK( 5, 0, 0 )
|
||||
#if defined(Q_EXPORT_PLUGIN)
|
||||
#undef Q_EXPORT_PLUGIN
|
||||
#undef Q_EXPORT_PLUGIN2
|
||||
#endif
|
||||
#if defined(Q_EXPORT_PLUGIN)
|
||||
#undef Q_EXPORT_PLUGIN
|
||||
#undef Q_EXPORT_PLUGIN2
|
||||
#endif
|
||||
|
||||
#define Q_EXPORT_PLUGIN(a)
|
||||
#define Q_EXPORT_PLUGIN2(a, b)
|
||||
#else
|
||||
# define Q_PLUGIN_METADATA(a)
|
||||
#endif
|
||||
#define Q_EXPORT_PLUGIN(a)
|
||||
#define Q_EXPORT_PLUGIN2(a, b)
|
||||
|
@@ -34,14 +34,8 @@
|
||||
#include "PlaylistInterface.h"
|
||||
#include "Source.h"
|
||||
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5,0,0)
|
||||
#include <qtkeychain/keychain.h>
|
||||
#include <QDesktopServices>
|
||||
#else
|
||||
#include <qt5keychain/keychain.h>
|
||||
#include <QStandardPaths>
|
||||
#endif
|
||||
|
||||
#include <qt5keychain/keychain.h>
|
||||
#include <QStandardPaths>
|
||||
#include <QDir>
|
||||
|
||||
using namespace Tomahawk;
|
||||
@@ -733,11 +727,7 @@ TomahawkSettings::genericCacheVersion() const
|
||||
QString
|
||||
TomahawkSettings::storageCacheLocation() const
|
||||
{
|
||||
#if QT_VERSION >= QT_VERSION_CHECK( 5, 0, 0 )
|
||||
return QStandardPaths::writableLocation( QStandardPaths::CacheLocation );
|
||||
#else
|
||||
return QDesktopServices::storageLocation( QDesktopServices::CacheLocation );
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -746,11 +736,7 @@ TomahawkSettings::scannerPaths() const
|
||||
{
|
||||
QString musicLocation;
|
||||
|
||||
#if QT_VERSION >= QT_VERSION_CHECK( 5, 0, 0 )
|
||||
musicLocation = QStandardPaths::writableLocation( QStandardPaths::MusicLocation );
|
||||
#else
|
||||
musicLocation = QDesktopServices::storageLocation( QDesktopServices::MusicLocation );
|
||||
#endif
|
||||
|
||||
return value( "scanner/paths", musicLocation ).toStringList();
|
||||
}
|
||||
@@ -887,6 +873,20 @@ TomahawkSettings::setCrashReporterEnabled( bool enable )
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
TomahawkSettings::exitOnClose() const
|
||||
{
|
||||
return value( "ui/exitOnClose", false ).toBool();
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
TomahawkSettings::setExitOnClose( bool enable )
|
||||
{
|
||||
setValue( "ui/exitOnClose", enable );
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
TomahawkSettings::songChangeNotificationEnabled() const
|
||||
{
|
||||
@@ -1764,3 +1764,15 @@ TomahawkSettings::setPlaydarKey( const QByteArray& key )
|
||||
setValue( "playdar/key", key );
|
||||
}
|
||||
|
||||
QString
|
||||
TomahawkSettings::vlcArguments() const
|
||||
{
|
||||
return value( "vlc/cmdline_args" ).value< QString >();
|
||||
}
|
||||
|
||||
void
|
||||
TomahawkSettings::setVlcArguments( const QString& args )
|
||||
{
|
||||
setValue( "vlc/cmdline_args", args);
|
||||
}
|
||||
|
||||
|
@@ -163,6 +163,9 @@ public:
|
||||
bool crashReporterEnabled() const; /// true by default
|
||||
void setCrashReporterEnabled( bool enable );
|
||||
|
||||
bool exitOnClose() const; /// false by default
|
||||
void setExitOnClose( bool enable );
|
||||
|
||||
bool songChangeNotificationEnabled() const; /// true by default
|
||||
void setSongChangeNotificationEnabled( bool enable );
|
||||
|
||||
@@ -253,6 +256,10 @@ public:
|
||||
QByteArray playdarKey() const;
|
||||
void setPlaydarKey( const QByteArray& key );
|
||||
|
||||
// VLC Settings
|
||||
QString vlcArguments() const;
|
||||
void setVlcArguments( const QString& arguments );
|
||||
|
||||
signals:
|
||||
void changed();
|
||||
void recentlyPlayedPlaylistAdded( const QString& playlistId, int sourceId );
|
||||
|
@@ -213,19 +213,11 @@ Track::init()
|
||||
Q_D( Track );
|
||||
updateSortNames();
|
||||
|
||||
#if QT_VERSION >= QT_VERSION_CHECK( 5, 0, 0 )
|
||||
QObject::connect( d->trackData.data(), &TrackData::attributesLoaded, this, &Track::attributesLoaded );
|
||||
QObject::connect( d->trackData.data(), &TrackData::socialActionsLoaded, this, &Track::socialActionsLoaded );
|
||||
QObject::connect( d->trackData.data(), &TrackData::statsLoaded, this, &Track::statsLoaded );
|
||||
QObject::connect( d->trackData.data(), &TrackData::similarTracksLoaded, this, &Track::similarTracksLoaded );
|
||||
QObject::connect( d->trackData.data(), &TrackData::lyricsLoaded, this, &Track::lyricsLoaded );
|
||||
#else
|
||||
connect( d->trackData.data(), SIGNAL( attributesLoaded() ), SIGNAL( attributesLoaded() ) );
|
||||
connect( d->trackData.data(), SIGNAL( socialActionsLoaded() ), SIGNAL( socialActionsLoaded() ) );
|
||||
connect( d->trackData.data(), SIGNAL( statsLoaded() ), SIGNAL( statsLoaded() ) );
|
||||
connect( d->trackData.data(), SIGNAL( similarTracksLoaded() ), SIGNAL( similarTracksLoaded() ) );
|
||||
connect( d->trackData.data(), SIGNAL( lyricsLoaded() ), SIGNAL( lyricsLoaded() ) );
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
@@ -64,7 +64,7 @@ AccountDelegate::sizeHint( const QStyleOptionViewItem& option, const QModelIndex
|
||||
if ( m_accountRowHeight < 0 )
|
||||
{
|
||||
// Haven't calculated normal item height yet, do it once and save it
|
||||
QStyleOptionViewItemV4 opt( option );
|
||||
QStyleOptionViewItem opt( option );
|
||||
initStyleOption( &opt, index );
|
||||
m_accountRowHeight = ACCOUNT_DELEGATE_ROW_HEIGHT_MULTIPLIER * opt.fontMetrics.height();
|
||||
}
|
||||
@@ -98,7 +98,7 @@ AccountDelegate::sizeHint( const QStyleOptionViewItem& option, const QModelIndex
|
||||
void
|
||||
AccountDelegate::paint ( QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index ) const
|
||||
{
|
||||
QStyleOptionViewItemV4 opt = option;
|
||||
QStyleOptionViewItem opt = option;
|
||||
initStyleOption( &opt, index );
|
||||
|
||||
// draw the background
|
||||
@@ -139,7 +139,7 @@ AccountDelegate::paint ( QPainter* painter, const QStyleOptionViewItem& option,
|
||||
// draw checkbox first
|
||||
const int checkboxYPos = ( center ) - ( WRENCH_SIZE / 2 );
|
||||
QRect checkRect = QRect( leftEdge, checkboxYPos, WRENCH_SIZE, WRENCH_SIZE );
|
||||
QStyleOptionViewItemV4 opt2 = opt;
|
||||
QStyleOptionViewItem opt2 = opt;
|
||||
opt2.rect = checkRect;
|
||||
|
||||
if ( !m_loadingSpinners.contains( index ) )
|
||||
@@ -392,7 +392,7 @@ AccountDelegate::paint ( QPainter* painter, const QStyleOptionViewItem& option,
|
||||
|
||||
|
||||
int
|
||||
AccountDelegate::drawAccountList( QPainter* painter, QStyleOptionViewItemV4& opt, const QList< Account* > accts, int rightEdge ) const
|
||||
AccountDelegate::drawAccountList( QPainter* painter, QStyleOptionViewItem& opt, const QList< Account* > accts, int rightEdge ) const
|
||||
{
|
||||
// list each account name, and show the online, offline icon
|
||||
const int textHeight = painter->fontMetrics().height() + 1;
|
||||
@@ -615,7 +615,7 @@ AccountDelegate::drawStatus( QPainter* painter, const QPointF& rightTopEdge, Acc
|
||||
|
||||
|
||||
void
|
||||
AccountDelegate::drawCheckBox( QStyleOptionViewItemV4& opt, QPainter* p, const QWidget* w ) const
|
||||
AccountDelegate::drawCheckBox( QStyleOptionViewItem& opt, QPainter* p, const QWidget* w ) const
|
||||
{
|
||||
QStyle* style = w ? w->style() : QApplication::style();
|
||||
opt.checkState == Qt::Checked ? opt.state |= QStyle::State_On : opt.state |= QStyle::State_Off;
|
||||
@@ -624,7 +624,7 @@ AccountDelegate::drawCheckBox( QStyleOptionViewItemV4& opt, QPainter* p, const Q
|
||||
|
||||
|
||||
void
|
||||
AccountDelegate::drawConfigWrench ( QPainter* painter, QStyleOptionViewItemV4& opt, QStyleOptionToolButton& topt ) const
|
||||
AccountDelegate::drawConfigWrench ( QPainter* painter, QStyleOptionViewItem& opt, QStyleOptionToolButton& topt ) const
|
||||
{
|
||||
const QWidget* w = opt.widget;
|
||||
QStyle* style = w ? w->style() : QApplication::style();
|
||||
@@ -648,7 +648,7 @@ AccountDelegate::drawConfigWrench ( QPainter* painter, QStyleOptionViewItemV4& o
|
||||
QRect
|
||||
AccountDelegate::checkRectForIndex( const QStyleOptionViewItem& option, const QModelIndex& idx ) const
|
||||
{
|
||||
QStyleOptionViewItemV4 opt = option;
|
||||
QStyleOptionViewItem opt = option;
|
||||
initStyleOption( &opt, idx );
|
||||
|
||||
// Top level item, return the corresponding rect
|
||||
@@ -661,7 +661,7 @@ AccountDelegate::checkRectForIndex( const QStyleOptionViewItem& option, const QM
|
||||
|
||||
|
||||
int
|
||||
AccountDelegate::removeBtnWidth( QStyleOptionViewItemV4 opt ) const
|
||||
AccountDelegate::removeBtnWidth( QStyleOptionViewItem opt ) const
|
||||
{
|
||||
const QString btnText = tr( "Remove" );
|
||||
QFont font = opt.font;
|
||||
@@ -674,7 +674,7 @@ void
|
||||
AccountDelegate::startInstalling( const QPersistentModelIndex& idx )
|
||||
{
|
||||
qDebug() << "START INSTALLING:" << idx.data( Qt::DisplayRole ).toString();
|
||||
QStyleOptionViewItemV4 opt;
|
||||
QStyleOptionViewItem opt;
|
||||
initStyleOption( &opt, idx );
|
||||
|
||||
AnimatedSpinner* anim = new AnimatedSpinner( checkRectForIndex( opt, idx ).size(), true );
|
||||
|
@@ -71,14 +71,14 @@ private:
|
||||
void drawRoundedButton( QPainter* painter, const QRect& buttonRect, bool red = false ) const;
|
||||
// Returns new left edge
|
||||
int drawStatus( QPainter* painter, const QPointF& rightTopEdge, Account* acct, bool drawText = false ) const;
|
||||
void drawCheckBox( QStyleOptionViewItemV4& opt, QPainter* p, const QWidget* w ) const;
|
||||
void drawConfigWrench( QPainter* painter, QStyleOptionViewItemV4& option, QStyleOptionToolButton& topt ) const;
|
||||
void drawCheckBox( QStyleOptionViewItem& opt, QPainter* p, const QWidget* w ) const;
|
||||
void drawConfigWrench( QPainter* painter, QStyleOptionViewItem& option, QStyleOptionToolButton& topt ) const;
|
||||
// returns new left edge
|
||||
int drawAccountList( QPainter* painter, QStyleOptionViewItemV4& option, const QList< Account* > accounts, int rightEdge ) const;
|
||||
int drawAccountList( QPainter* painter, QStyleOptionViewItem& option, const QList< Account* > accounts, int rightEdge ) const;
|
||||
|
||||
QRect checkRectForIndex( const QStyleOptionViewItem &option, const QModelIndex &idx ) const;
|
||||
|
||||
int removeBtnWidth( QStyleOptionViewItemV4 opt ) const;
|
||||
int removeBtnWidth( QStyleOptionViewItem opt ) const;
|
||||
|
||||
int m_hoveringOver;
|
||||
QPersistentModelIndex m_hoveringItem, m_configPressed;
|
||||
|
@@ -44,7 +44,7 @@ AccountFactoryWrapperDelegate::AccountFactoryWrapperDelegate( QObject* parent )
|
||||
void
|
||||
AccountFactoryWrapperDelegate::paint(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index) const
|
||||
{
|
||||
QStyleOptionViewItemV4 opt = option;
|
||||
QStyleOptionViewItem opt = option;
|
||||
initStyleOption( &opt, index );
|
||||
|
||||
const int center = opt.rect.height() / 2 + opt.rect.top();
|
||||
@@ -61,7 +61,7 @@ AccountFactoryWrapperDelegate::paint(QPainter* painter, const QStyleOptionViewIt
|
||||
// Checkbox on left edge, then text
|
||||
const QRect checkRect( PADDING/4, PADDING/4 + opt.rect.top(), opt.rect.height() - PADDING/4, opt.rect.height() - PADDING/4 );
|
||||
m_cachedCheckRects[ index ] = checkRect;
|
||||
QStyleOptionViewItemV4 opt2 = opt;
|
||||
QStyleOptionViewItem opt2 = opt;
|
||||
opt2.rect = checkRect;
|
||||
opt.checkState == Qt::Checked ? opt2.state |= QStyle::State_On : opt2.state |= QStyle::State_Off;
|
||||
style->drawPrimitive( QStyle::PE_IndicatorViewItemCheck, &opt2, painter, w );
|
||||
|
@@ -23,11 +23,7 @@
|
||||
#ifdef Q_OS_MAC
|
||||
#include "TomahawkSettings.h"
|
||||
#else
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5,0,0)
|
||||
#include <qtkeychain/keychain.h>
|
||||
#else
|
||||
#include <qt5keychain/keychain.h>
|
||||
#endif
|
||||
#include <qt5keychain/keychain.h>
|
||||
#include "utils/Json.h"
|
||||
#endif
|
||||
|
||||
|
@@ -247,6 +247,7 @@ DelegateConfigWrapper::getTestConfigMessage( int code )
|
||||
case Tomahawk::Accounts::ConfigTestResultAccountExpired:
|
||||
return tr( "Your account has expired." );
|
||||
}
|
||||
return QString();
|
||||
}
|
||||
|
||||
|
||||
|
@@ -11,16 +11,3 @@ tomahawk_add_plugin(telepathy
|
||||
${TELEPATHY_QT_LIBRARIES}
|
||||
SHARED_LIB
|
||||
)
|
||||
|
||||
if( KDE4_FOUND )
|
||||
include_directories( ${KDE4_INCLUDES} )
|
||||
tomahawk_add_plugin(kde
|
||||
TYPE configstorage_telepathy
|
||||
EXPORT_MACRO CONFIGSTORAGETELEPATHYDLLEXPORT_PRO
|
||||
SOURCES
|
||||
KdeTelepathyConfigWidget.cpp
|
||||
LINK_LIBRARIES
|
||||
${TOMAHAWK_BASE_TARGET_NAME}_configstorage_telepathy
|
||||
${KDE4_KCMUTILS_LIBS}
|
||||
)
|
||||
endif()
|
||||
|
@@ -1,46 +0,0 @@
|
||||
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
|
||||
*
|
||||
* Copyright 2013, Dominik Schmidt <domme@tomahawk-player.org>
|
||||
*
|
||||
* Tomahawk is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Tomahawk 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Tomahawk. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "KdeTelepathyConfigWidget.h"
|
||||
|
||||
#include "utils/Logger.h"
|
||||
|
||||
#include <KCModuleProxy>
|
||||
|
||||
#include <QtPlugin>
|
||||
|
||||
QWidget*
|
||||
KdeTelepathyConfigWidget::configWidget()
|
||||
{
|
||||
KCModuleProxy* proxy = new KCModuleProxy( "kcm_ktp_accounts" );
|
||||
|
||||
if ( !proxy->aboutData() )
|
||||
{
|
||||
qWarning() << "Could not load kcm_ktp_accounts... ";
|
||||
|
||||
delete proxy;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
return proxy;
|
||||
}
|
||||
|
||||
Q_EXPORT_PLUGIN2( TelepathyConfigStorageConfigWidgetPlugin, KdeTelepathyConfigWidget )
|
||||
|
||||
|
@@ -1,36 +0,0 @@
|
||||
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
|
||||
*
|
||||
* Copyright 2013, Dominik Schmidt <domme@tomahawk-player.org>
|
||||
*
|
||||
* Tomahawk is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Tomahawk 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Tomahawk. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef KDETELEPATHYCONFIGWIDGET_H
|
||||
#define KDETELEPATHYCONFIGWIDGET_H
|
||||
|
||||
#include "TelepathyConfigStorageConfigWidgetPlugin.h"
|
||||
|
||||
#include "TelepathyConfigStorageConfigWidgetDllMacro.h"
|
||||
|
||||
class CONFIGSTORAGETELEPATHYDLLEXPORT KdeTelepathyConfigWidget : public TelepathyConfigStorageConfigWidgetPlugin
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_INTERFACES( TelepathyConfigStorageConfigWidgetPlugin )
|
||||
|
||||
public:
|
||||
virtual QWidget* configWidget();
|
||||
};
|
||||
|
||||
|
||||
#endif // KDETELEPATHYCONFIGWIDGET_H
|
Binary file not shown.
Before Width: | Height: | Size: 18 KiB |
@@ -1,5 +0,0 @@
|
||||
<RCC>
|
||||
<qresource prefix="/telepathy">
|
||||
<file>kde.png</file>
|
||||
</qresource>
|
||||
</RCC>
|
@@ -29,17 +29,10 @@
|
||||
#include "utils/Closure.h"
|
||||
#include "utils/NetworkAccessManager.h"
|
||||
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5,0,0)
|
||||
#include <lastfm5/ws.h>
|
||||
#include <lastfm5/User.h>
|
||||
#include <lastfm5/XmlQuery.h>
|
||||
#include <lastfm5/Track.h>
|
||||
#else
|
||||
#include <lastfm/ws.h>
|
||||
#include <lastfm/User.h>
|
||||
#include <lastfm/XmlQuery.h>
|
||||
#include <lastfm/Track.h>
|
||||
#endif
|
||||
|
||||
using namespace Tomahawk::Accounts;
|
||||
|
||||
|
@@ -34,13 +34,8 @@
|
||||
#include "TomahawkSettings.h"
|
||||
#include "utils/NetworkAccessManager.h"
|
||||
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5,0,0)
|
||||
#include <lastfm5/ws.h>
|
||||
#include <lastfm5/XmlQuery.h>
|
||||
#else
|
||||
#include <lastfm/ws.h>
|
||||
#include <lastfm/XmlQuery.h>
|
||||
#endif
|
||||
|
||||
using namespace Tomahawk::Accounts;
|
||||
using namespace Tomahawk::InfoSystem;
|
||||
|
@@ -24,15 +24,9 @@
|
||||
#include "infosystem/InfoSystemWorker.h"
|
||||
#include "DllMacro.h"
|
||||
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5,0,0)
|
||||
#include <lastfm5/Track.h>
|
||||
#include <lastfm5/Audioscrobbler.h>
|
||||
#include <lastfm5/ScrobblePoint.h>
|
||||
#else
|
||||
#include <lastfm/Track.h>
|
||||
#include <lastfm/Audioscrobbler.h>
|
||||
#include <lastfm/ScrobblePoint.h>
|
||||
#endif
|
||||
|
||||
#include <QObject>
|
||||
|
||||
|
@@ -22,6 +22,7 @@
|
||||
#include "AudioEngine.h"
|
||||
#include "AudioOutput.h"
|
||||
#include "TomahawkVersion.h"
|
||||
#include "TomahawkSettings.h"
|
||||
|
||||
#include "audio/MediaStream.h"
|
||||
#include "utils/Logger.h"
|
||||
@@ -35,10 +36,12 @@
|
||||
|
||||
#include <vlc/libvlc.h>
|
||||
#include <vlc/libvlc_media.h>
|
||||
#include <vlc/libvlc_media_player.h>
|
||||
#include <vlc/libvlc_events.h>
|
||||
#include <vlc/libvlc_media_player.h>
|
||||
#include <vlc/libvlc_version.h>
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
AudioOutput* AudioOutput::s_instance = 0;
|
||||
|
||||
|
||||
@@ -72,7 +75,7 @@ AudioOutput::AudioOutput( QObject* parent )
|
||||
|
||||
qRegisterMetaType<AudioOutput::AudioState>("AudioOutput::AudioState");
|
||||
|
||||
const char* vlcArgs[] = {
|
||||
QVector<const char*> vlcArgs = {
|
||||
"--ignore-config",
|
||||
"--extraintf=logger",
|
||||
qApp->arguments().contains( "--verbose" ) ? "--verbose=3" : "",
|
||||
@@ -84,11 +87,28 @@ AudioOutput::AudioOutput( QObject* parent )
|
||||
// "--no-snapshot-preview",
|
||||
// "--services-discovery=''",
|
||||
"--no-video",
|
||||
//"--network-caching=10000",
|
||||
//"--file-caching=10000",
|
||||
//"--clock-synchro=0",
|
||||
//"--cr-average=10000",
|
||||
//"--clock-jitter=1",
|
||||
"--no-xlib"
|
||||
};
|
||||
TomahawkSettings* s = TomahawkSettings::instance();
|
||||
//Save a list of Latin1 byte arrays for additional args
|
||||
auto additionalVlcArgs = s->vlcArguments().split(",");
|
||||
QVector<QByteArray> additionalArgsChar;
|
||||
|
||||
std::transform(additionalVlcArgs.begin(), additionalVlcArgs.end(),
|
||||
std::back_inserter(additionalArgsChar), [](QString str) { return str.toLatin1(); });
|
||||
|
||||
for (auto&& str : additionalArgsChar)
|
||||
{
|
||||
vlcArgs.append(str.constData());
|
||||
}
|
||||
|
||||
// Create and initialize a libvlc instance (it should be done only once)
|
||||
m_vlcInstance = libvlc_new( sizeof(vlcArgs) / sizeof(*vlcArgs), vlcArgs );
|
||||
m_vlcInstance = libvlc_new( vlcArgs.size(), vlcArgs.constData() );
|
||||
if ( !m_vlcInstance )
|
||||
{
|
||||
tDebug() << Q_FUNC_INFO << "libVLC: could not initialize";
|
||||
@@ -144,7 +164,6 @@ AudioOutput::AudioOutput( QObject* parent )
|
||||
setCurrentSource( new MediaStream( &m_silenceFile, true ) );
|
||||
libvlc_media_player_play( m_vlcPlayer );
|
||||
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5,4,0)
|
||||
// if the silence file did not play for 15 secs, we pretend the AudioOutput is initialized, to allow proper error reporting
|
||||
QTimer::singleShot( 15000, [&]()
|
||||
{
|
||||
@@ -153,7 +172,6 @@ AudioOutput::AudioOutput( QObject* parent )
|
||||
emit initialized();
|
||||
}
|
||||
} );
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -295,33 +313,22 @@ AudioOutput::setCurrentSource( MediaStream* stream )
|
||||
tDebug() << Q_FUNC_INFO << "MediaStream::Final Url:" << url;
|
||||
|
||||
m_vlcMedia = libvlc_media_new_location( m_vlcInstance, url.constData() );
|
||||
libvlc_event_manager_t* manager = libvlc_media_event_manager( m_vlcMedia );
|
||||
libvlc_event_type_t events[] = {
|
||||
libvlc_MediaDurationChanged,
|
||||
};
|
||||
const int eventCount = sizeof(events) / sizeof( *events );
|
||||
for ( int i = 0; i < eventCount; i++ )
|
||||
{
|
||||
libvlc_event_attach( manager, events[ i ], &AudioOutput::vlcEventCallback, this );
|
||||
}
|
||||
|
||||
libvlc_media_player_set_media( m_vlcPlayer, m_vlcMedia );
|
||||
|
||||
if ( stream->type() == MediaStream::Url )
|
||||
{
|
||||
m_totalTime = libvlc_media_get_duration( m_vlcMedia );
|
||||
}
|
||||
else if ( stream->type() == MediaStream::Stream || stream->type() == MediaStream::IODevice )
|
||||
{
|
||||
QString tempString;
|
||||
libvlc_media_add_option_flag(m_vlcMedia, "imem-cat=4", libvlc_media_option_trusted);
|
||||
const char* imemData = QString( "imem-data=%1" ).arg( (uintptr_t)stream ).toLatin1().constData();
|
||||
libvlc_media_add_option_flag(m_vlcMedia, imemData, libvlc_media_option_trusted);
|
||||
const char* imemGet = QString( "imem-get=%1" ).arg( (uintptr_t)&readCallback ).toLatin1().constData();
|
||||
libvlc_media_add_option_flag(m_vlcMedia, imemGet, libvlc_media_option_trusted);
|
||||
const char* imemRelease = QString( "imem-release=%1" ).arg( (uintptr_t)&readDoneCallback ).toLatin1().constData();
|
||||
libvlc_media_add_option_flag(m_vlcMedia, imemRelease, libvlc_media_option_trusted);
|
||||
const char* imemSeek = QString( "imem-seek=%1" ).arg( (uintptr_t)&MediaStream::seekCallback ).toLatin1().constData();
|
||||
libvlc_media_add_option_flag(m_vlcMedia, imemSeek, libvlc_media_option_trusted);
|
||||
tempString = QString( "imem-data=%1" ).arg( (uintptr_t)stream );
|
||||
libvlc_media_add_option_flag(m_vlcMedia, tempString.toLatin1().constData(), libvlc_media_option_trusted);
|
||||
tempString = QString( "imem-get=%1" ).arg( (uintptr_t)&readCallback );
|
||||
libvlc_media_add_option_flag(m_vlcMedia, tempString.toLatin1().constData(), libvlc_media_option_trusted);
|
||||
tempString = QString( "imem-release=%1" ).arg( (uintptr_t)&readDoneCallback );
|
||||
libvlc_media_add_option_flag(m_vlcMedia, tempString.toLatin1().constData(), libvlc_media_option_trusted);
|
||||
tempString = QString( "imem-seek=%1" ).arg( (uintptr_t)&MediaStream::seekCallback );
|
||||
libvlc_media_add_option_flag(m_vlcMedia, tempString.toLatin1().constData(), libvlc_media_option_trusted);
|
||||
}
|
||||
if ( qApp->arguments().contains( "--chromecast-ip" ) )
|
||||
{
|
||||
@@ -345,6 +352,18 @@ AudioOutput::setCurrentSource( MediaStream* stream )
|
||||
}
|
||||
}
|
||||
|
||||
libvlc_event_manager_t* manager = libvlc_media_event_manager( m_vlcMedia );
|
||||
libvlc_event_type_t events[] = {
|
||||
libvlc_MediaDurationChanged,
|
||||
};
|
||||
const int eventCount = sizeof(events) / sizeof( *events );
|
||||
for ( int i = 0; i < eventCount; i++ )
|
||||
{
|
||||
libvlc_event_attach( manager, events[ i ], &AudioOutput::vlcEventCallback, this );
|
||||
}
|
||||
|
||||
libvlc_media_player_set_media( m_vlcPlayer, m_vlcMedia );
|
||||
|
||||
// setState( Stopped );
|
||||
}
|
||||
|
||||
|
@@ -151,7 +151,6 @@ int
|
||||
MediaStream::readDoneCallback ( const char *cookie, size_t bufferSize, void *buffer )
|
||||
{
|
||||
Q_UNUSED(cookie);
|
||||
Q_UNUSED(bufferSize);
|
||||
|
||||
if ( ( m_type == Stream ) && buffer != nullptr && bufferSize > 0 ) {
|
||||
delete[] reinterpret_cast< char* >( buffer );
|
||||
|
@@ -43,11 +43,6 @@
|
||||
#include "DatabaseCommand_SetCollectionAttributes.h"
|
||||
#include "DatabaseCommand_SetTrackAttributes.h"
|
||||
|
||||
// Forward Declarations breaking QSharedPointer
|
||||
#if QT_VERSION < QT_VERSION_CHECK( 5, 0, 0 )
|
||||
#include "collection/Collection.h"
|
||||
#endif
|
||||
|
||||
#define DEFAULT_WORKER_THREADS 4
|
||||
#define MAX_WORKER_THREADS 16
|
||||
|
||||
|
@@ -128,10 +128,13 @@ DatabaseCollection::playlists()
|
||||
QList< dynplaylist_ptr >
|
||||
DatabaseCollection::autoPlaylists()
|
||||
{
|
||||
// echonest is dead, disable all echonest code
|
||||
/*
|
||||
if ( Collection::autoPlaylists().isEmpty() )
|
||||
{
|
||||
loadAutoPlaylists();
|
||||
}
|
||||
*/
|
||||
|
||||
return Collection::autoPlaylists();
|
||||
}
|
||||
@@ -140,10 +143,13 @@ DatabaseCollection::autoPlaylists()
|
||||
QList< dynplaylist_ptr >
|
||||
DatabaseCollection::stations()
|
||||
{
|
||||
// echonest is dead, disable all echonest code
|
||||
/*
|
||||
if ( Collection::stations().isEmpty() )
|
||||
{
|
||||
loadStations();
|
||||
}
|
||||
*/
|
||||
|
||||
return Collection::stations();
|
||||
}
|
||||
|
@@ -59,10 +59,10 @@ public:
|
||||
void setLimit( unsigned int amount ) { m_amount = amount; }
|
||||
void setSortOrder( DatabaseCommand_AllArtists::SortOrder order ) { m_sortOrder = order; }
|
||||
void setSortDescending( bool descending ) { m_sortDescending = descending; }
|
||||
void setFilter( const QString& filter ) { m_filter = filter; }
|
||||
void setFilter( const QString& filter ) override { m_filter = filter; }
|
||||
|
||||
signals:
|
||||
void artists( const QList<Tomahawk::artist_ptr>& );
|
||||
void artists( const QList<Tomahawk::artist_ptr>& ) override;
|
||||
void done();
|
||||
|
||||
private:
|
||||
|
@@ -74,7 +74,7 @@ public:
|
||||
|
||||
signals:
|
||||
void tracks( const QList<Tomahawk::query_ptr>&, const QVariant& data );
|
||||
void tracks( const QList<Tomahawk::query_ptr>& );
|
||||
void tracks( const QList<Tomahawk::query_ptr>& ) override;
|
||||
void done( const Tomahawk::collection_ptr& );
|
||||
|
||||
private:
|
||||
|
@@ -25,11 +25,6 @@
|
||||
#include "PlaylistEntry.h"
|
||||
#include "SourceList.h"
|
||||
|
||||
// Forward Declarations breaking QSharedPointer
|
||||
#if QT_VERSION < QT_VERSION_CHECK( 5, 0, 0 )
|
||||
#include "collection/Collection.h"
|
||||
#endif
|
||||
|
||||
|
||||
using namespace Tomahawk;
|
||||
|
||||
|
@@ -24,10 +24,6 @@
|
||||
|
||||
#include <QSqlQuery>
|
||||
|
||||
// Forward Declarations breaking QSharedPointer
|
||||
#if QT_VERSION < QT_VERSION_CHECK( 5, 0, 0 )
|
||||
#include "collection/Collection.h"
|
||||
#endif
|
||||
|
||||
using namespace Tomahawk;
|
||||
|
||||
|
@@ -21,11 +21,6 @@
|
||||
#include "Query.h"
|
||||
#include "Track.h"
|
||||
|
||||
// Forward Declarations breaking QSharedPointer
|
||||
#if QT_VERSION < QT_VERSION_CHECK( 5, 0, 0 )
|
||||
#include "Source.h"
|
||||
#endif
|
||||
|
||||
|
||||
namespace Tomahawk
|
||||
{
|
||||
|
@@ -87,9 +87,4 @@ private:
|
||||
|
||||
}
|
||||
|
||||
#if QT_VERSION < QT_VERSION_CHECK( 5, 0, 0 )
|
||||
// Qt5 automatically generated this Metatype
|
||||
Q_DECLARE_METATYPE(QList<QStringList>)
|
||||
#endif
|
||||
|
||||
#endif // DATABASECOMMAND_GENERICSELECT_H
|
||||
|
@@ -21,11 +21,6 @@
|
||||
#include "Query.h"
|
||||
#include "Track.h"
|
||||
|
||||
// Forward Declarations breaking QSharedPointer
|
||||
#if QT_VERSION < QT_VERSION_CHECK( 5, 0, 0 )
|
||||
#include "Source.h"
|
||||
#endif
|
||||
|
||||
|
||||
namespace Tomahawk
|
||||
{
|
||||
|
@@ -22,11 +22,6 @@
|
||||
#include "DatabaseImpl.h"
|
||||
#include "TomahawkSqlQuery.h"
|
||||
|
||||
// Forward Declarations breaking QSharedPointer
|
||||
#if QT_VERSION < QT_VERSION_CHECK( 5, 0, 0 )
|
||||
#include "Source.h"
|
||||
#endif
|
||||
|
||||
|
||||
namespace Tomahawk
|
||||
{
|
||||
|
@@ -21,7 +21,6 @@
|
||||
#include "Source.h"
|
||||
#include "network/Servent.h"
|
||||
#include "SourceList.h"
|
||||
#include "EchonestCatalogSynchronizer.h"
|
||||
|
||||
namespace Tomahawk
|
||||
{
|
||||
@@ -76,9 +75,11 @@ DatabaseCommand_SetCollectionAttributes::exec( DatabaseImpl *lib )
|
||||
void
|
||||
DatabaseCommand_SetCollectionAttributes::postCommitHook()
|
||||
{
|
||||
/*
|
||||
if ( m_type == EchonestSongCatalog ||
|
||||
m_type == EchonestArtistCatalog )
|
||||
Tomahawk::EchonestCatalogSynchronizer::instance()->knownCatalogsChanged();
|
||||
*/
|
||||
|
||||
if ( source()->isLocal() )
|
||||
Servent::instance()->triggerDBSync();
|
||||
|
@@ -25,10 +25,6 @@
|
||||
#include "PlaylistEntry.h"
|
||||
#include "SourceList.h"
|
||||
|
||||
// Forward Declarations breaking QSharedPointer
|
||||
#if QT_VERSION < QT_VERSION_CHECK( 5, 0, 0 )
|
||||
#include "collection/Collection.h"
|
||||
#endif
|
||||
|
||||
using namespace Tomahawk;
|
||||
|
||||
|
@@ -34,11 +34,11 @@ public:
|
||||
explicit DatabaseResolver( int weight );
|
||||
|
||||
QString name() const override;
|
||||
virtual unsigned int weight() const { return m_weight; }
|
||||
virtual unsigned int timeout() const { return 0; }
|
||||
virtual unsigned int weight() const override{ return m_weight; }
|
||||
virtual unsigned int timeout() const override{ return 0; }
|
||||
|
||||
public slots:
|
||||
virtual void resolve( const Tomahawk::query_ptr& query );
|
||||
virtual void resolve( const Tomahawk::query_ptr& query ) override;
|
||||
|
||||
private slots:
|
||||
void gotResults( const Tomahawk::QID qid, QList< Tomahawk::result_ptr> results );
|
||||
|
@@ -40,6 +40,11 @@ using namespace Tomahawk;
|
||||
void
|
||||
DirLister::go()
|
||||
{
|
||||
if ( m_dirs.isEmpty() )
|
||||
{
|
||||
emit finished();
|
||||
return;
|
||||
}
|
||||
foreach ( const QString& dir, m_dirs )
|
||||
{
|
||||
m_opcount++;
|
||||
|
@@ -54,7 +54,7 @@ ACLJobDelegate::paint( QPainter* painter, const QStyleOptionViewItem& option, co
|
||||
if ( !item )
|
||||
return;
|
||||
//tDebug( LOGVERBOSE ) << Q_FUNC_INFO;
|
||||
QStyleOptionViewItemV4 opt = option;
|
||||
QStyleOptionViewItem opt = option;
|
||||
initStyleOption( &opt, index );
|
||||
QFontMetrics fm( opt.font );
|
||||
|
||||
|
@@ -29,11 +29,6 @@
|
||||
|
||||
#include <QTimer>
|
||||
|
||||
// Forward Declarations breaking QSharedPointer
|
||||
#if QT_VERSION < QT_VERSION_CHECK( 5, 0, 0 )
|
||||
#include "Source.h"
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
InboxJobItem::InboxJobItem( Side side,
|
||||
|
@@ -47,7 +47,7 @@ JobStatusDelegate::~JobStatusDelegate()
|
||||
void
|
||||
JobStatusDelegate::paint( QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index ) const
|
||||
{
|
||||
QStyleOptionViewItemV4 opt = option;
|
||||
QStyleOptionViewItem opt = option;
|
||||
initStyleOption( &opt, index );
|
||||
QFontMetrics fm( painter->font() );
|
||||
const bool allowMultiLine = index.data( JobStatusModel::AllowMultiLineRole ).toBool();
|
||||
@@ -106,7 +106,7 @@ JobStatusDelegate::sizeHint( const QStyleOptionViewItem& option, const QModelInd
|
||||
return QSize( QStyledItemDelegate::sizeHint( option, index ).width(), m_cachedMultiLineHeights[ index ] );
|
||||
|
||||
// Don't elide, but stretch across as many rows as required
|
||||
QStyleOptionViewItemV4 opt = option;
|
||||
QStyleOptionViewItem opt = option;
|
||||
initStyleOption( &opt, index );
|
||||
|
||||
const QString text = index.data( Qt::DisplayRole ).toString();
|
||||
|
@@ -31,12 +31,6 @@
|
||||
#include "Track.h"
|
||||
|
||||
|
||||
// Forward Declarations breaking QSharedPointer
|
||||
#if QT_VERSION < QT_VERSION_CHECK( 5, 0, 0 )
|
||||
#include "collection/Collection.h"
|
||||
#endif
|
||||
|
||||
|
||||
TransferStatusItem::TransferStatusItem( TransferStatusManager* p, StreamConnection* sc )
|
||||
: m_parent( p )
|
||||
, m_stream( QPointer< StreamConnection >( sc ) )
|
||||
|
@@ -42,8 +42,8 @@ public:
|
||||
explicit DBSyncConnection( Servent* s, const Tomahawk::source_ptr& src );
|
||||
virtual ~DBSyncConnection();
|
||||
|
||||
void setup();
|
||||
Connection* clone();
|
||||
void setup() override;
|
||||
Connection* clone() override;
|
||||
|
||||
signals:
|
||||
void stateChanged( Tomahawk::DBSyncConnectionState newstate, Tomahawk::DBSyncConnectionState oldstate, const QString& info );
|
||||
|
@@ -23,10 +23,6 @@
|
||||
|
||||
#include "utils/Logger.h"
|
||||
|
||||
#if QT_VERSION < QT_VERSION_CHECK( 5, 0, 0 )
|
||||
#include "Msg.h"
|
||||
#endif
|
||||
|
||||
void
|
||||
QTcpSocketExtra::connectToHost( const QHostAddress& host, quint16 port, OpenMode openMode )
|
||||
{
|
||||
|
@@ -576,11 +576,7 @@ Servent::handleSipInfo( const Tomahawk::peerinfo_ptr& peerInfo )
|
||||
|
||||
|
||||
void
|
||||
#if QT_VERSION >= QT_VERSION_CHECK( 5, 0, 0 )
|
||||
Servent::incomingConnection( qintptr sd )
|
||||
#else
|
||||
Servent::incomingConnection( int sd )
|
||||
#endif
|
||||
{
|
||||
Q_ASSERT( this->thread() == QThread::currentThread() );
|
||||
|
||||
|
@@ -157,11 +157,7 @@ signals:
|
||||
void ready();
|
||||
|
||||
protected:
|
||||
#if QT_VERSION >= QT_VERSION_CHECK( 5, 0, 0 )
|
||||
void incomingConnection( qintptr sd ) Q_DECL_OVERRIDE;
|
||||
#else
|
||||
void incomingConnection( int sd ) Q_DECL_OVERRIDE;
|
||||
#endif
|
||||
|
||||
public slots:
|
||||
void setExternalAddress( QHostAddress ha, unsigned int port );
|
||||
|
@@ -108,7 +108,7 @@ ColumnItemDelegate::paint( QPainter* painter, const QStyleOptionViewItem& option
|
||||
QColor textColor = TomahawkUtils::alphaBlend( option.palette.color( QPalette::Foreground ), option.palette.color( QPalette::Background ), opacity );
|
||||
|
||||
{
|
||||
QStyleOptionViewItemV4 o = option;
|
||||
QStyleOptionViewItem o = option;
|
||||
initStyleOption( &o, QModelIndex() );
|
||||
|
||||
painter->save();
|
||||
@@ -190,7 +190,7 @@ ColumnItemDelegate::paint( QPainter* painter, const QStyleOptionViewItem& option
|
||||
if ( text.trimmed().isEmpty() )
|
||||
text = tr( "Unknown" );
|
||||
|
||||
QStyleOptionViewItemV4 opt = option;
|
||||
QStyleOptionViewItem opt = option;
|
||||
initStyleOption( &opt, QModelIndex() );
|
||||
|
||||
const QModelIndex curIndex = m_view->currentIndex();
|
||||
|
@@ -129,7 +129,7 @@ GridItemDelegate::paint( QPainter* painter, const QStyleOptionViewItem& option,
|
||||
if ( !item || !index.isValid() )
|
||||
return;
|
||||
|
||||
QStyleOptionViewItemV4 opt = option;
|
||||
QStyleOptionViewItem opt = option;
|
||||
initStyleOption( &opt, QModelIndex() );
|
||||
// qApp->style()->drawControl( QStyle::CE_ItemViewItem, &opt, painter );
|
||||
|
||||
|
@@ -59,7 +59,7 @@ public:
|
||||
|
||||
PlayableModel* sourceModel() const { return m_model; }
|
||||
virtual void setSourcePlayableModel( PlayableModel* sourceModel );
|
||||
virtual void setSourceModel( QAbstractItemModel* model );
|
||||
virtual void setSourceModel( QAbstractItemModel* model ) override;
|
||||
|
||||
virtual bool isLoading() const;
|
||||
|
||||
@@ -91,9 +91,9 @@ public:
|
||||
|
||||
QList< double > columnWeights() const;
|
||||
|
||||
virtual int columnCount( const QModelIndex& parent = QModelIndex() ) const;
|
||||
virtual QVariant data( const QModelIndex& index, int role = Qt::DisplayRole ) const;
|
||||
virtual QVariant headerData( int section, Qt::Orientation orientation, int role ) const;
|
||||
virtual int columnCount( const QModelIndex& parent = QModelIndex() ) const override;
|
||||
virtual QVariant data( const QModelIndex& index, int role = Qt::DisplayRole ) const override;
|
||||
virtual QVariant headerData( int section, Qt::Orientation orientation, int role ) const override;
|
||||
|
||||
virtual void setFilter( const QString& pattern );
|
||||
virtual void updateDetailedInfo( const QModelIndex& index );
|
||||
@@ -120,7 +120,7 @@ signals:
|
||||
|
||||
protected:
|
||||
bool filterAcceptsRow( int sourceRow, const QModelIndex& sourceParent ) const Q_DECL_OVERRIDE;
|
||||
virtual bool lessThan( const QModelIndex& left, const QModelIndex& right ) const;
|
||||
virtual bool lessThan( const QModelIndex& left, const QModelIndex& right ) const override;
|
||||
|
||||
Tomahawk::playlistinterface_ptr m_playlistInterface;
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user