1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-09-08 05:00:50 +02:00

Compare commits

..

1 Commits

Author SHA1 Message Date
Dominik Schmidt
27924c81fd Don't use processEvents and still don't block ui for loading a script collection 2016-01-18 21:46:24 +01:00
298 changed files with 3858 additions and 3437 deletions

View File

@@ -1,16 +0,0 @@
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

View File

@@ -1,18 +0,0 @@
name: Docker Image CI
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Login to DockerHub Registry
run: echo ${{ secrets.DOCKERHUB_PASSWORD }} | docker login -u ${{ secrets.DOCKERHUB_USERNAME }} --password-stdin
- name: Build the Docker image
run: cd Docker && docker build . --file Dockerfile --tag ${{ secrets.DOCKERHUB_USERNAME }}/ubuntu:latest
- name: Push the latest Docker image
run: docker push ${{ secrets.DOCKERHUB_USERNAME }}/ubuntu:latest

View File

@@ -2,18 +2,10 @@ 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 NEW)
# Let AUTOMOC and AUTOUIC process generated files
IF(POLICY CMP0071)
CMAKE_POLICY(SET CMP0071 NEW)
ENDIF()
CMAKE_POLICY(SET CMP0023 OLD)
# TODO:
# Disable automatic qtmain linking
@@ -97,7 +89,8 @@ 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" OFF)
option(BUILD_HATCHET "Build the Hatchet plugin" ON)
option(BUILD_WITH_QT4 "Build Tomahawk with Qt4 instead of Qt5" OFF)
if(UNIX AND NOT APPLE)
set(CRASHREPORTER_ENABLED_BY_DEFAULT OFF)
@@ -106,6 +99,8 @@ 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)
@@ -166,45 +161,158 @@ INCLUDE( MacroLogFeature )
message( STATUS "Building Tomahawk ${TOMAHAWK_VERSION} ***" )
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( 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)
if(Qt5X11Extras_FOUND)
set(HAVE_X11 TRUE)
if(Qt5X11Extras_FOUND)
set(HAVE_X11 TRUE)
else()
set(HAVE_X11 FALSE)
endif()
message(STATUS "Found Qt5! Be aware that Qt5-support is still experimental and not officially supported!")
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...")
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" )
else()
set(HAVE_X11 FALSE)
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++" )
endif()
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)
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")
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
@@ -212,6 +320,11 @@ 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 )
@@ -230,15 +343,23 @@ macro_log_feature(GNUTLS_FOUND "GnuTLS"
"http://gnutls.org/" TRUE ""
"GnuTLS is needed for serving the Playdar/HTTP API via TLS")
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")
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)
endif()
macro_log_feature(QCA2_FOUND "QCA2" "Provides encryption and signing functions necessary for some resolvers and accounts" "http://delta.affinix.com/qca/" TRUE "" "")
macro_optional_find_package(KF5Attica 1.0.0)
set(LIBATTICA_FOUND ${KF5Attica_FOUND})
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_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)
@@ -254,13 +375,21 @@ 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 )
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 "" "")
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 "" "")
endif()
if( UNIX AND NOT APPLE )
macro_optional_find_package(TelepathyQt 0.9.3)
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")
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()
endif()
# we need pthreads too
@@ -274,7 +403,7 @@ if( WIN32 )
endif( WIN32 )
if( WIN32 OR APPLE )
macro_optional_find_package(LibsnoreQt5 0.6.0 QUIET)
macro_optional_find_package(LibsnoreQt5 0.5.70 QUIET)
macro_log_feature(LibsnoreQt5_FOUND "Libsnore" "Library for notifications" "https://projects.kde.org/projects/playground/libs/snorenotify" FALSE "" "")
endif()
@@ -305,7 +434,23 @@ add_subdirectory(${THIRDPARTY_DIR}/libportfwd)
#### submodules end
SET( CLEAN_C_FLAGS ${CMAKE_C_FLAGS} )
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()
#show dep log
macro_display_feature_log()
@@ -318,6 +463,11 @@ 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
#
@@ -347,7 +497,6 @@ ADD_SUBDIRECTORY( src )
ADD_SUBDIRECTORY( admin )
IF(BUILD_TESTS)
find_package(Qt5Test REQUIRED)
enable_testing()
ADD_SUBDIRECTORY( src/tests )
ENDIF()

View File

@@ -0,0 +1,42 @@
# - 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)

View File

@@ -6,22 +6,31 @@
# LIBJREEN_FOUND, whether libjreen was found
FIND_PACKAGE(PkgConfig QUIET)
PKG_CHECK_MODULES(PC_JREEN QUIET libjreen-qt5)
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})
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-qt5
jreen${JREEN_INCLUDE_SUFFIX}
)
FIND_LIBRARY(JREEN_LIBRARIES NAMES jreen-qt5
FIND_LIBRARY(JREEN_LIBRARIES NAMES jreen${JREEN_LIB_SUFFIX}
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)

View File

@@ -0,0 +1,20 @@
# 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)

View File

@@ -7,15 +7,21 @@
# (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 lastfm5/Track.h
NAMES lastfm${LASTFM_LIB_SUFFIX}/Track.h
PATHS ${KDE4_INCLUDE_DIR}
)
# Finally the library itself
find_library(LIBLASTFM_LIBRARY
NAMES lastfm5
NAMES lastfm${LASTFM_LIB_SUFFIX}
PATHS ${KDE4_LIB_DIR}
)
set(LIBLASTFM_LIBRARIES ${LIBLASTFM_LIBRARY})

View File

@@ -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 VERSION_LESS "${LUCENEPP_MIN_VERSION}")
IF (LUCENEPP_VERSION STRLESS "${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 VERSION_LESS "${LUCENEPP_MIN_VERSION}")
ENDIF (LUCENEPP_VERSION STRLESS "${LUCENEPP_MIN_VERSION}")
ENDIF (LUCENEPP_LIBRARY_DIR)
IF(LUCENEPP_INCLUDE_DIR AND LUCENEPP_LIBRARIES AND LUCENEPP_LIBRARY_DIR AND LUCENEPP_GOOD_VERSION)

View File

@@ -0,0 +1,89 @@
# - 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)

View File

@@ -0,0 +1,29 @@
# 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)

View File

@@ -5,12 +5,22 @@
# QTSPARKLE_LIBRARY, the path to qtsparkle
# QTSPARKLE_FOUND, whether qtsparkle was found
FIND_PATH(QTSPARKLE_INCLUDE_DIR NAMES qtsparkle-qt5/Updater
HINTS ${CMAKE_INSTALL_INCLUDEDIR}
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_LIBRARY(QTSPARKLE_LIBRARIES NAMES qtsparkle-qt5
HINTS ${CMAKE_INSTALL_LIBDIR}
FIND_LIBRARY(QTSPARKLE_LIBRARIES NAMES qtsparkle${QTSPARKLE_SUFFIX}
HINTS
${CMAKE_INSTALL_LIBDIR}
${KDE4_LIB_DIR}
)
INCLUDE(FindPackageHandleStandardArgs)

View File

@@ -9,15 +9,18 @@ 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 libquazip5.dll
NAMES libquazip${QUAZIP_LIB_VERSION_SUFFIX}.dll
HINTS "C:/Programme/" "C:/Program Files"
PATH_SUFFIXES QuaZip/lib
)
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_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_PATH(QUAZIP_ZLIB_INCLUDE_DIR NAMES zlib.h)
ELSE(WIN32)
FIND_PACKAGE(PkgConfig)
@@ -25,12 +28,12 @@ ELSE (QUAZIP_INCLUDE_DIRS AND QUAZIP_LIBRARIES)
pkg_check_modules(PC_QUAZIP quazip)
FIND_LIBRARY(QUAZIP_LIBRARIES
WIN32_DEBUG_POSTFIX d
NAMES quazip5
NAMES quazip${QUAZIP_LIB_VERSION_SUFFIX}
HINTS /usr/lib /usr/lib64
)
FIND_PATH(QUAZIP_INCLUDE_DIR quazip.h
HINTS /usr/include /usr/local/include
PATH_SUFFIXES quazip5
PATH_SUFFIXES quazip${QUAZIP_LIB_VERSION_SUFFIX}
)
FIND_PATH(QUAZIP_ZLIB_INCLUDE_DIR zlib.h HINTS /usr/include /usr/local/include)
ENDIF (WIN32)

View File

@@ -61,6 +61,7 @@ ELSE()
tag.h
PATH_SUFFIXES taglib
PATHS
${KDE4_INCLUDE_DIR}
${INCLUDE_INSTALL_DIR}
)
@@ -68,6 +69,7 @@ ELSE()
WIN32_DEBUG_POSTFIX d
NAMES tag
PATHS
${KDE4_LIB_DIR}
${LIB_INSTALL_DIR}
)

View File

@@ -2,14 +2,25 @@
include(FindPackageHandleStandardArgs)
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})
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()
set(TELEPATHY_QT_FOUND ${TelepathyQt_FOUND})

View File

@@ -0,0 +1,182 @@
# - 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()

View File

@@ -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_PROPERTIES("${_package}" PROPERTIES DESCRIPTION "\"${_description}\"" URL "${_url}" PURPOSE "\"${_comments}\"")
SET_PACKAGE_INFO("${_package}" "\"${_description}\"" "${_url}" "\"${_comments}\"")
ENDIF(COMMAND SET_PACKAGE_INFO)
ENDMACRO(MACRO_LOG_FEATURE)

View File

@@ -18,10 +18,11 @@
!ifndef MINGW_ROOT
!define MINGW_ROOT "/usr/i686-w64-mingw32/sys-root/mingw"
!endif
!define APPLICATION_NAME "@CPACK_PACKAGE_NAME@"
!define TARGET_NAME "@CPACK_PACKAGE_TARGET_NAME@"
!define APPLICATION_NAME "Tomahawk"
!define TARGET_NAME "tomahawk"
;define app id needed for Windows 8 notifications
!define AppUserModelId "@TOMAHAWK_APPLICATION_PACKAGE_NAME@"
!define AppUserModelId @TOMAHAWK_APPLICATION_PACKAGE_NAME@
!define MINGW_BIN "${MINGW_ROOT}/bin"
!define MINGW_LIB "${MINGW_ROOT}/lib"
@@ -346,108 +347,105 @@ Section "${APPLICATION_NAME}" SEC_TOMAHAWK_PLAYER
File "${QT_DLL_PATH}\icudata56.dll"
File "${QT_DLL_PATH}\icui18n56.dll"
;SQLite driver
SetOutPath "$INSTDIR\sqldrivers"
File "${SQLITE_DLL_PATH}\qsqlite.dll"
SetOutPath "$INSTDIR"
File "${MINGW_BIN}\libsqlite3-0.dll"
;SQLite driver
SetOutPath "$INSTDIR\sqldrivers"
File "${SQLITE_DLL_PATH}\qsqlite.dll"
SetOutPath "$INSTDIR"
File "${MINGW_BIN}\libsqlite3-0.dll"
;Qt platform plugins
SetOutPath "$INSTDIR\platforms"
File "${MINGW_LIB}/qt5/plugins/platforms/qwindows.dll"
SetOutPath "$INSTDIR"
;Qt platform plugins
SetOutPath "$INSTDIR\platforms"
File "${MINGW_LIB}/qt5/plugins/platforms/qwindows.dll"
SetOutPath "$INSTDIR"
;Image plugins
SetOutPath "$INSTDIR\imageformats"
File "${IMAGEFORMATS_DLL_PATH}\qgif.dll"
File "${IMAGEFORMATS_DLL_PATH}\qjpeg.dll"
File "${IMAGEFORMATS_DLL_PATH}\qsvg.dll"
SetOutPath "$INSTDIR"
;Image plugins
SetOutPath "$INSTDIR\imageformats"
File "${IMAGEFORMATS_DLL_PATH}\qgif.dll"
File "${IMAGEFORMATS_DLL_PATH}\qjpeg.dll"
File "${IMAGEFORMATS_DLL_PATH}\qsvg.dll"
SetOutPath "$INSTDIR"
;Qt qml plugins
SetOutPath "$INSTDIR\QtQuick.2"
File /r /x *.debug "${QT_QML_PATH}\QtQuick.2\*"
SetOutPath "$INSTDIR\QtQuick\Window.2"
File /r /x *.debug "${QT_QML_PATH}\QtQuick\Window.2\*"
SetOutPath "$INSTDIR"
;Qt qml plugins
SetOutPath "$INSTDIR\QtQuick.2"
File /r /x *.debug "${QT_QML_PATH}\QtQuick.2\*"
SetOutPath "$INSTDIR\QtQuick\Window.2"
File /r /x *.debug "${QT_QML_PATH}\QtQuick\Window.2\*"
SetOutPath "$INSTDIR"
;Cygwin/c++ stuff
File "${MINGW_BIN}\libgcc_s_sjlj-1.dll"
File "${MINGW_BIN}\libstdc++-6.dll"
;Cygwin/c++ stuff
File "${MINGW_BIN}\libgcc_s_sjlj-1.dll"
File "${MINGW_BIN}\libstdc++-6.dll"
;VLC
File "${VLC_BIN}\libvlc.dll"
File "${VLC_BIN}\libvlccore.dll"
SetOutPath "$INSTDIR\plugins"
File /r "${VLC_PLUGIN_PATH}\*.dll"
SetOutPath "$INSTDIR"
;VLC
File "${VLC_BIN}\libvlc.dll"
File "${VLC_BIN}\libvlccore.dll"
SetOutPath "$INSTDIR\plugins"
File /r "${VLC_PLUGIN_PATH}\*.dll"
SetOutPath "$INSTDIR"
; Other
File "${MINGW_BIN}\libtag.dll"
File "${MINGW_BIN}\libpng16-16.dll"
File "${MINGW_BIN}\libjpeg-8.dll"
File "${MINGW_BIN}\zlib1.dll"
File "${MINGW_BIN}\libfreetype-6.dll"
File "${MINGW_BIN}\libglib-2.0-0.dll"
File "${MINGW_BIN}\libharfbuzz-0.dll"
; Other
File "${MINGW_BIN}\libtag.dll"
File "${MINGW_BIN}\libpng16-16.dll"
File "${MINGW_BIN}\libjpeg-8.dll"
File "${MINGW_BIN}\zlib1.dll"
File "${MINGW_BIN}\libfreetype-6.dll"
File "${MINGW_BIN}\libglib-2.0-0.dll"
File "${MINGW_BIN}\libharfbuzz-0.dll"
; ANGLE
File "${MINGW_BIN}\D3DCompiler_43.dll"
File "${MINGW_BIN}\libechonest5.dll"
File "${MINGW_BIN}\liblastfm5.dll"
File "${MINGW_BIN}\libquazip5.dll"
File "${MINGW_BIN}\libqt5keychain.dll"
File "${MINGW_BIN}\libechonest5.dll"
File "${MINGW_BIN}\liblastfm5.dll"
File "${MINGW_BIN}\libquazip5.dll"
File "${MINGW_BIN}\libqt5keychain.dll"
; GnuTLS
File "${MINGW_BIN}\libgnutls-28.dll"
File "${MINGW_BIN}\libtasn1-6.dll"
File "${MINGW_BIN}\libgmp-10.dll"
File "${MINGW_BIN}\libhogweed-2-4.dll"
File "${MINGW_BIN}\libintl-8.dll"
File "${MINGW_BIN}\libnettle-4-6.dll"
File "${MINGW_BIN}\libp11-kit-0.dll"
File "${MINGW_BIN}\libffi-6.dll"
; GnuTLS
File "${MINGW_BIN}\libgnutls-28.dll"
File "${MINGW_BIN}\libtasn1-6.dll"
File "${MINGW_BIN}\libgmp-10.dll"
File "${MINGW_BIN}\libhogweed-4-1.dll"
File "${MINGW_BIN}\libintl-8.dll"
File "${MINGW_BIN}\libnettle-6-1.dll"
File "${MINGW_BIN}\libp11-kit-0.dll"
File "${MINGW_BIN}\libffi-6.dll"
; Snorenotify
File "${MINGW_BIN}\SnoreToast.exe"
File "${MINGW_BIN}\libsnore-qt5.dll"
File "${MINGW_BIN}\libsnoresettings-qt5.dll"
File "${MINGW_BIN}\snoresettings.exe"
File "${MINGW_LIB}\plugins\libsnore-qt5\libsnore_backend_growl.dll"
File "${MINGW_LIB}\plugins\libsnore-qt5\libsnore_settings_backend_growl.dll"
File "${MINGW_LIB}\plugins\libsnore-qt5\libsnore_backend_snarl.dll"
File "${MINGW_LIB}\plugins\libsnore-qt5\libsnore_settings_backend_snarl.dll"
File "${MINGW_LIB}\plugins\libsnore-qt5\libsnore_backend_snore.dll"
File "${MINGW_LIB}\plugins\libsnore-qt5\libsnore_settings_backend_snore.dll"
File "${MINGW_LIB}\plugins\libsnore-qt5\libsnore_backend_windowstoast.dll"
; Snorenotify
File "${MINGW_BIN}\SnoreToast.exe"
File "${MINGW_BIN}\libsnore-qt5.dll"
File "${MINGW_BIN}\libsnoresettings-qt5.dll"
File "${MINGW_BIN}\snoresettings.exe"
File "${MINGW_LIB}\plugins\libsnore-qt5\libsnore_backend_growl.dll"
File "${MINGW_LIB}\plugins\libsnore-qt5\libsnore_settings_backend_growl.dll"
File "${MINGW_LIB}\plugins\libsnore-qt5\libsnore_backend_snarl.dll"
File "${MINGW_LIB}\plugins\libsnore-qt5\libsnore_settings_backend_snarl.dll"
File "${MINGW_LIB}\plugins\libsnore-qt5\libsnore_backend_snore.dll"
File "${MINGW_LIB}\plugins\libsnore-qt5\libsnore_settings_backend_snore.dll"
File "${MINGW_LIB}\plugins\libsnore-qt5\libsnore_backend_windowstoast.dll"
; Snoregrowl
File "${MINGW_BIN}\libsnoregrowl++.dll"
File "${MINGW_BIN}\libsnoregrowl.dll"
; Snoregrowl
File "${MINGW_BIN}\libsnoregrowl++.dll"
File "${MINGW_BIN}\libsnoregrowl.dll"
; Jabber
File "${MINGW_BIN}\libjreen-qt5.dll"
File "${MINGW_BIN}\libidn-11.dll"
File "${MINGW_BIN}\libgsasl-7.dll"
File "${MINGW_BIN}\libqca-qt5.dll"
SetOutPath "$INSTDIR\crypto"
File "${MINGW_LIB}\qca-qt5\crypto\libqca-ossl.dll"
SetOutPath "$INSTDIR"
File "${MINGW_BIN}\libssl-10.dll"
File "${MINGW_BIN}\libcrypto-10.dll"
File "${MINGW_BIN}\libjreen-qt5.dll"
File "${MINGW_BIN}\libidn-11.dll"
File "${MINGW_BIN}\libgsasl-7.dll"
File "${MINGW_BIN}\libqca-qt5.dll"
SetOutPath "$INSTDIR\crypto"
File "${MINGW_LIB}\qca-qt5\crypto\libqca-ossl.dll"
SetOutPath "$INSTDIR"
File "${MINGW_BIN}\libssl-10.dll"
File "${MINGW_BIN}\libcrypto-10.dll"
; LucenePlusPlus
File "${MINGW_BIN}\liblucene++.dll"
File "${MINGW_BIN}\libboost_system-mt.dll"
File "${MINGW_BIN}\libboost_filesystem-mt.dll"
File "${MINGW_BIN}\libboost_iostreams-mt.dll"
File "${MINGW_BIN}\libboost_regex-mt.dll"
File "${MINGW_BIN}\libboost_thread-mt.dll"
File "${MINGW_BIN}\libbz2-1.dll"
; LucenePlusPlus
File "${MINGW_BIN}\liblucene++.dll"
File "${MINGW_BIN}\libboost_system-mt.dll"
File "${MINGW_BIN}\libboost_filesystem-mt.dll"
File "${MINGW_BIN}\libboost_iostreams-mt.dll"
File "${MINGW_BIN}\libboost_regex-mt.dll"
File "${MINGW_BIN}\libboost_thread-mt.dll"
File "${MINGW_BIN}\libbz2-1.dll"
File "${MINGW_BIN}\libqtsparkle-qt5.dll"
File "${MINGW_BIN}\libKF5Attica.dll"
File "${MINGW_BIN}\libqtsparkle-qt5.dll"
File "${MINGW_BIN}\libKF5Attica.dll"
SectionEnd
SectionGroup "Shortcuts"

View File

@@ -1,7 +1,6 @@
Version 0.9.0:
* Resolved various playback issues by switching to a new audio engine.
* Fixed collection sorting.
* Fixed volume/mute state not being reset correctly on startup.
Version 0.8.4:
* Fixed drag & drop issues on sidebar.

View File

@@ -1,2 +0,0 @@
DOCKER_IMAGE_NAME=tomahawkmusicplayer/ubuntu
DOCKER_IMAGE_VER=latest

View File

@@ -1,274 +0,0 @@
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
# MXE deps
RUN sudo apt-get update \
&& apt-get install -y --no-install-recommends \
autoconf \
automake \
autopoint \
bash \
bison \
bzip2 \
flex \
g++ \
g++-multilib \
gettext \
git \
gperf \
intltool \
libc6-dev-i386 \
libgdk-pixbuf2.0-dev \
libltdl-dev \
libssl-dev \
libtool-bin \
libxml-parser-perl \
lzip \
make \
openssl \
p7zip-full \
patch \
perl \
pkg-config \
python \
ruby \
sed \
unzip \
wget \
xz-utils \
&& rm -rf /var/lib/apt/lists/*
RUN git clone --depth 1 https://github.com/mxe/mxe.git --branch master --single-branch mxe \
&& sudo mv mxe /opt/mxe
ENV MXE_PATH=/opt/mxe
ENV MXE_TOOLCHAIN="i686-w64-mingw32.shared"
ENV MXE_CMAKE=i686-w64-mingw32.shared-cmake
ENV MXE_PLUGINS=/opt/mxe/plugins/gcc9
RUN cd $MXE_PATH \
&& sudo make MXE_TARGETS=$MXE_TOOLCHAIN MXE_PLUGIN_DIRS=$MXE_PLUGINS \
qt5
RUN cd $MXE_PATH \
&& sudo make MXE_TARGETS=$MXE_TOOLCHAIN MXE_PLUGIN_DIRS=$MXE_PLUGINS \
qttools
RUN cd $MXE_PATH \
&& sudo make MXE_TARGETS=$MXE_TOOLCHAIN MXE_PLUGIN_DIRS=$MXE_PLUGINS \
boost
RUN cd $MXE_PATH \
&& sudo make MXE_TARGETS=$MXE_TOOLCHAIN MXE_PLUGIN_DIRS=$MXE_PLUGINS \
cc \
qca \
qtsparkle \
nsis \
liblastfm \
libgsasl
RUN cd $MXE_PATH \
&& sudo make MXE_TARGETS=$MXE_TOOLCHAIN MXE_PLUGIN_DIRS=$MXE_PLUGINS \
qtwebkit \
sparsehash
ENV PATH=/opt/mxe/usr/bin:$PATH
RUN sudo chmod -R 777 /opt/mxe/.ccache
RUN git clone --depth 1 https://anongit.kde.org/extra-cmake-modules.git --branch master --single-branch ecm \
&& mkdir ecm/build && cd ecm/build \
&& $MXE_CMAKE -DCMAKE_BUILD_TYPE=Release .. \
&& $MXE_CMAKE --build . -j 16 --target install \
&& cd ../.. \
&& rm -r ecm
RUN git clone --depth 1 https://github.com/zaphoyd/websocketpp.git --branch master --single-branch websocketpp \
&& mkdir websocketpp/build && cd websocketpp/build \
&& $MXE_CMAKE .. \
&& $MXE_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 \
&& $MXE_CMAKE .. \
&& $MXE_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 \
&& $MXE_CMAKE -DCMAKE_INSTALL_PREFIX=/opt/mxe/usr \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_SHARED_LIBS=ON .. \
&& $MXE_CMAKE --build . -j 16 --target install \
&& cd ../.. \
&& rm -r taglib
RUN git clone --depth 1 https://github.com/KDE/attica.git --branch master --single-branch attica \
&& mkdir attica/build && cd attica/build \
&& $MXE_CMAKE -DCMAKE_BUILD_TYPE=Release .. \
&& $MXE_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 \
&& $MXE_CMAKE -DCMAKE_BUILD_TYPE=Release .. \
&& $MXE_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 \
# && $MXE_CMAKE -DCMAKE_BUILD_TYPE=Release .. \
# && $MXE_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

View File

@@ -1,8 +0,0 @@
#!/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

View File

@@ -1,79 +0,0 @@
#!/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"
}

View File

@@ -1,32 +0,0 @@
#!/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
export PATH=/opt/mxe/usr/bin:$PATH
# Startup user
exec gosu "$USER" "$@"

View File

@@ -39,10 +39,18 @@ 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.

View File

@@ -1,7 +1,3 @@
# 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!
@@ -77,12 +73,13 @@ You can download one of our nightly or stable builds:
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/)
@@ -90,10 +87,6 @@ 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/)

View File

@@ -25,13 +25,13 @@ function(tomahawk_add_library)
include_directories(${CMAKE_CURRENT_BINARY_DIR})
if(LIBRARY_UI)
qt5_wrap_ui(LIBRARY_UI_SOURCES ${LIBRARY_UI})
qt_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")
qt5_add_resources(LIBRARY_RC_SOURCES "resources.qrc")
qt_add_resources(LIBRARY_RC_SOURCES "resources.qrc")
list(APPEND LIBRARY_SOURCES ${LIBRARY_RC_SOURCES})
unset(LIBRARY_RC_SOURCES)
endif()
@@ -45,6 +45,9 @@ 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)
@@ -67,12 +70,12 @@ function(tomahawk_add_library)
endif()
# add link targets
target_link_libraries(${target} PRIVATE ${TOMAHAWK_LIBRARIES})
target_link_libraries(${target} ${TOMAHAWK_LIBRARIES})
if(LIBRARY_LINK_LIBRARIES)
target_link_libraries(${target} PUBLIC ${LIBRARY_LINK_LIBRARIES})
target_link_libraries(${target} ${LIBRARY_LINK_LIBRARIES})
endif()
if(LIBRARY_LINK_PRIVATE_LIBRARIES)
target_link_libraries(${target} PRIVATE ${LIBRARY_LINK_PRIVATE_LIBRARIES})
target_link_libraries(${target} LINK_PRIVATE ${LIBRARY_LINK_PRIVATE_LIBRARIES})
endif()
# add soversion

View File

@@ -2,7 +2,7 @@ INCLUDE( InstallRequiredSystemLibraries )
SET( CPACK_PACKAGE_CONTACT "Dominik Schmidt <domme@tomahawk-player.org>" )
SET( CPACK_PACKAGE_FILE_NAME "${TOMAHAWK_TARGET_NAME}-${TOMAHAWK_VERSION}" ) # Package file name without extension. Also a directory of installer cmake-2.5.0-Linux-i686
SET( CPACK_PACKAGE_FILE_NAME "${TOMAHAWK_APPLICATION_NAME}-${TOMAHAWK_VERSION}" ) # Package file name without extension. Also a directory of installer cmake-2.5.0-Linux-i686
# CPACK_GENERATOR CPack generator to be used STGZ;TGZ;TZ
# CPACK_INCLUDE_TOPLEVEL_DIRECTORY Controls whether CPack adds a top-level directory, usually of the form ProjectName-Version-OS, to the top of package tree. 0 to disable, 1 to enable
@@ -13,9 +13,7 @@ SET( CPACK_PACKAGE_DESCRIPTION_SUMMARY ${TOMAHAWK_DESCRIPTION_SUMMARY} ) # Des
SET( CPACK_PACKAGE_INSTALL_DIRECTORY ${TOMAHAWK_APPLICATION_NAME} ) # Installation directory on the target system -> C:\Program Files\fellody
SET( CPACK_PACKAGE_INSTALL_REGISTRY_KEY ${TOMAHAWK_APPLICATION_NAME} ) # Registry key used when installing this project CMake 2.5.0
SET( CPACK_PACKAGE_NAME ${TOMAHAWK_APPLICATION_NAME} ) # Package name, defaults to the project name
SET( CPACK_PACKAGE_TARGET_NAME ${TOMAHAWK_TARGET_NAME} ) # Used to build library and executable names
SET( CPACK_PACKAGE_VENDOR ${TOMAHAWK_ORGANIZATION_NAME} ) # Package vendor name
SET( TOMAHAWK_APPLICATION_PACKAGE_NAME ${TOMAHAWK_APPLICATION_PACKAGE_NAME} )
SET( CPACK_PACKAGE_VERSION_MAJOR ${TOMAHAWK_VERSION_MAJOR} )
SET( CPACK_PACKAGE_VERSION_MINOR ${TOMAHAWK_VERSION_MINOR} )
SET( CPACK_PACKAGE_VERSION_PATCH ${TOMAHAWK_VERSION_PATCH} )

View File

@@ -1,3 +1,105 @@
#FIXME: this duplicates top level cmakelists: how can we reduce code duplication?
set( TOMAHAWK_QT5 @TOMAHAWK_QT5@ )
if(TOMAHAWK_QT5)
message(STATUS "Found Qt5! Be aware that Qt5-support is still experimental and not officially supported!")
# 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()

View File

@@ -46,7 +46,7 @@ CERT_SIGNER=$2
cd ..
if [ -f ~/sign_step.sh ];
then
~/sign_step.sh "$CERT_SIGNER" "${TARGET_NAME}.app"
~/sign_step.sh "$CERT_SIGNER" "${TARGET_NAME}.app" || true
fi
header "Creating DMG"

View File

@@ -0,0 +1,12 @@
[Protocol]
exec=/path/to/binary "%u"
protocol=tomahawk
input=none
output=none
helper=true
listing=
reading=false
writing=false
makedir=false
deleting=false

View File

@@ -9,20 +9,19 @@ fi
rm -rvf vlc/
VLC_TARBALL="vlc.tar.bz2"
echo "Download phonon archive..."
# wget -c "http://downloads.sourceforge.net/project/vlc/1.1.9/win32/vlc-1.1.9-win32.7z?r=http%3A%2F%2Fwww.videolan.org%2Fvlc%2Fdownload-windows.html&ts=1306272584&use_mirror=leaseweb"
# wget -c "http://download.tomahawk-player.org/tomahawk-vlc-0.1.zip"
# wget -c http://people.videolan.org/~jb/phonon/phonon-vlc-last.7z
# wget -c http://people.videolan.org/~jb/phonon/phonon_phonon-vlc_20111128.7z
wget -c "http://download.tomahawk-player.org/test/$VLC_TARBALL"
wget -c http://download.tomahawk-player.org/test/vlc.tar.bz2
echo "Extract binary..."
# 7z x phonon*.7z
# mv -v vlc-*/ vlc/
# unzip tomahawk-vlc-0.1.zip
tar xvjf "$VLC_TARBALL"
tar xvjf vlc.tar.bz2
# echo "Download phonon_vlc_no_video.dll..."
# wget -c http://people.videolan.org/~jb/phonon/phonon_vlc_no_video.dll
@@ -73,9 +72,7 @@ rm -rvf \
**/libi420* \
**/libi422* \
mux/ \
stream_filter/*dash* \
stream_filter/*smooth* \
stream_filter/*record* \
stream_filter/ \
**/libtheora_plugin* \
**/liblibbluray_plugin* \
**/libdtv_plugin* \

View File

@@ -1,13 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg width="86px" height="86px" viewBox="0 0 86 86" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns">
<title>folder</title>
<description>Created with Sketch (http://www.bohemiancoding.com/sketch)</description>
<defs></defs>
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" sketch:type="MSPage">
<g id="folder" sketch:type="MSLayerGroup" transform="translate(0.000000, 13.000000)" fill="#000000">
<g id="Page-1" sketch:type="MSShapeGroup">
<path d="M84.1450038,10.4833376 C82.8248024,9.1092149 80.9427764,8.3195294 78.9789985,8.3195294 L72.233622,8.3195294 L34.4730823,8.3195294 L34.4730823,7.0184614 C34.4730823,3.1483061 31.3247762,0 27.4563602,0 L10.1441555,0 C6.27226058,0 3.12569415,3.1500456 3.12569415,7.0184614 L3.12569415,9.4918821 C1.2088801,10.761641 0,12.9237099 0,15.3362515 L0,54.4987445 C0,54.5057021 0,54.5178779 0.0017394,54.5265748 L0,54.5439688 C0,58.3897726 3.14656684,61.5154666 7.0184614,61.5154666 L72.2336242,61.5154666 C72.4736608,61.5154666 72.7102186,61.5050302 72.9432977,61.4789393 C72.9850432,61.4771999 73.028528,61.4650241 73.0702735,61.4615453 C73.2616071,61.4389332 73.4529406,61.4145816 73.6390559,61.3745755 C73.6686257,61.3693573 73.6947166,61.3606604 73.7242863,61.3519634 C73.9225774,61.3119573 74.1208685,61.2597754 74.3139414,61.200636 C74.3243778,61.1954178 74.3348142,61.191939 74.3452506,61.1884602 C76.756053,60.4300837 78.5998126,58.4123847 79.1059765,55.9198305 C79.1077159,55.912873 79.1077159,55.9024366 79.1077159,55.895479 C79.1512008,55.6937091 79.18251,55.4919392 79.2051221,55.2797329 C79.2103403,55.2240723 79.2155585,55.1684116 79.2190373,55.1092721 C79.2277343,55.0136054 79.2433888,54.9266356 79.2451282,54.8309688 L85.9539776,15.7937099 L85.9939837,15.4127822 C86.0705187,13.5587047 85.4147685,11.8086925 84.1450038,10.4833376 C84.1450038,10.4833376 85.4147685,11.8086925 84.1450038,10.4833376 L84.1450038,10.4833376" id="Shape"></path>
</g>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 2.1 KiB

View File

@@ -42,8 +42,6 @@ Tomahawk.apiVersion = "0.2.2";
//Statuses considered a success for HTTP request
var httpSuccessStatuses = [200, 201];
Tomahawk.error = console.error;
// install RSVP error handler for uncaught(!) errors
RSVP.on('error', function (reason) {
var resolverName = "";
@@ -51,9 +49,9 @@ RSVP.on('error', function (reason) {
resolverName = Tomahawk.resolver.instance.settings.name + " - ";
}
if (reason) {
Tomahawk.error(resolverName + 'Uncaught error:', reason);
console.error(resolverName + 'Uncaught error:', reason);
} else {
Tomahawk.error(resolverName + 'Uncaught error: error thrown from RSVP but it was empty');
console.error(resolverName + 'Uncaught error: error thrown from RSVP but it was empty');
}
});
@@ -275,45 +273,30 @@ Tomahawk.Resolver = {
getStreamUrl: function (params) {
return params;
},
getDownloadUrl: function (params) {
return params;
},
resolve: function() {
},
_adapter_resolve: function (params) {
return RSVP.Promise.resolve(this.resolve(params)).then(function (results) {
if(Array.isArray(results)) {
return {
'tracks': results
};
}
return results;
return {
'tracks': results
};
});
},
_adapter_search: function (params) {
return RSVP.Promise.resolve(this.search(params)).then(function (results) {
if(Array.isArray(results)) {
return {
'tracks': results
};
}
return results;
return {
'tracks': results
};
});
},
_adapter_testConfig: function (config) {
return RSVP.Promise.resolve(this.testConfig(config)).then(function (results) {
results = results || Tomahawk.ConfigTestResultType.Success;
return results;
}, function (error) {
return error;
return RSVP.Promise.resolve(this.testConfig(config)).then(function () {
return {result: Tomahawk.ConfigTestResultType.Success};
});
}
};
// help functions
Tomahawk.valueForSubNode = function (node, tag) {
@@ -384,6 +367,48 @@ Tomahawk.retrievedMetadata = function (metadataId, metadata, error) {
delete Tomahawk.retrieveMetadataCallbacks[metadataId];
};
/**
* Internal counter used to identify asyncRequest callback from native code.
*/
Tomahawk.asyncRequestIdCounter = 0;
/**
* Internal map used to map asyncRequestIds to the respective javascript
* callback functions.
*/
Tomahawk.asyncRequestCallbacks = {};
/**
* Pass the natively retrieved reply back to the javascript callback
* and augment the fake XMLHttpRequest object.
*
* Internal use only!
*/
Tomahawk.nativeAsyncRequestDone = function (reqId, xhr) {
// Check that we have a matching callback stored.
if (!Tomahawk.asyncRequestCallbacks.hasOwnProperty(reqId)) {
return;
}
// Call the real callback
if (xhr.readyState == 4 && httpSuccessStatuses.indexOf(xhr.status) != -1) {
// Call the real callback
if (Tomahawk.asyncRequestCallbacks[reqId].callback) {
Tomahawk.asyncRequestCallbacks[reqId].callback(xhr);
}
} else if (xhr.readyState === 4) {
Tomahawk.log("Failed to do nativeAsyncRequest");
Tomahawk.log("Status Code was: " + xhr.status);
if (Tomahawk.asyncRequestCallbacks[reqId].errorHandler) {
Tomahawk.asyncRequestCallbacks[reqId].errorHandler(xhr);
}
}
// Callbacks are only used once.
delete Tomahawk.asyncRequestCallbacks[reqId];
};
/**
* This method is externalized from Tomahawk.asyncRequest, so that other clients
* (like tomahawk-android) can inject their own logic that determines whether or not to do a request
@@ -398,9 +423,9 @@ var shouldDoNativeRequest = function (options) {
|| extraHeaders.hasOwnProperty("User-Agent")));
};
/**
* Possible options:
* - url: The URL to call
* - method: The HTTP request method (default: GET)
* - username: The username for HTTP Basic Auth
* - password: The password for HTTP Basic Auth
@@ -418,12 +443,7 @@ var doRequest = function(options) {
return this.responseHeaders;
};
xhr.getResponseHeader = function (header) {
for(key in xhr.responseHeaders) {
if(key.toLowerCase() === header.toLowerCase()) {
return xhr.responseHeaders[key];
}
}
return null;
return this.responseHeaders[header];
};
return xhr;
@@ -715,6 +735,7 @@ Tomahawk.base64Encode = function (b) {
return window.btoa(b);
};
Tomahawk.PluginManager = {
wrapperPrefix: '_adapter_',
objects: {},
@@ -745,6 +766,8 @@ Tomahawk.PluginManager = {
methodName = this.wrapperPrefix + methodName;
}
var pluginManager = this;
if (!this.objects[objectId]) {
Tomahawk.log("Object not found! objectId: " + objectId + " methodName: " + methodName);
} else {
@@ -765,21 +788,20 @@ Tomahawk.PluginManager = {
invoke: function (requestId, objectId, methodName, params) {
RSVP.Promise.resolve(this.invokeSync(requestId, objectId, methodName, params))
.then(function (result) {
var params = {
Tomahawk.reportScriptJobResults({
requestId: requestId,
data: result
};
Tomahawk.reportScriptJobResults(encodeParamsToNativeFunctions(params));
});
}, function (error) {
var params = {
Tomahawk.reportScriptJobResults({
requestId: requestId,
error: error
};
Tomahawk.reportScriptJobResults(encodeParamsToNativeFunctions(params));
});
});
}
};
var encodeParamsToNativeFunctions = function(param) {
return param;
};
@@ -793,7 +815,7 @@ Tomahawk.NativeScriptJobManager = {
var requestId = this.idCounter++;
var deferred = RSVP.defer();
this.deferreds[requestId] = deferred;
Tomahawk.invokeNativeScriptJob(requestId, methodName, encodeParamsToNativeFunctions(params));
Tomahawk.invokeNativeScriptJob(requestId, methodName, encodeParamsToNativeFunctions(params));;
return deferred.promise;
},
reportNativeScriptJobResult: function(requestId, result) {
@@ -1462,7 +1484,9 @@ Tomahawk.Collection = {
return new RSVP.Promise(function (resolve, reject) {
that.cachedDbs[id].changeVersion(that.cachedDbs[id].version, "", null,
function (err) {
Tomahawk.error("Error trying to change db version!", err);
if (console.error) {
console.error("Error!: %o", err);
}
reject();
}, function () {
delete that.cachedDbs[id];
@@ -1766,9 +1790,6 @@ 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;
},
@@ -1777,14 +1798,6 @@ Tomahawk.Collection = {
return this.resolver.getStreamUrl(params);
}
return params;
},
getDownloadUrl: function(params) {
if(this.resolver) {
return this.resolver.getDownloadUrl(params);
}
return params;
}
};

Binary file not shown.

View File

@@ -19,11 +19,9 @@ 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" )
# 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)
file( WRITE ${CMAKE_BINARY_DIR}/lang/tomahawk_i18n.qrc "${tomahawk_i18n_qrc_content}" )
qt5_add_translation(QM_FILES ${TS_FILES})
qt_add_translation(QM_FILES ${TS_FILES})
## HACK HACK HACK - around rcc limitations to allow out of source-tree building
set( trans_file tomahawk_i18n )

View File

@@ -3,7 +3,6 @@
<file>data/images/collection_background.png</file>
<file>data/images/playlist_background.png</file>
<file>data/images/filter.svg</file>
<file>data/images/folder.svg</file>
<file>data/images/loved.svg</file>
<file>data/images/love.svg</file>
<file>data/images/not-loved.svg</file>
@@ -170,6 +169,5 @@
<file>data/images/downloadbutton.svg</file>
<file>data/images/nav-back.svg</file>
<file>data/images/nav-forward.svg</file>
<file>data/sounds/silence.ogg</file>
</qresource>
</RCC>

View File

@@ -1,5 +1,7 @@
include( ${PROJECT_BINARY_DIR}/TomahawkUse.cmake )
setup_qt()
include_directories( ${CMAKE_CURRENT_BINARY_DIR}/libtomahawk )
include_directories( ${CMAKE_CURRENT_LIST_DIR}/libtomahawk )

View File

@@ -24,6 +24,13 @@ include_directories(
add_definitions(-D_WEBSOCKETPP_CPP11_STL_)
if(APPLE)
# http://stackoverflow.com/questions/7226753/osx-lion-xcode-4-1-how-do-i-setup-a-c0x-project/7236451#7236451
add_definitions(-std=c++11 -stdlib=libc++ -U__STRICT_ANSI__)
set(PLATFORM_SPECIFIC_LINK_LIBRARIES "/usr/lib/libc++.dylib")
else()
add_definitions(-std=c++0x)
endif()
tomahawk_add_plugin(hatchet
TYPE account

View File

@@ -25,6 +25,11 @@
#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;
@@ -64,13 +69,6 @@ Tomahawk::InfoSystem::XmppInfoPlugin::init()
}
const QString
Tomahawk::InfoSystem::XmppInfoPlugin::friendlyName() const
{
return "xmpp";
}
void
Tomahawk::InfoSystem::XmppInfoPlugin::pushInfo( Tomahawk::InfoSystem::InfoPushData pushData )
{

View File

@@ -38,18 +38,16 @@ namespace Tomahawk {
XmppInfoPlugin(XmppSipPlugin* parent);
virtual ~XmppInfoPlugin();
const QString friendlyName() const override;
signals:
void publishTune( QUrl url, Tomahawk::InfoSystem::InfoStringHash trackInfo );
public slots:
void notInCacheSlot( const Tomahawk::InfoSystem::InfoStringHash criteria, Tomahawk::InfoSystem::InfoRequestData requestData ) override;
void notInCacheSlot( const Tomahawk::InfoSystem::InfoStringHash criteria, Tomahawk::InfoSystem::InfoRequestData requestData );
protected slots:
void init() override;
void pushInfo( Tomahawk::InfoSystem::InfoPushData pushData ) override;
void getInfo( Tomahawk::InfoSystem::InfoRequestData requestData ) override;
void init();
void pushInfo( Tomahawk::InfoSystem::InfoPushData pushData );
void getInfo( Tomahawk::InfoSystem::InfoRequestData requestData );
private slots:
void audioStarted( const Tomahawk::InfoSystem::PushInfoPair& pushInfoPair );

View File

@@ -66,6 +66,29 @@ 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 )
@@ -73,6 +96,9 @@ 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();
@@ -168,9 +194,9 @@ InfoSystem::InfoPluginPtr
XmppSipPlugin::infoPlugin()
{
if ( m_infoPlugin.isNull() )
m_infoPlugin = QSharedPointer< Tomahawk::InfoSystem::XmppInfoPlugin >( new Tomahawk::InfoSystem::XmppInfoPlugin( this ) );
m_infoPlugin = QPointer< Tomahawk::InfoSystem::XmppInfoPlugin >( new Tomahawk::InfoSystem::XmppInfoPlugin( this ) );
return m_infoPlugin;
return InfoSystem::InfoPluginPtr( m_infoPlugin.data() );
}
@@ -259,7 +285,7 @@ XmppSipPlugin::onConnect()
// load XmppInfoPlugin
if ( infoPlugin() && Tomahawk::InfoSystem::InfoSystem::instance()->workerThread() )
{
infoPlugin()->moveToThread( Tomahawk::InfoSystem::InfoSystem::instance()->workerThread().data() );
infoPlugin().data()->moveToThread( Tomahawk::InfoSystem::InfoSystem::instance()->workerThread().data() );
Tomahawk::InfoSystem::InfoSystem::instance()->addInfoPlugin( infoPlugin() );
}
@@ -333,6 +359,7 @@ XmppSipPlugin::onDisconnect( Jreen::Client::DisconnectReason reason )
if ( !m_infoPlugin.isNull() )
{
Tomahawk::InfoSystem::InfoSystem::instance()->removeInfoPlugin( infoPlugin() );
delete m_infoPlugin;
}
}

View File

@@ -128,7 +128,7 @@ private:
int m_currentPort;
QString m_currentResource;
QSharedPointer< Tomahawk::InfoSystem::XmppInfoPlugin > m_infoPlugin;
QPointer< Tomahawk::InfoSystem::XmppInfoPlugin > m_infoPlugin;
Tomahawk::Accounts::Account::ConnectionState m_state;
// sort out

View File

@@ -54,14 +54,14 @@ public:
Account::ConnectionState connectionState() const;
public slots:
void connectPlugin() override;
void disconnectPlugin() override;
void connectPlugin();
void disconnectPlugin();
void advertise();
virtual void sendSipInfos( const Tomahawk::peerinfo_ptr& /* receiver */, const QList<SipInfo>& /* info */ ) override {}
virtual void sendSipInfos( const Tomahawk::peerinfo_ptr& /* receiver */, const QList<SipInfo>& /* info */ ) {}
void broadcastMsg( const QString& ) {}
bool addContact( const QString&, AddContactOptions, const QString& ) override { return false; }
bool addContact( const QString&, AddContactOptions, const QString& ) { return false; }
private slots:
void lanHostFound( const QString& host, int port, const QString& name, const QString& nodeid );

View File

@@ -3,11 +3,13 @@ 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)
qt5_wrap_ui( crashreporter_UI_HEADERS ${crashreporter_UI} )
qt5_add_resources( crashreporter_RC_RCC ${crashreporter_RC} )
qt_wrap_ui( crashreporter_UI_HEADERS ${crashreporter_UI} )
qt_add_resources( crashreporter_RC_RCC ${crashreporter_RC} )
if(BUILD_RELEASE)
@@ -41,7 +43,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)

View File

@@ -1,4 +1,5 @@
include_directories(
${ECHONEST_INCLUDE_DIR}
${Boost_INCLUDE_DIR}
)
if(WIN32 OR APPLE)
@@ -14,13 +15,14 @@ endif()
endif(WIN32 OR APPLE)
list(APPEND simple_plugins
Echonest
Charts
NewReleases
#Spotify
Spotify
Hypem
MusixMatch
MusicBrainz
#Rovi
Rovi
Discogs
)

View File

@@ -23,7 +23,11 @@
#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>

View File

@@ -25,7 +25,11 @@
#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>

View File

@@ -22,7 +22,6 @@
#include "utils/TomahawkUtils.h"
#include "utils/Logger.h"
#include "utils/NetworkAccessManager.h"
#include "TomahawkVersion.h"
#include <QNetworkReply>
#include <QDomDocument>
@@ -89,16 +88,6 @@ 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 )
@@ -122,7 +111,8 @@ MusicBrainzPlugin::notInCacheSlot( InfoStringHash criteria, InfoRequestData requ
TomahawkUtils::urlAddQueryItem( url, "limit", "100" );
tDebug() << Q_FUNC_INFO << url.toString();
QNetworkReply* reply = getUrl( url, QVariant::fromValue< Tomahawk::InfoSystem::InfoRequestData >( requestData ) );
QNetworkReply* reply = Tomahawk::Utils::nam()->get( QNetworkRequest( url ) );
reply->setProperty( "requestData", QVariant::fromValue< Tomahawk::InfoSystem::InfoRequestData >( requestData ) );
connect( reply, SIGNAL( finished() ), SLOT( gotReleaseGroupsSlot() ) );
@@ -141,7 +131,8 @@ MusicBrainzPlugin::notInCacheSlot( InfoStringHash criteria, InfoRequestData requ
TomahawkUtils::urlAddQueryItem( url, "limit", "100" );
tDebug() << Q_FUNC_INFO << url.toString();
QNetworkReply* reply = getUrl( url, QVariant::fromValue< Tomahawk::InfoSystem::InfoRequestData >( requestData ) );
QNetworkReply* reply = Tomahawk::Utils::nam()->get( QNetworkRequest( url ) );
reply->setProperty( "requestData", QVariant::fromValue< Tomahawk::InfoSystem::InfoRequestData >( requestData ) );
connect( reply, SIGNAL( finished() ), SLOT( gotReleasesSlot() ) );
@@ -163,7 +154,6 @@ 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() );
@@ -247,7 +237,8 @@ MusicBrainzPlugin::gotReleasesSlot()
TomahawkUtils::urlAddQueryItem( url, "inc", "recordings" );
tDebug() << Q_FUNC_INFO << url.toString();
QNetworkReply* newReply = getUrl( url, oldReply->property( "requestData" ) );
QNetworkReply* newReply = Tomahawk::Utils::nam()->get( QNetworkRequest( url ) );
newReply->setProperty( "requestData", oldReply->property( "requestData" ) );
connect( newReply, SIGNAL( finished() ), SLOT( gotRecordingsSlot() ) );
break;
@@ -270,8 +261,6 @@ 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" );

View File

@@ -59,7 +59,6 @@ private slots:
void gotReleaseGroupsSlot();
void gotReleasesSlot();
void gotRecordingsSlot();
QNetworkReply* getUrl( QUrl url, QVariant requestData );
};
}

View File

@@ -2,14 +2,13 @@ SET(fdo_srcs
fdonotify/FdoNotifyPlugin.cpp
fdonotify/ImageConverter.cpp
)
SET(FDO_LINK_LIBRARIES ${LINK_LIBRARIES} Qt5::DBus)
qt5_add_dbus_interface(fdo_srcs fdonotify/org.freedesktop.Notifications.xml
SET(FDO_LINK_LIBRARIES ${LINK_LIBRARIES})
qt_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} )
@@ -17,9 +16,9 @@ SET(mpris_srcs
mpris/MprisPlugin.cpp
)
qt5_add_dbus_adaptor(mpris_srcs mpris/MprisPluginRootAdaptor.xml
qt_add_dbus_adaptor(mpris_srcs mpris/MprisPluginRootAdaptor.xml
mpris/MprisPlugin.h Tomahawk::InfoSystem::MprisPlugin MprisPluginRootAdaptor MprisPluginRootAdaptor)
qt5_add_dbus_adaptor(mpris_srcs mpris/MprisPluginPlayerAdaptor.xml
qt_add_dbus_adaptor(mpris_srcs mpris/MprisPluginPlayerAdaptor.xml
mpris/MprisPlugin.h Tomahawk::InfoSystem::MprisPlugin MprisPluginPlayerAdaptor MprisPluginPlayerAdaptor)
tomahawk_add_plugin(mpris

View File

@@ -55,6 +55,11 @@
#include <QDBusPendingCallWatcher>
#include <QImage>
#if QT_VERSION < QT_VERSION_CHECK( 5, 0, 0 )
// QTextDocument provides Qt::escape()
#include <QTextDocument>
#endif
namespace Tomahawk
{
@@ -62,7 +67,11 @@ 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()
@@ -71,7 +80,7 @@ FdoNotifyPlugin::FdoNotifyPlugin()
, m_wmSupportsBodyMarkup( false )
{
tDebug( LOGVERBOSE ) << Q_FUNC_INFO;
m_supportedPushTypes << InfoNotifyUser << InfoNowPlaying << InfoNowResumed << InfoTrackUnresolved << InfoNowStopped << InfoInboxReceived;
m_supportedPushTypes << InfoNotifyUser << InfoNowPlaying << 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",
@@ -130,7 +139,6 @@ FdoNotifyPlugin::pushInfo( Tomahawk::InfoSystem::InfoPushData pushData )
return;
case Tomahawk::InfoSystem::InfoNowPlaying:
case Tomahawk::InfoSystem::InfoNowResumed:
nowPlaying( pushData.infoPair.second );
return;

View File

@@ -27,6 +27,12 @@
#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>

View File

@@ -24,7 +24,6 @@ tomahawk_add_library(${TOMAHAWK_PLAYDARAPI_LIBRARY_TARGET}
qtcertificateaddon
${GNUTLS_LIBRARIES}
EXPORT TomahawkLibraryDepends
EXPORT_MACRO TOMAHAWK_WIDGETS_EXPORT_PRO
VERSION ${TOMAHAWK_VERSION_SHORT}
)

View File

@@ -23,7 +23,7 @@
#include <QtCore/qglobal.h>
#ifndef TOMAHAWK_PLAYDARAPI_EXPORT
# if defined (TOMAHAWK_WIDGETS_EXPORT_PRO)
# if defined (tomahawk_playdarapi_EXPORTS)
# define TOMAHAWK_PLAYDARAPI_EXPORT Q_DECL_EXPORT
# else
# define TOMAHAWK_PLAYDARAPI_EXPORT Q_DECL_IMPORT

View File

@@ -34,7 +34,7 @@ public:
* Creates a Playdar HTTP interface
* @param ha Address to listen on
* @param port Port to listen on with HTTP
* @param sport Port to listen on with HTTPS
* @param sport Pot to listen on with HTTPS
* @param parent
*/
explicit PlaydarApi( QHostAddress ha, qint16 port, qint16 sport, QObject *parent = 0 );

View File

@@ -13,6 +13,5 @@ tomahawk_add_library(${TOMAHAWK_WIDGETS_LIBRARY_TARGET}
SOURCES ${${TOMAHAWK_WIDGETS_LIBRARY_TARGET}_SOURCES}
UI ${${TOMAHAWK_WIDGETS_LIBRARY_TARGET}_UI}
EXPORT TomahawkLibraryDepends
EXPORT_MACRO TOMAHAWK_WIDGETS_EXPORT_PRO
VERSION ${TOMAHAWK_VERSION_SHORT}
)

View File

@@ -64,7 +64,7 @@ PlaylistDelegate::PlaylistDelegate()
void
PlaylistDelegate::paint( QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index ) const
{
QStyleOptionViewItem opt = option;
QStyleOptionViewItemV4 opt = option;
initStyleOption( &opt, QModelIndex() );
qApp->style()->drawControl( QStyle::CE_ItemViewItem, &opt, painter );

View File

@@ -23,7 +23,7 @@
#include <QtCore/qglobal.h>
#ifndef TOMAHAWK_WIDGETS_EXPORT
# if defined (TOMAHAWK_WIDGETS_EXPORT_PRO)
# if defined (tomahawk_widgets_EXPORTS)
# define TOMAHAWK_WIDGETS_EXPORT Q_DECL_EXPORT
# else
# define TOMAHAWK_WIDGETS_EXPORT Q_DECL_IMPORT

View File

@@ -30,6 +30,11 @@
#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()
@@ -115,12 +120,9 @@ 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" ) );
@@ -169,8 +171,7 @@ ActionCollection::createMenuBar( QWidget *parent )
controlsMenu->addAction( m_actionCollection[ "showOfflineSources" ] );
controlsMenu->addSeparator();
controlsMenu->addAction( m_actionCollection[ "createPlaylist" ] );
// echonest is dead, disable stations
// controlsMenu->addAction( m_actionCollection[ "createStation" ] );
controlsMenu->addAction( m_actionCollection[ "createStation" ] );
controlsMenu->addAction( m_actionCollection[ "importPlaylist" ] );
controlsMenu->addAction( m_actionCollection[ "updateCollection" ] );
controlsMenu->addAction( m_actionCollection[ "rescanCollection" ] );

View File

@@ -33,7 +33,6 @@
#include <QReadWriteLock>
#include <QPixmapCache>
#include <QCoreApplication>
using namespace Tomahawk;
@@ -76,7 +75,6 @@ Album::get( const Tomahawk::artist_ptr& artist, const QString& name, bool autoCr
}
album_ptr album = album_ptr( new Album( name, artist ), &Album::deleteLater );
album->moveToThread( QCoreApplication::instance()->thread() );
album->setWeakRef( album.toWeakRef() );
album->loadId( autoCreate );
s_albumsByName.insert( key, album );

View File

@@ -25,6 +25,11 @@
#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"

View File

@@ -36,7 +36,6 @@
#include <QReadWriteLock>
#include <QPixmapCache>
#include <QCoreApplication>
using namespace Tomahawk;
@@ -110,7 +109,6 @@ Artist::get( unsigned int id, const QString& name )
}
artist_ptr a = artist_ptr( new Artist( id, name ), &Artist::deleteLater );
a->moveToThread( QCoreApplication::instance()->thread() );
a->setWeakRef( a.toWeakRef() );
s_artistsByName.insert( key, a );

View File

@@ -67,7 +67,7 @@ AtticaManager::AtticaManager( QObject* parent )
connect( &m_manager, SIGNAL( providerAdded( Attica::Provider ) ), this, SLOT( providerAdded( Attica::Provider ) ) );
// resolvers
// m_manager.addProviderFile( QUrl( "http://v09.bakery.tomahawk-player.org/resolvers/providers.xml" ) );
// m_manager.addProviderFile( QUrl( "http://bakery.tomahawk-player.org/resolvers/providers.xml" ) );
const QString url = QString( "%1/resolvers/providers.xml?version=%2" ).arg( hostname() ).arg( TomahawkUtils::appFriendlyVersion() );
QNetworkReply* reply = Tomahawk::Utils::nam()->get( QNetworkRequest( QUrl( url ) ) );
@@ -116,7 +116,7 @@ AtticaManager::fetchMissingIcons()
QString
AtticaManager::hostname() const
{
return "http://v09.bakery.tomahawk-player.org";
return "http://bakery.tomahawk-player.org";
}

View File

@@ -37,7 +37,6 @@ set( libGuiSources
jobview/ErrorStatusMessage.cpp
jobview/IndexingJobItem.cpp
jobview/InboxJobItem.cpp
jobview/ScriptErrorStatusMessage.cpp
playlist/InboxModel.cpp
playlist/InboxView.cpp
@@ -74,6 +73,9 @@ 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
@@ -143,7 +145,6 @@ set( libGuiSources
widgets/ClickableLabel.cpp
widgets/ComboBox.cpp
widgets/DropDownButton.cpp
widgets/DownloadButton.cpp
widgets/ElidedLabel.cpp
widgets/FilterHeader.cpp
widgets/CaptionLabel.cpp
@@ -173,6 +174,14 @@ 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
@@ -197,6 +206,7 @@ list(APPEND libSources
PlaylistInterface.cpp
UrlHandler.cpp
EchonestCatalogSynchronizer.cpp
accounts/AccountManager.cpp
accounts/Account.cpp
@@ -401,12 +411,13 @@ include_directories(
${QT_INCLUDE_DIR}
${QJSON_INCLUDE_DIR}
${ECHONEST_INCLUDE_DIR}
${LUCENEPP_INCLUDE_DIRS}
${LIBVLC_INCLUDE_DIR}
${Boost_INCLUDE_DIR}
${LIBPORTFWD_INCLUDE_DIR}
${QUAZIP_INCLUDE_DIRS}
${QUAZIP_INCLUDE_DIR}
${QTKEYCHAIN_INCLUDE_DIRS}
)
@@ -414,7 +425,9 @@ IF(LIBATTICA_FOUND)
SET( libGuiSources ${libGuiSources} AtticaManager.cpp )
INCLUDE_DIRECTORIES( ${LIBATTICA_INCLUDE_DIR} )
LIST(APPEND PRIVATE_LINK_LIBRARIES ${LIBATTICA_LIBRARIES} ${LibAttica_LIBRARIES} ${QUAZIP_LIBRARIES})
LIST(APPEND LINK_LIBRARIES KF5::Attica)
IF( TOMAHAWK_QT5 )
LIST(APPEND LINK_LIBRARIES KF5::Attica )
ENDIF( TOMAHAWK_QT5 )
ENDIF(LIBATTICA_FOUND)
if(HAVE_X11)
@@ -476,7 +489,7 @@ IF(BUILD_GUI)
LIST(APPEND libSources ${libGuiSources} )
ENDIF()
qt5_wrap_ui(libUI_H ${libUI})
qt_wrap_ui(libUI_H ${libUI})
SET( libSources ${libSources} ${libUI_H} )
@@ -490,12 +503,12 @@ set_target_properties(
OUTPUT_NAME ${TOMAHAWK_BASE_TARGET_NAME}
)
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()
qt5_use_modules(${TOMAHAWK_LIBRARY} Widgets Network Sql WebKitWidgets Concurrent Xml UiTools Svg)
IF(APPLE)
qt5_use_modules(${TOMAHAWK_LIBRARY} MacExtras)
ENDIF()
IF(QCA2_FOUND)
INCLUDE_DIRECTORIES( ${QCA2_INCLUDE_DIR} )
@@ -504,9 +517,11 @@ 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} PRIVATE
TARGET_LINK_LIBRARIES( ${TOMAHAWK_LIBRARY}
LINK_PRIVATE
${LIBVLC_LIBRARY}
# Thirdparty shipped with tomahawk
@@ -514,10 +529,11 @@ TARGET_LINK_LIBRARIES(${TOMAHAWK_LIBRARY} PRIVATE
${QTKEYCHAIN_LIBRARIES}
${PRIVATE_LINK_LIBRARIES}
PUBLIC
LINK_PUBLIC
# External deps
${QJSON_LIBRARIES}
${LUCENEPP_LIBRARIES}
${ECHONEST_LIBRARIES}
${QT_QTSQL_LIBRARY}
${QT_QTUITOOLS_LIBRARY}
${QT_QTGUI_LIBRARY}
@@ -561,7 +577,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" )
@@ -590,7 +606,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 )

View File

@@ -37,9 +37,6 @@
#include "utils/ImageRegistry.h"
#include "utils/Logger.h"
#include <QDesktopServices>
#include <QFileInfo>
using namespace Tomahawk;
@@ -54,7 +51,7 @@ ContextMenu::ContextMenu( QWidget* parent )
m_sigmap = new QSignalMapper( this );
connect( m_sigmap, SIGNAL( mapped( int ) ), SLOT( onTriggered( int ) ) );
clear();
m_supportedActions = ActionPlay | ActionQueue | ActionPlaylist | ActionCopyLink | ActionLove | ActionStopAfter | ActionPage | ActionEditMetadata | ActionSend;
}
@@ -72,7 +69,7 @@ ContextMenu::clear()
m_albums.clear();
m_artists.clear();
m_supportedActions = ActionPlay | ActionQueue | ActionPlaylist | ActionCopyLink | ActionLove | ActionStopAfter | ActionPage | ActionEditMetadata | ActionSend | ActionOpenFileManager;
m_supportedActions = ActionPlay | ActionQueue | ActionPlaylist | ActionCopyLink | ActionLove | ActionStopAfter | ActionPage | ActionEditMetadata | ActionSend;
}
@@ -219,23 +216,10 @@ ContextMenu::setQueries( const QList<Tomahawk::query_ptr>& queries )
addSeparator();
if ( m_supportedActions & ActionCopyLink && itemCount() == 1 )
{
m_sigmap->setMapping( addAction( tr( "&Copy Track Link" ) ), ActionCopyLink );
}
if ( m_supportedActions & ActionOpenFileManager &&
queries.length() == 1 &&
queries.first()->numResults() &&
queries.first()->results().first()->isLocal() )
{
m_sigmap->setMapping( addAction( ImageRegistry::instance()->icon( RESPATH "images/folder.svg" ),
tr( "Open Folder in File Manager..." ) ), ActionOpenFileManager );
}
if ( m_supportedActions & ActionEditMetadata && itemCount() == 1 )
{
m_sigmap->setMapping( addAction( tr( "Properties..." ) ), ActionEditMetadata );
}
addSeparator();
@@ -255,8 +239,6 @@ ContextMenu::setQueries( const QList<Tomahawk::query_ptr>& queries )
m_sigmap->setMapping( addAction( tr( "Mark as &Listened" ) ), ActionMarkListened );
}
addSeparator();
if ( m_supportedActions & ActionDelete )
m_sigmap->setMapping( addAction( queries.count() > 1 ? tr( "&Remove Items" ) : tr( "&Remove Item" ) ), ActionDelete );
@@ -412,15 +394,6 @@ ContextMenu::onTriggered( int action )
}
break;
case ActionOpenFileManager:
{
result_ptr result = m_queries.first()->results().first();
QString path = QFileInfo( result->url() ).path();
tLog() << Q_FUNC_INFO << "open directory" << path;
QDesktopServices::openUrl( path );
}
break;
default:
emit triggered( action );
}

View File

@@ -37,22 +37,21 @@ Q_OBJECT
public:
enum MenuActions
{
ActionPlay = 1,
ActionQueue = 2,
ActionDelete = 4,
ActionCopyLink = 8,
ActionLove = 16,
ActionStopAfter = 32,
ActionPage = 64,
ActionTrackPage = 128,
ActionArtistPage = 256,
ActionAlbumPage = 512,
ActionEditMetadata = 1024,
ActionPlaylist = 2048,
ActionSend = 4096,
ActionMarkListened = 8192,
ActionDownload = 16384,
ActionOpenFileManager = 32768
ActionPlay = 1,
ActionQueue = 2,
ActionDelete = 4,
ActionCopyLink = 8,
ActionLove = 16,
ActionStopAfter = 32,
ActionPage = 64,
ActionTrackPage = 128,
ActionArtistPage = 256,
ActionAlbumPage = 512,
ActionEditMetadata = 1024,
ActionPlaylist = 2048,
ActionSend = 4096,
ActionMarkListened = 8192,
ActionDownload = 16384
};
explicit ContextMenu( QWidget* parent = 0 );

View File

@@ -118,7 +118,7 @@ DownloadJob::localFile() const
QString
DownloadJob::localPath( const Tomahawk::album_ptr& album )
DownloadJob::localPath() const
{
QDir dir = TomahawkSettings::instance()->downloadsPath();
@@ -127,7 +127,7 @@ DownloadJob::localPath( const Tomahawk::album_ptr& album )
dir.mkpath( "." );
}
QString path = QString( "%1/%2" ).arg( safeEncode( album->artist()->name(), true ) ).arg( safeEncode( album->name(), true ) );
QString path = QString( "%1/%2" ).arg( safeEncode( m_track->artist(), true ) ).arg( safeEncode( m_track->album(), true ) );
dir.mkpath( path );
return QString( dir.path() + "/" + path ).replace( "//", "/" );
@@ -138,7 +138,7 @@ QUrl
DownloadJob::prepareFilename()
{
QString filename = QString( "%1. %2.%3" ).arg( m_track->albumpos() ).arg( safeEncode( m_track->track() ) ).arg( m_format.extension );
QString path = localPath( m_track->albumPtr() );
QString path = localPath();
QString localFile = QString( path + "/" + filename );
if ( !m_tryResuming )
@@ -206,17 +206,22 @@ DownloadJob::download()
{
if ( m_state == Running )
return true;
setState( Running );
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}});
}
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();
}
}
return true;
}
@@ -439,7 +444,7 @@ DownloadJob::checkForResumedFile()
QString
DownloadJob::safeEncode( const QString& filename, bool removeTrailingDots )
DownloadJob::safeEncode( const QString& filename, bool removeTrailingDots ) const
{
//FIXME: make it a regexp
QString res = QString( filename ).toLatin1().replace( "/", "_" ).replace( "\\", "_" )

View File

@@ -58,7 +58,7 @@ public:
long receivedSize() const { return m_rcvdSize; }
long fileSize() const { return m_fileSize; }
static QString localPath( const Tomahawk::album_ptr& album );
QString localPath() const;
QString localFile() const;
DownloadFormat format() const;
@@ -90,7 +90,7 @@ private slots:
private:
void storeState();
static QString safeEncode( const QString& filename, bool removeTrailingDots = false );
QString safeEncode( const QString& filename, bool removeTrailingDots = false ) const;
bool checkForResumedFile();
QUrl prepareFilename();

View File

@@ -24,8 +24,6 @@
#include "TomahawkSettings.h"
#include "infosystem/InfoSystem.h"
#include "utils/Logger.h"
#include "Result.h"
#include "Query.h"
DownloadManager* DownloadManager::s_instance = 0;
@@ -87,36 +85,6 @@ DownloadManager::localFileForDownload( const QString& url ) const
}
QUrl
DownloadManager::localUrlForDownload( const Tomahawk::query_ptr& query ) const
{
Tomahawk::result_ptr result = query->numResults( true ) ? query->results().first() : Tomahawk::result_ptr();
if ( result )
{
return localUrlForDownload( result );
}
return QUrl();
}
QUrl
DownloadManager::localUrlForDownload( const Tomahawk::result_ptr& result ) const
{
if ( result && !result->downloadFormats().isEmpty() &&
!localFileForDownload( result->downloadFormats().first().url.toString() ).isEmpty() )
{
return QUrl::fromLocalFile( QFileInfo( DownloadManager::instance()->localFileForDownload( result->downloadFormats().first().url.toString() ) ).absolutePath() );
}
else if ( result && result->downloadJob() && result->downloadJob()->state() == DownloadJob::Finished )
{
return QUrl::fromLocalFile( QFileInfo( result->downloadJob()->localFile() ).absolutePath() );
}
return QUrl();
}
void
DownloadManager::storeJobs( const QList<downloadjob_ptr>& jobs )
{

View File

@@ -45,8 +45,6 @@ public:
void storeJobs( const QList<downloadjob_ptr>& jobs );
QString localFileForDownload( const QString& url ) const;
QUrl localUrlForDownload( const Tomahawk::result_ptr& result ) const;
QUrl localUrlForDownload( const Tomahawk::query_ptr& query ) const;
public slots:
bool addJob( const downloadjob_ptr& job );

View File

@@ -263,14 +263,9 @@ bool
DropJob::validateLocalFiles(const QString &paths, const QString &suffix)
{
QStringList filePaths = paths.split( QRegExp( "\\s+" ), QString::SkipEmptyParts );
QStringList::iterator it = filePaths.begin();
while ( it != filePaths.end() )
{
for ( QStringList::iterator it = filePaths.begin(); it != filePaths.end(); ++it )
if ( !validateLocalFile( *it, suffix ) )
it = filePaths.erase( it );
else
++it;
}
filePaths.erase( it );
return !filePaths.isEmpty();
}
@@ -980,7 +975,7 @@ DropJob::removeRemoteSources()
foreach ( const Tomahawk::result_ptr& result, item->results() )
{
if ( !result->isLocal() )
if ( !result->resolvedByCollection().isNull() && !result->resolvedByCollection()->isLocal() )
{
list.append( item );
break;

View File

@@ -34,8 +34,13 @@
#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;

View File

@@ -22,7 +22,11 @@
#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>

View File

@@ -1,14 +1,14 @@
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
*
* Copyright 2011, Leo Franchi <lfranchi@kde.org>
* Copyright 2011-2016, Christian Muehlhaeuser <muesli@tomahawk-player.org>
* Copyright 2011, Jeff Mitchell <jeff@tomahawk-player.org>
* Copyright 2013, Uwe L. Korn <uwelk@xhochy.com>
* Copyright 2013, Teo Mrnjavac <teo@kde.org>
* Copyright (C) 2011 Leo Franchi <lfranchi@kde.org>
* Copyright (C) 2011, Jeff Mitchell <jeff@tomahawk-player.org>
* Copyright (C) 2011-2014, Christian Muehlhaeuser <muesli@tomahawk-player.org>
* Copyright (C) 2013, Uwe L. Korn <uwelk@xhochy.com>
* Copyright (C) 2013, Teo Mrnjavac <teo@kde.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
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* Tomahawk is distributed in the hope that it will be useful,
@@ -20,6 +20,7 @@
* along with Tomahawk. If not, see <http://www.gnu.org/licenses/>.
*/
#include "GlobalActionManager.h"
#include "accounts/AccountManager.h"
@@ -46,6 +47,12 @@
#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>
@@ -906,144 +913,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;
}
}

View File

@@ -1,21 +1,21 @@
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
*
* Copyright 2011, Leo Franchi <lfranchi@kde.org>
* Copyright 2011-2016, Christian Muehlhaeuser <muesli@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/>.
*/
/*
Copyright (C) 2011 Leo Franchi <lfranchi@kde.org>
This program 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 2 of the License, or
(at your option) any later version.
This program 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 this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef GLOBALACTIONMANAGER_H
#define GLOBALACTIONMANAGER_H

View File

@@ -29,6 +29,11 @@
#include <QAction>
// Forward Declarations breaking QSharedPointer
#if QT_VERSION < QT_VERSION_CHECK( 5, 0, 0 )
#include "Result.h"
#endif
using namespace Tomahawk;

View File

@@ -36,7 +36,7 @@
#define MAX_CONCURRENT_QUERIES 16
#define CLEANUP_TIMEOUT 5 * 60 * 1000
#define MINSCORE 0.5
#define DEFAULT_RESOLVER_TIMEOUT 5000 // 5 seconds
#define DEFAULT_RESOLVER_TIMEOUT 5000 //5 seconds
using namespace Tomahawk;
@@ -542,12 +542,12 @@ Pipeline::shuntNext()
q->setCurrentResolver( 0 );
}
// Zero-patient, a stub so that query is not resolved until we go through
// all resolvers
// As query considered as 'finished trying to resolve' when there are no
// more qid entries in qidsState we'll put one as sort of 'keep this until
// we kick off all our resolvers' entry
// once we kick off all resolvers we'll remove this entry
//Zero-patient, a stub so that query is not resolved until we go through
//all resolvers
//As query considered as 'finished trying to resolve' when there are no
//more qid entries in qidsState we'll put one as sort of 'keep this until
//we kick off all our resolvers' entry
//once we kick off all resolvers we'll remove this entry
incQIDState( q, nullptr );
checkQIDState( q );
}
@@ -595,8 +595,8 @@ Pipeline::shunt( const query_ptr& q )
// we get here if we disable a resolver while a query is resolving
// OR we are just out of resolvers while query is still resolving
// since we seem to at least tried to kick off all of the resolvers,
// remove the '.keep' entry
//since we seem to at least tried to kick off all of the resolvers,
//remove the '.keep' entry
decQIDState( q, nullptr );
return;
}
@@ -673,7 +673,7 @@ Pipeline::decQIDState( const Tomahawk::query_ptr& query, Tomahawk::Resolver* r )
{
{
QMutexLocker lock( &d->mut );
d->qidsState.remove( query->id(), r ); // Removes all matching pairs
d->qidsState.remove( query->id(), r );//Removes all matching pairs
}
checkQIDState( query );

View File

@@ -289,4 +289,9 @@ 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

View File

@@ -33,7 +33,6 @@
#include <QtAlgorithms>
#include <QDebug>
#include <QCoreApplication>
using namespace Tomahawk;
@@ -48,7 +47,6 @@ Query::get( const QString& artist, const QString& track, const QString& album, c
autoResolve = false;
query_ptr q = query_ptr( new Query( Track::get( artist, track, album ), qid, autoResolve ), &QObject::deleteLater );
q->moveToThread( QCoreApplication::instance()->thread() );
q->setWeakRef( q.toWeakRef() );
if ( autoResolve )
@@ -194,7 +192,7 @@ Query::addResults( const QList< Tomahawk::result_ptr >& newresults )
}*/
d->results << newresults;
sortResults();
qStableSort( d->results.begin(), d->results.end(), std::bind( &Query::resultSorter, this, std::placeholders::_1, std::placeholders::_2 ) );
// hook up signals, and check solved status
foreach( const result_ptr& rp, newresults )
@@ -258,7 +256,7 @@ Query::onResultStatusChanged()
Q_D( Query );
QMutexLocker lock( &d->mutex );
if ( !d->results.isEmpty() )
sortResults();
qStableSort( d->results.begin(), d->results.end(), std::bind( &Query::resultSorter, this, std::placeholders::_1, std::placeholders::_2 ) );
}
checkResults();
@@ -273,11 +271,6 @@ 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 );
@@ -401,35 +394,21 @@ 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;
if ( ls == rs )
{
if ( right->isLocal() )
if ( right->resolvedByCollection() && right->resolvedByCollection()->isLocal() )
{
return false;
}
if ( left->isPreview() != right->isPreview() )
if ( !right->isPreview() )
{
return !left->isPreview();
return false;
}
if ( left->resolvedBy() != nullptr && right->resolvedBy() != nullptr )
{
return left->resolvedBy()->weight() > right->resolvedBy()->weight();
}
return left->id() > right->id();
return true;
}
if ( left->isPreview() != right->isPreview() )
@@ -441,30 +420,6 @@ 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 )
{
@@ -660,10 +615,6 @@ 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();
@@ -685,13 +636,6 @@ 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(filterOutChars);
qTrackname.remove(filterOutChars);
qAlbumname.remove(filterOutChars);
// normal edit distance
const int artdist = TomahawkUtils::levenshtein( qArtistname, rArtistname );
const int trkdist = TomahawkUtils::levenshtein( qTrackname, rTrackname );
@@ -722,16 +666,12 @@ Query::howSimilar( const Tomahawk::result_ptr& r )
const int mlatr = qMax( artistTrackname.length(), rArtistTrackname.length() );
const float dcatr = (float)( mlatr - atrdist ) / mlatr;
float resultScore = qMax( dctrk, qMax( dcatr, qMax( dcart, dcalb ) ) );
d->howSimilarCache[r->id()] = resultScore;
return resultScore;
return qMax( dctrk, qMax( dcatr, qMax( dcart, dcalb ) ) );
}
else
{
// weighted, so album match is worth less than track title
float resultScore = ( dcart * 4 + dcalb + dctrk * 5 ) / 10;
d->howSimilarCache[r->id()] = resultScore;
return resultScore;
return ( dcart * 4 + dcalb + dctrk * 5 ) / 10;
}
}
@@ -782,11 +722,3 @@ 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 ) );
}

View File

@@ -112,8 +112,6 @@ 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>& );
@@ -160,7 +158,6 @@ private:
void setCurrentResolver( Tomahawk::Resolver* resolver );
void clearResults();
void checkResults();
void sortResults();
};
} //ns

View File

@@ -4,7 +4,6 @@
#include "Query.h"
#include <QMutex>
#include <map>
namespace Tomahawk
{
@@ -40,7 +39,6 @@ private:
QList< Tomahawk::artist_ptr > artists;
QList< Tomahawk::album_ptr > albums;
QList< Tomahawk::result_ptr > results;
Tomahawk::result_ptr preferredResult;
float score;
bool solved;
@@ -60,8 +58,6 @@ private:
mutable QMutex mutex;
QWeakPointer< Tomahawk::Query > ownRef;
std::map<QString, float> howSimilarCache;
};
} // Tomahawk

View File

@@ -35,8 +35,6 @@
#include "Track.h"
#include "Typedefs.h"
#include <QCoreApplication>
using namespace Tomahawk;
static QHash< QString, result_wptr > s_results;
@@ -71,7 +69,6 @@ Result::get( const QString& url, const track_ptr& track )
}
result_ptr r = result_ptr( new Result( url, track ), &Result::deleteLater );
r->moveToThread( QCoreApplication::instance()->thread() );
r->setWeakRef( r.toWeakRef() );
s_results.insert( url, r );
@@ -135,19 +132,11 @@ Result::deleteLater()
void
Result::onResolverRemoved( Tomahawk::Resolver* resolver )
{
m_mutex.lock();
if ( m_resolver.data() == resolver )
{
m_resolver = 0;
m_mutex.unlock();
emit statusChanged();
}
else
{
m_mutex.unlock();
}
}
@@ -161,8 +150,6 @@ Result::resolvedByCollection() const
QString
Result::url() const
{
QMutexLocker lock( &m_mutex );
return m_url;
}
@@ -170,8 +157,6 @@ Result::url() const
bool
Result::checked() const
{
QMutexLocker lock( &m_mutex );
return m_checked;
}
@@ -179,8 +164,6 @@ Result::checked() const
bool
Result::isPreview() const
{
QMutexLocker lock( &m_mutex );
return m_isPreview;
}
@@ -188,8 +171,6 @@ Result::isPreview() const
QString
Result::mimetype() const
{
QMutexLocker lock( &m_mutex );
return m_mimetype;
}
@@ -197,8 +178,6 @@ Result::mimetype() const
RID
Result::id() const
{
QMutexLocker lock( &m_mutex );
if ( m_rid.isEmpty() )
m_rid = uuid();
@@ -215,8 +194,6 @@ Result::isOnline() const
}
else
{
QMutexLocker lock( &m_mutex );
return !m_resolver.isNull();
}
}
@@ -234,36 +211,27 @@ Result::playable() const
}
bool
Result::isLocal() const
{
return resolvedByCollection().isNull() ? false : resolvedByCollection()->isLocal();
}
QVariant
Result::toVariant() const
{
track_ptr t = track();
QVariantMap m;
m.insert( "artist", t->artist() );
m.insert( "album", t->album() );
m.insert( "track", t->track() );
m.insert( "artist", m_track->artist() );
m.insert( "album", m_track->album() );
m.insert( "track", m_track->track() );
m.insert( "source", friendlySource() );
m.insert( "mimetype", mimetype() );
m.insert( "size", size() );
m.insert( "bitrate", bitrate() );
m.insert( "duration", t->duration() );
m.insert( "duration", m_track->duration() );
// m.insert( "score", score() );
m.insert( "sid", id() );
m.insert( "discnumber", t->discnumber() );
m.insert( "albumpos", t->albumpos() );
m.insert( "discnumber", m_track->discnumber() );
m.insert( "albumpos", m_track->albumpos() );
m.insert( "preview", isPreview() );
m.insert( "purchaseUrl", purchaseUrl() );
if ( !t->composer().isEmpty() )
m.insert( "composer", t->composer() );
if ( !m_track->composer().isEmpty() )
m.insert( "composer", m_track->composer() );
return m;
}
@@ -272,25 +240,20 @@ Result::toVariant() const
QString
Result::toString() const
{
m_mutex.lock();
track_ptr track = m_track;
QString url = m_url;
m_mutex.unlock();
if ( track )
if ( m_track )
{
return QString( "Result(%1) %2 - %3%4 (%5)" )
.arg( id() )
.arg( track->artist() )
.arg( track->track() )
.arg( track->album().isEmpty() ? QString() : QString( " on %1" ).arg( track->album() ) )
.arg( url );
.arg( m_track->artist() )
.arg( m_track->track() )
.arg( m_track->album().isEmpty() ? QString() : QString( " on %1" ).arg( m_track->album() ) )
.arg( m_url );
}
else
{
return QString( "Result(%1) (%2)" )
.arg( id() )
.arg( url );
.arg( m_url );
}
}
@@ -298,8 +261,6 @@ Result::toString() const
Tomahawk::query_ptr
Result::toQuery()
{
QMutexLocker l( &m_mutex );
if ( m_query.isNull() )
{
query_ptr query = Tomahawk::Query::get( m_track );
@@ -309,15 +270,12 @@ Result::toQuery()
m_query = query->weakRef();
QList<Tomahawk::result_ptr> rl;
rl << m_ownRef.toStrongRef();
m_mutex.unlock();
rl << weakRef().toStrongRef();
query->addResults( rl );
m_mutex.lock();
query->setResolveFinished( true );
return query;
}
return m_query.toStrongRef();
}
@@ -337,10 +295,9 @@ Result::onOffline()
void
Result::setResolvedByCollection( const Tomahawk::collection_ptr& collection, bool emitOnlineEvents )
Result::setResolvedByCollection( const Tomahawk::collection_ptr& collection , bool emitOnlineEvents )
{
m_collection = collection;
if ( emitOnlineEvents )
{
Q_ASSERT( !collection.isNull() );
@@ -354,8 +311,6 @@ Result::setResolvedByCollection( const Tomahawk::collection_ptr& collection, boo
void
Result::setFriendlySource( const QString& s )
{
QMutexLocker lock( &m_mutex );
m_friendlySource = s;
}
@@ -363,8 +318,6 @@ Result::setFriendlySource( const QString& s )
void
Result::setPreview( bool isPreview )
{
QMutexLocker lock( &m_mutex );
m_isPreview = isPreview;
}
@@ -372,8 +325,6 @@ Result::setPreview( bool isPreview )
void
Result::setPurchaseUrl( const QString& u )
{
QMutexLocker lock( &m_mutex );
m_purchaseUrl = u;
}
@@ -381,8 +332,6 @@ Result::setPurchaseUrl( const QString& u )
void
Result::setLinkUrl( const QString& u )
{
QMutexLocker lock( &m_mutex );
m_linkUrl = u;
}
@@ -390,8 +339,6 @@ Result::setLinkUrl( const QString& u )
void
Result::setChecked( bool checked )
{
QMutexLocker lock( &m_mutex );
m_checked = checked;
}
@@ -399,8 +346,6 @@ Result::setChecked( bool checked )
void
Result::setMimetype( const QString& mimetype )
{
QMutexLocker lock( &m_mutex );
m_mimetype = mimetype;
}
@@ -408,8 +353,6 @@ Result::setMimetype( const QString& mimetype )
void
Result::setBitrate( unsigned int bitrate )
{
QMutexLocker lock( &m_mutex );
m_bitrate = bitrate;
}
@@ -417,8 +360,6 @@ Result::setBitrate( unsigned int bitrate )
void
Result::setSize( unsigned int size )
{
QMutexLocker lock( &m_mutex );
m_size = size;
}
@@ -426,8 +367,6 @@ Result::setSize( unsigned int size )
void
Result::setModificationTime( unsigned int modtime )
{
QMutexLocker lock( &m_mutex );
m_modtime = modtime;
}
@@ -435,8 +374,6 @@ Result::setModificationTime( unsigned int modtime )
void
Result::setTrack( const track_ptr& track )
{
QMutexLocker lock( &m_mutex );
m_track = track;
}
@@ -444,8 +381,6 @@ Result::setTrack( const track_ptr& track )
unsigned int
Result::fileId() const
{
QMutexLocker lock( &m_mutex );
return m_fileId;
}
@@ -455,8 +390,6 @@ Result::friendlySource() const
{
if ( resolvedByCollection().isNull() )
{
QMutexLocker lock( &m_mutex );
return m_friendlySource;
}
else
@@ -467,8 +400,6 @@ Result::friendlySource() const
QString
Result::purchaseUrl() const
{
QMutexLocker lock( &m_mutex );
return m_purchaseUrl;
}
@@ -476,8 +407,6 @@ Result::purchaseUrl() const
QString
Result::linkUrl() const
{
QMutexLocker lock( &m_mutex );
return m_linkUrl;
}
@@ -487,8 +416,6 @@ Result::sourceIcon( TomahawkUtils::ImageMode style, const QSize& desiredSize ) c
{
if ( resolvedByCollection().isNull() )
{
//QMutexLocker lock( &m_mutex );
const ExternalResolver* resolver = qobject_cast< ExternalResolver* >( m_resolver.data() );
if ( !resolver )
{
@@ -539,8 +466,6 @@ Result::sourceIcon( TomahawkUtils::ImageMode style, const QSize& desiredSize ) c
unsigned int
Result::bitrate() const
{
QMutexLocker lock( &m_mutex );
return m_bitrate;
}
@@ -548,8 +473,6 @@ Result::bitrate() const
unsigned int
Result::size() const
{
QMutexLocker lock( &m_mutex );
return m_size;
}
@@ -557,8 +480,6 @@ Result::size() const
unsigned int
Result::modificationTime() const
{
QMutexLocker lock( &m_mutex );
return m_modtime;
}
@@ -566,8 +487,6 @@ Result::modificationTime() const
void
Result::setFileId( unsigned int id )
{
QMutexLocker lock( &m_mutex );
m_fileId = id;
}
@@ -575,8 +494,6 @@ Result::setFileId( unsigned int id )
Tomahawk::Resolver*
Result::resolvedBy() const
{
QMutexLocker lock( &m_mutex );
if ( !m_collection.isNull() )
return m_collection.data();
@@ -587,16 +504,12 @@ Result::resolvedBy() const
void
Result::setResolvedByResolver( Tomahawk::Resolver* resolver )
{
QMutexLocker lock( &m_mutex );
m_resolver = QPointer< Tomahawk::Resolver >( resolver );
}
QPointer< Resolver > Result::resolvedByResolver() const
{
QMutexLocker lock( &m_mutex );
return m_resolver;
}
@@ -612,29 +525,16 @@ Result::doneEditing()
track_ptr
Result::track() const
{
QMutexLocker lock( &m_mutex );
return m_track;
}
QList< DownloadFormat >
Result::downloadFormats() const
{
QMutexLocker lock( &m_mutex );
return m_formats;
}
void
Result::setDownloadFormats( const QList<DownloadFormat>& formats )
{
if ( formats.isEmpty() )
return;
QMutexLocker lock( &m_mutex );
m_formats.clear();
foreach ( const DownloadFormat& format, formats )
{
@@ -662,7 +562,7 @@ Result::setDownloadFormats( const QList<DownloadFormat>& formats )
void
Result::onSettingsChanged()
{
if ( TomahawkSettings::instance()->downloadsPreferredFormat().toLower() != downloadFormats().first().extension.toLower() )
if ( TomahawkSettings::instance()->downloadsPreferredFormat().toLower() != m_formats.first().extension.toLower() )
{
setDownloadFormats( downloadFormats() );
emit updated();
@@ -699,8 +599,6 @@ Result::onDownloadJobStateChanged( DownloadJob::TrackState newState, DownloadJob
QWeakPointer<Result>
Result::weakRef()
{
QMutexLocker lock( &m_mutex );
return m_ownRef;
}
@@ -708,7 +606,5 @@ Result::weakRef()
void
Result::setWeakRef( QWeakPointer<Result> weakRef )
{
QMutexLocker lock( &m_mutex );
m_ownRef = weakRef;
}

View File

@@ -31,7 +31,6 @@
#include <QPixmap>
#include <QPointer>
#include <QVariant>
#include <QMutex>
class MetadataEditor;
@@ -94,12 +93,6 @@ public:
bool isOnline() const;
bool playable() const;
/**
* @brief whether this result isLocal, i.e. resolved by a local collection
* @return isLocal
*/
bool isLocal() const;
QString url() const;
/**
* Has the given url been checked that it is accessible/valid.
@@ -138,7 +131,7 @@ public:
track_ptr track() const;
QList< DownloadFormat > downloadFormats() const;
QList<DownloadFormat> downloadFormats() const { return m_formats; }
void setDownloadFormats( const QList<DownloadFormat>& formats );
downloadjob_ptr downloadJob() const { return m_downloadJob; }
@@ -168,8 +161,6 @@ private:
explicit Result( const QString& url, const Tomahawk::track_ptr& track );
explicit Result();
mutable QMutex m_mutex;
mutable RID m_rid;
collection_wptr m_collection;
QPointer< Tomahawk::Resolver > m_resolver;

View File

@@ -1,9 +1,13 @@
#include <QtPlugin>
#if defined(Q_EXPORT_PLUGIN)
#undef Q_EXPORT_PLUGIN
#undef Q_EXPORT_PLUGIN2
#endif
#if QT_VERSION >= QT_VERSION_CHECK( 5, 0, 0 )
#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)
#define Q_EXPORT_PLUGIN(a)
#define Q_EXPORT_PLUGIN2(a, b)
#else
# define Q_PLUGIN_METADATA(a)
#endif

View File

@@ -34,8 +34,14 @@
#include "PlaylistInterface.h"
#include "Source.h"
#include <qt5keychain/keychain.h>
#include <QStandardPaths>
#if QT_VERSION < QT_VERSION_CHECK(5,0,0)
#include <qtkeychain/keychain.h>
#include <QDesktopServices>
#else
#include <qt5keychain/keychain.h>
#include <QStandardPaths>
#endif
#include <QDir>
using namespace Tomahawk;
@@ -727,7 +733,11 @@ 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
}
@@ -736,7 +746,11 @@ 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();
}
@@ -915,20 +929,6 @@ TomahawkSettings::setVolume( unsigned int volume )
}
bool
TomahawkSettings::muted() const
{
return value( "audio/muted" ).toBool();
}
void
TomahawkSettings::setMuted( bool muted )
{
setValue( "audio/muted", muted );
}
QString
TomahawkSettings::proxyHost() const
{
@@ -1750,15 +1750,3 @@ 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);
}

View File

@@ -107,9 +107,6 @@ public:
unsigned int volume() const;
void setVolume( unsigned int volume );
bool muted() const;
void setMuted( bool muted );
/// Playlist stuff
QByteArray playlistColumnSizes( const QString& playlistid ) const;
void setPlaylistColumnSizes( const QString& playlistid, const QByteArray& state );
@@ -253,10 +250,6 @@ 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 );

View File

@@ -37,7 +37,6 @@
#include <QtAlgorithms>
#include <QDateTime>
#include <QReadWriteLock>
#include <QCoreApplication>
using namespace Tomahawk;
@@ -93,7 +92,6 @@ Track::get( const QString& artist, const QString& track, const QString& album, c
}
track_ptr t = track_ptr( new Track( artist, track, album, albumArtist, duration, composer, albumpos, discnumber ), &Track::deleteLater );
t->moveToThread( QCoreApplication::instance()->thread() );
t->setWeakRef( t.toWeakRef() );
s_tracksByName.insert( key, t );
@@ -213,11 +211,19 @@ 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
}

View File

@@ -19,7 +19,8 @@
#include "TrackData.h"
#include <QtAlgorithms>
#include <QReadWriteLock>
#include "audio/AudioEngine.h"
#include "collection/Collection.h"
@@ -40,10 +41,6 @@
#include "PlaylistEntry.h"
#include "SourceList.h"
#include <QtAlgorithms>
#include <QReadWriteLock>
#include <QCoreApplication>
using namespace Tomahawk;
QHash< QString, trackdata_wptr > TrackData::s_trackDatasByName = QHash< QString, trackdata_wptr >();
@@ -87,7 +84,6 @@ TrackData::get( unsigned int id, const QString& artist, const QString& track )
}
trackdata_ptr t = trackdata_ptr( new TrackData( id, artist, track ), &TrackData::deleteLater );
t->moveToThread( QCoreApplication::instance()->thread() );
t->setWeakRef( t.toWeakRef() );
s_trackDatasByName.insert( key, t );

View File

@@ -253,7 +253,7 @@ namespace Tomahawk
typedef QHash< QString, QString > InfoStringHash;
typedef QPair< QVariantMap, QVariant > PushInfoPair;
typedef QSharedPointer< InfoPlugin > InfoPluginPtr;
typedef QPointer< InfoPlugin > InfoPluginPtr;
}
namespace Network

View File

@@ -167,7 +167,7 @@ signals:
void connectionStateChanged( Tomahawk::Accounts::Account::ConnectionState state );
void configurationChanged();
void configTestResult( int, const QString& = QString() );
void configTestResult( Tomahawk::Accounts::ConfigTestResultType );
protected:
virtual void loadFromConfig( const QString &accountId );

View File

@@ -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
QStyleOptionViewItem opt( option );
QStyleOptionViewItemV4 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
{
QStyleOptionViewItem opt = option;
QStyleOptionViewItemV4 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 );
QStyleOptionViewItem opt2 = opt;
QStyleOptionViewItemV4 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, QStyleOptionViewItem& opt, const QList< Account* > accts, int rightEdge ) const
AccountDelegate::drawAccountList( QPainter* painter, QStyleOptionViewItemV4& 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( QStyleOptionViewItem& opt, QPainter* p, const QWidget* w ) const
AccountDelegate::drawCheckBox( QStyleOptionViewItemV4& 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( QStyleOptionViewItem& opt, QPainter* p, const QWi
void
AccountDelegate::drawConfigWrench ( QPainter* painter, QStyleOptionViewItem& opt, QStyleOptionToolButton& topt ) const
AccountDelegate::drawConfigWrench ( QPainter* painter, QStyleOptionViewItemV4& opt, QStyleOptionToolButton& topt ) const
{
const QWidget* w = opt.widget;
QStyle* style = w ? w->style() : QApplication::style();
@@ -648,7 +648,7 @@ AccountDelegate::drawConfigWrench ( QPainter* painter, QStyleOptionViewItem& opt
QRect
AccountDelegate::checkRectForIndex( const QStyleOptionViewItem& option, const QModelIndex& idx ) const
{
QStyleOptionViewItem opt = option;
QStyleOptionViewItemV4 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( QStyleOptionViewItem opt ) const
AccountDelegate::removeBtnWidth( QStyleOptionViewItemV4 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();
QStyleOptionViewItem opt;
QStyleOptionViewItemV4 opt;
initStyleOption( &opt, idx );
AnimatedSpinner* anim = new AnimatedSpinner( checkRectForIndex( opt, idx ).size(), true );

View File

@@ -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( QStyleOptionViewItem& opt, QPainter* p, const QWidget* w ) const;
void drawConfigWrench( QPainter* painter, QStyleOptionViewItem& option, QStyleOptionToolButton& topt ) const;
void drawCheckBox( QStyleOptionViewItemV4& opt, QPainter* p, const QWidget* w ) const;
void drawConfigWrench( QPainter* painter, QStyleOptionViewItemV4& option, QStyleOptionToolButton& topt ) const;
// returns new left edge
int drawAccountList( QPainter* painter, QStyleOptionViewItem& option, const QList< Account* > accounts, int rightEdge ) const;
int drawAccountList( QPainter* painter, QStyleOptionViewItemV4& option, const QList< Account* > accounts, int rightEdge ) const;
QRect checkRectForIndex( const QStyleOptionViewItem &option, const QModelIndex &idx ) const;
int removeBtnWidth( QStyleOptionViewItem opt ) const;
int removeBtnWidth( QStyleOptionViewItemV4 opt ) const;
int m_hoveringOver;
QPersistentModelIndex m_hoveringItem, m_configPressed;

View File

@@ -44,7 +44,7 @@ AccountFactoryWrapperDelegate::AccountFactoryWrapperDelegate( QObject* parent )
void
AccountFactoryWrapperDelegate::paint(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index) const
{
QStyleOptionViewItem opt = option;
QStyleOptionViewItemV4 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;
QStyleOptionViewItem opt2 = opt;
QStyleOptionViewItemV4 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 );

View File

@@ -23,7 +23,11 @@
#ifdef Q_OS_MAC
#include "TomahawkSettings.h"
#else
#include <qt5keychain/keychain.h>
#if QT_VERSION < QT_VERSION_CHECK(5,0,0)
#include <qtkeychain/keychain.h>
#else
#include <qt5keychain/keychain.h>
#endif
#include "utils/Json.h"
#endif

View File

@@ -68,7 +68,6 @@ DelegateConfigWrapper::DelegateConfigWrapper( Tomahawk::Accounts::Account* accou
h->setContentsMargins( m_widget->contentsMargins() );
m_errorLabel->setAlignment( Qt::AlignCenter );
m_errorLabel->setWordWrap( true );
v->addWidget( m_errorLabel );
v->addLayout( h );
@@ -82,7 +81,7 @@ DelegateConfigWrapper::DelegateConfigWrapper( Tomahawk::Accounts::Account* accou
if ( m_widget->metaObject()->indexOfSignal( "sizeHintChanged()" ) > -1 )
connect( m_widget, SIGNAL( sizeHintChanged() ), this, SLOT( updateSizeHint() ) );
connect( m_account, SIGNAL( configTestResult( int, const QString& ) ), SLOT( onConfigTestResult( int, const QString& ) ) );
connect( m_account, SIGNAL( configTestResult( Tomahawk::Accounts::ConfigTestResultType ) ), SLOT( onConfigTestResult( Tomahawk::Accounts::ConfigTestResultType ) ) );
}
@@ -193,11 +192,11 @@ DelegateConfigWrapper::aboutClicked( bool )
void
DelegateConfigWrapper::onConfigTestResult( int code, const QString& message )
DelegateConfigWrapper::onConfigTestResult( Tomahawk::Accounts::ConfigTestResultType result )
{
tLog() << Q_FUNC_INFO << code << ": " << message;
tLog() << Q_FUNC_INFO << result;
if( code == Tomahawk::Accounts::ConfigTestResultSuccess )
if( result == Tomahawk::Accounts::ConfigTestResultSuccess )
{
m_invalidData = QVariantMap();
closeDialog( QDialog::Accepted );
@@ -227,25 +226,8 @@ DelegateConfigWrapper::onConfigTestResult( int code, const QString& message )
m_invalidData = m_widget->readData();
QString msg = !message.isEmpty() ? message : getTestConfigMessage( code );
m_errorLabel->setText( QString( "<font color='red'>%1</font>" ).arg( msg ) );
}
}
QString
DelegateConfigWrapper::getTestConfigMessage( int code )
{
switch(code) {
case Tomahawk::Accounts::ConfigTestResultCommunicationError:
return tr( "Unable to authenticate. Please check your connection." );
case Tomahawk::Accounts::ConfigTestResultInvalidCredentials:
return tr( "Username or password incorrect." );
case Tomahawk::Accounts::ConfigTestResultInvalidAccount:
return tr( "Account rejected by server." );
case Tomahawk::Accounts::ConfigTestResultPlayingElsewhere:
return tr( "Action not allowed, account is in use elsewhere." );
case Tomahawk::Accounts::ConfigTestResultAccountExpired:
return tr( "Your account has expired." );
// TODO: generate message based on status code
m_errorLabel->setText( QString( "<font color='red'>%1</font>" ).arg( tr( "Your config is invalid." ) ) );
}
}

View File

@@ -60,11 +60,10 @@ protected:
private slots:
void aboutClicked( bool );
void onConfigTestResult( int, const QString& );
void onConfigTestResult( Tomahawk::Accounts::ConfigTestResultType );
private:
void closeDialog( QDialog::DialogCode code );
QString getTestConfigMessage( int code );
Tomahawk::Accounts::Account* m_account;
AccountConfigWidget* m_widget;

View File

@@ -79,7 +79,7 @@ ResolverAccountFactory::createFromPath( const QString& path )
}
ResolverAccount*
Account*
ResolverAccountFactory::createFromPath( const QString& path, const QString& factory, bool isAttica )
{
qDebug() << "Creating ResolverAccount from path:" << path << "is attica" << isAttica;
@@ -110,8 +110,57 @@ ResolverAccountFactory::createFromPath( const QString& path, const QString& fact
if ( pathInfo.suffix() == "axe" )
{
if ( !installAxe( realPath, configuration ) )
QString uniqueName = uuid();
QDir dir( TomahawkUtils::extractScriptPayload( pathInfo.filePath(),
uniqueName,
MANUALRESOLVERS_DIR ) );
if ( !( dir.exists() && dir.isReadable() ) ) //decompression fubar
{
displayError( tr( "Resolver installation error: cannot open bundle." ) );
return 0;
}
if ( !dir.cd( "content" ) ) //more fubar
{
displayError( tr( "Resolver installation error: incomplete bundle." ) );
return 0;
}
QString metadataFilePath = dir.absoluteFilePath( "metadata.json" );
configuration = metadataFromJsonFile( metadataFilePath );
configuration[ "bundleDir" ] = uniqueName;
if ( !configuration[ "pluginName" ].isNull() && !configuration[ "pluginName" ].toString().isEmpty() )
{
dir.cdUp();
if ( !dir.cdUp() ) //we're in MANUALRESOLVERS_DIR
return 0;
QString name = configuration[ "pluginName" ].toString();
QString namePath = dir.absoluteFilePath( name );
QFileInfo npI( namePath );
if ( npI.exists() && npI.isDir() )
{
TomahawkUtils::removeDirectory( namePath );
}
dir.rename( uniqueName, name );
configuration[ "bundleDir" ] = name;
if ( !dir.cd( QString( "%1/content" ).arg( name ) ) ) //should work if it worked once
return 0;
}
expandPaths( dir, configuration );
realPath = configuration[ "path" ].toString();
if ( realPath.isEmpty() )
{
displayError( tr( "Resolver installation error: bad metadata in bundle." ) );
return 0;
}
}
@@ -172,71 +221,6 @@ ResolverAccountFactory::createFromPath( const QString& path, const QString& fact
}
bool
ResolverAccountFactory::installAxe( QString& realPath, QVariantHash& configuration )
{
const QFileInfo pathInfo( realPath );
QString uniqueName = uuid();
QDir dir( TomahawkUtils::extractScriptPayload( pathInfo.filePath(),
uniqueName,
MANUALRESOLVERS_DIR ) );
if ( !( dir.exists() && dir.isReadable() ) ) //decompression fubar
{
JobStatusView::instance()->model()->addJob( new ErrorStatusMessage(
tr( "Resolver installation error: cannot open bundle." ) ) );
return 0;
}
if ( !dir.cd( "content" ) ) //more fubar
{
JobStatusView::instance()->model()->addJob( new ErrorStatusMessage(
tr( "Resolver installation error: incomplete bundle." ) ) );
return 0;
}
QString metadataFilePath = dir.absoluteFilePath( "metadata.json" );
configuration = metadataFromJsonFile( metadataFilePath );
configuration[ "bundleDir" ] = uniqueName;
if ( !configuration[ "pluginName" ].isNull() && !configuration[ "pluginName" ].toString().isEmpty() )
{
dir.cdUp();
if ( !dir.cdUp() ) //we're in MANUALRESOLVERS_DIR
return 0;
QString name = configuration[ "pluginName" ].toString();
QString namePath = dir.absoluteFilePath( name );
QFileInfo npI( namePath );
if ( npI.exists() && npI.isDir() )
{
TomahawkUtils::removeDirectory( namePath );
}
dir.rename( uniqueName, name );
configuration[ "bundleDir" ] = name;
if ( !dir.cd( QString( "%1/content" ).arg( name ) ) ) //should work if it worked once
return 0;
}
expandPaths( dir, configuration );
realPath = configuration[ "path" ].toString();
if ( realPath.isEmpty() )
{
JobStatusView::instance()->model()->addJob( new ErrorStatusMessage(
tr( "Resolver installation error: bad metadata in bundle." ) ) );
return 0;
}
return true;
}
QVariantHash
ResolverAccountFactory::metadataFromJsonFile( const QString& path )
{
@@ -533,8 +517,7 @@ ResolverAccount::removeBundle()
}
void
ResolverAccount::testConfig()
void ResolverAccount::testConfig()
{
// HACK: move to JSAccount once we have that properly
JSResolver* resolver = qobject_cast< Tomahawk::JSResolver* >( m_resolver );
@@ -542,7 +525,7 @@ ResolverAccount::testConfig()
{
QVariantMap data = resolver->loadDataFromWidgets();
ScriptJob* job = resolver->scriptObject()->invoke( "testConfig", data );
connect( job, SIGNAL( done( QVariant ) ), SLOT( onTestConfig( QVariant ) ) );
connect( job, SIGNAL( done( QVariantMap ) ), SLOT( onTestConfig( QVariantMap ) ) );
job->start();
}
else
@@ -552,25 +535,19 @@ ResolverAccount::testConfig()
}
ExternalResolverGui*
ResolverAccount::resolver() const
{
return m_resolver;
}
void
ResolverAccount::onTestConfig( const QVariant& result )
ResolverAccount::onTestConfig( const QVariantMap& result )
{
tLog() << Q_FUNC_INFO << result;
if ( result.type() == QVariant::String )
int resultCode = result[ "result" ].toInt();
if ( resultCode == 1 )
{
emit configTestResult( Accounts::ConfigTestResultOther, result.toString() );
emit configTestResult( Accounts::ConfigTestResultSuccess );
}
else
{
emit configTestResult( result.toInt() );
emit configTestResult( Accounts::ConfigTestResultOther );
}
sender()->deleteLater();
@@ -589,7 +566,6 @@ AtticaResolverAccount::AtticaResolverAccount( const QString& accountId )
}
AtticaResolverAccount::AtticaResolverAccount( const QString& accountId, const QString& path, const QString& atticaId, const QVariantHash& initialConfiguration )
: ResolverAccount( accountId, path, initialConfiguration )
, m_atticaId( atticaId )
@@ -619,6 +595,8 @@ AtticaResolverAccount::init()
loadIcon();
else
connect( AtticaManager::instance(), SIGNAL( resolversLoaded( Attica::Content::List ) ), this, SLOT( loadIcon() ) );
}

View File

@@ -33,8 +33,6 @@ class ExternalResolverGui;
namespace Accounts {
class ResolverAccount;
class DLLEXPORT ResolverAccountFactory : public AccountFactory
{
Q_OBJECT
@@ -55,10 +53,7 @@ public:
Account* createFromPath( const QString& path ) override;
// Internal use
static ResolverAccount* createFromPath( const QString& path, const QString& factoryId, bool isAttica );
// YES, non const parameters!
static bool installAxe( QString& realPath, QVariantHash& configuration );
static Account* createFromPath( const QString& path, const QString& factoryId, bool isAttica );
private:
static void displayError( const QString& error );
@@ -106,11 +101,9 @@ public:
void testConfig() override;
ExternalResolverGui* resolver() const;
private slots:
void resolverChanged();
void onTestConfig( const QVariant& result );
void onTestConfig( const QVariantMap& result );
protected:
// Created by factory, when user installs a new resolver

View File

@@ -11,3 +11,16 @@ 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()

View File

@@ -1,6 +1,6 @@
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
*
* Copyright 2016, Dominik Schmidt <domme@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
@@ -16,22 +16,31 @@
* along with Tomahawk. If not, see <http://www.gnu.org/licenses/>.
*/
#include "ScriptErrorStatusMessage.h"
#include "../utils/Logger.h"
#include "KdeTelepathyConfigWidget.h"
ScriptErrorStatusMessage::ScriptErrorStatusMessage( const QString& message, Tomahawk::ScriptAccount* account )
: ErrorStatusMessage( tr( "Script Error: %1" ).arg( message ) )
, m_account( account )
#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;
}
void
ScriptErrorStatusMessage::activated()
{
if ( m_account.isNull() )
return;
Q_EXPORT_PLUGIN2( TelepathyConfigStorageConfigWidgetPlugin, KdeTelepathyConfigWidget )
tDebug() << "ScriptErrorStatusMessage clicked: " << mainText() << m_account->name();
m_account->showDebugger();
}

Some files were not shown because too many files have changed in this diff Show More