mirror of
https://github.com/status-im/snorenotify.git
synced 2025-02-24 14:08:17 +00:00
drop qt4 support
This commit is contained in:
parent
c31cfa784f
commit
5ca8735398
@ -11,21 +11,6 @@ include(GNUInstallDirs)
|
|||||||
include(GenerateExportHeader)
|
include(GenerateExportHeader)
|
||||||
include(FeatureSummary)
|
include(FeatureSummary)
|
||||||
|
|
||||||
if(NOT MSVC)
|
|
||||||
include(CheckCXXCompilerFlag)
|
|
||||||
check_cxx_compiler_flag( "-std=c++11" CXX11_FOUND )
|
|
||||||
check_cxx_compiler_flag( "-std=c++0x" CXX0X_FOUND )
|
|
||||||
if(CXX11_FOUND)
|
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
|
|
||||||
elseif(CXX0X_FOUND)
|
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
|
|
||||||
else()
|
|
||||||
message(STATUS "${CMAKE_CXX_COMPILER} does not support C++11, please use a different compiler")
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#######################################################################
|
#######################################################################
|
||||||
option(WITH_FRONTENDS "Build frontends currently only useful if WITH_SNORE_DEAMON=ON" OFF)
|
option(WITH_FRONTENDS "Build frontends currently only useful if WITH_SNORE_DEAMON=ON" OFF)
|
||||||
option(WITH_SNORE_DEAMON "Build the Snore deamon, which redirects notifications" OFF)
|
option(WITH_SNORE_DEAMON "Build the Snore deamon, which redirects notifications" OFF)
|
||||||
@ -35,29 +20,22 @@ option(WITH_FREEDESKTOP_FRONTEND "Build the freedesktop frontend" OFF)
|
|||||||
|
|
||||||
set(SNORE_VERSION_MAJOR 0)
|
set(SNORE_VERSION_MAJOR 0)
|
||||||
set(SNORE_VERSION_MINOR 5)
|
set(SNORE_VERSION_MINOR 5)
|
||||||
set(SNORE_VERSION_PATCH 1)
|
set(SNORE_VERSION_PATCH 90)
|
||||||
set(SNORE_VERSION_SUFFIX "")
|
set(SNORE_VERSION_SUFFIX "")
|
||||||
|
|
||||||
set(SNORE_SUFFIX "")
|
set(SNORE_SUFFIX "-qt5")
|
||||||
set(SNORE_CamelCase_SUFFIX "")
|
set(SNORE_CamelCase_SUFFIX "Qt5")
|
||||||
|
|
||||||
|
find_package(ECM 0.0.9 NO_MODULE REQUIRED)
|
||||||
|
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH})
|
||||||
|
include(KDECompilerSettings)
|
||||||
|
|
||||||
|
find_package(Qt5Core REQUIRED)
|
||||||
|
find_package(Qt5Widgets REQUIRED)
|
||||||
|
find_package(Qt5Network REQUIRED)
|
||||||
|
find_package(Qt5Declarative REQUIRED)
|
||||||
|
|
||||||
if(WITH_QT4)
|
|
||||||
find_package(Qt4 REQUIRED)
|
|
||||||
include_directories( ${QT_INCLUDES} )
|
|
||||||
include(NoKDE)
|
|
||||||
else()
|
|
||||||
find_package(ECM 0.0.9 NO_MODULE REQUIRED)
|
|
||||||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH})
|
|
||||||
include(KDECompilerSettings)
|
|
||||||
|
|
||||||
find_package(Qt5Core REQUIRED)
|
|
||||||
find_package(Qt5Widgets REQUIRED)
|
|
||||||
find_package(Qt5Network REQUIRED)
|
|
||||||
find_package(Qt5Declarative REQUIRED)
|
|
||||||
include(ECMQt4To5Porting)
|
|
||||||
set(SNORE_SUFFIX "-qt5")
|
|
||||||
set(SNORE_CamelCase_SUFFIX "Qt5")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
|
|
||||||
find_package(Doxygen QUIET)
|
find_package(Doxygen QUIET)
|
||||||
|
@ -1,235 +0,0 @@
|
|||||||
#=============================================================================
|
|
||||||
# Copyright 2005-2011 Kitware, Inc.
|
|
||||||
# All rights reserved.
|
|
||||||
#
|
|
||||||
# Redistribution and use in source and binary forms, with or without
|
|
||||||
# modification, are permitted provided that the following conditions
|
|
||||||
# are met:
|
|
||||||
#
|
|
||||||
# * Redistributions of source code must retain the above copyright
|
|
||||||
# notice, this list of conditions and the following disclaimer.
|
|
||||||
#
|
|
||||||
# * Redistributions in binary form must reproduce the above copyright
|
|
||||||
# notice, this list of conditions and the following disclaimer in the
|
|
||||||
# documentation and/or other materials provided with the distribution.
|
|
||||||
#
|
|
||||||
# * Neither the name of Kitware, Inc. nor the names of its
|
|
||||||
# contributors may be used to endorse or promote products derived
|
|
||||||
# from this software without specific prior written permission.
|
|
||||||
#
|
|
||||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
||||||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
||||||
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
||||||
# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
||||||
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
||||||
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
||||||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
||||||
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
||||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
||||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
#=============================================================================
|
|
||||||
|
|
||||||
# The automoc_qt4 macro is superceded by CMAKE_AUTOMOC from CMake 2.8.6
|
|
||||||
# A Qt 5 version is not provided by CMake or Qt.
|
|
||||||
|
|
||||||
include(MacroAddFileDependencies)
|
|
||||||
|
|
||||||
MACRO (QT4_GET_MOC_FLAGS _moc_flags)
|
|
||||||
SET(${_moc_flags})
|
|
||||||
GET_DIRECTORY_PROPERTY(_inc_DIRS INCLUDE_DIRECTORIES)
|
|
||||||
|
|
||||||
FOREACH(_current ${_inc_DIRS})
|
|
||||||
IF("${_current}" MATCHES "\\.framework/?$")
|
|
||||||
STRING(REGEX REPLACE "/[^/]+\\.framework" "" framework_path "${_current}")
|
|
||||||
SET(${_moc_flags} ${${_moc_flags}} "-F${framework_path}")
|
|
||||||
ELSE("${_current}" MATCHES "\\.framework/?$")
|
|
||||||
SET(${_moc_flags} ${${_moc_flags}} "-I${_current}")
|
|
||||||
ENDIF("${_current}" MATCHES "\\.framework/?$")
|
|
||||||
ENDFOREACH(_current ${_inc_DIRS})
|
|
||||||
|
|
||||||
GET_DIRECTORY_PROPERTY(_defines COMPILE_DEFINITIONS)
|
|
||||||
FOREACH(_current ${_defines})
|
|
||||||
SET(${_moc_flags} ${${_moc_flags}} "-D${_current}")
|
|
||||||
ENDFOREACH(_current ${_defines})
|
|
||||||
|
|
||||||
IF(Q_WS_WIN)
|
|
||||||
SET(${_moc_flags} ${${_moc_flags}} -DWIN32)
|
|
||||||
ENDIF(Q_WS_WIN)
|
|
||||||
|
|
||||||
ENDMACRO(QT4_GET_MOC_FLAGS)
|
|
||||||
|
|
||||||
# helper macro to set up a moc rule
|
|
||||||
MACRO (QT4_CREATE_MOC_COMMAND infile outfile moc_flags moc_options)
|
|
||||||
# For Windows, create a parameters file to work around command line length limit
|
|
||||||
IF (WIN32)
|
|
||||||
# Pass the parameters in a file. Set the working directory to
|
|
||||||
# be that containing the parameters file and reference it by
|
|
||||||
# just the file name. This is necessary because the moc tool on
|
|
||||||
# MinGW builds does not seem to handle spaces in the path to the
|
|
||||||
# file given with the @ syntax.
|
|
||||||
GET_FILENAME_COMPONENT(_moc_outfile_name "${outfile}" NAME)
|
|
||||||
GET_FILENAME_COMPONENT(_moc_outfile_dir "${outfile}" PATH)
|
|
||||||
IF(_moc_outfile_dir)
|
|
||||||
SET(_moc_working_dir WORKING_DIRECTORY ${_moc_outfile_dir})
|
|
||||||
ENDIF(_moc_outfile_dir)
|
|
||||||
SET (_moc_parameters_file ${outfile}_parameters)
|
|
||||||
SET (_moc_parameters ${moc_flags} ${moc_options} -o "${outfile}" "${infile}")
|
|
||||||
STRING (REPLACE ";" "\n" _moc_parameters "${_moc_parameters}")
|
|
||||||
FILE (WRITE ${_moc_parameters_file} "${_moc_parameters}")
|
|
||||||
ADD_CUSTOM_COMMAND(OUTPUT ${outfile}
|
|
||||||
COMMAND ${QT_MOC_EXECUTABLE} @${_moc_outfile_name}_parameters
|
|
||||||
DEPENDS ${infile}
|
|
||||||
${_moc_working_dir}
|
|
||||||
VERBATIM)
|
|
||||||
ELSE (WIN32)
|
|
||||||
ADD_CUSTOM_COMMAND(OUTPUT ${outfile}
|
|
||||||
COMMAND ${QT_MOC_EXECUTABLE}
|
|
||||||
ARGS ${moc_flags} ${moc_options} -o ${outfile} ${infile}
|
|
||||||
DEPENDS ${infile} VERBATIM)
|
|
||||||
ENDIF (WIN32)
|
|
||||||
ENDMACRO (QT4_CREATE_MOC_COMMAND)
|
|
||||||
|
|
||||||
|
|
||||||
MACRO(QT4_AUTOMOC)
|
|
||||||
QT4_GET_MOC_FLAGS(_moc_INCS)
|
|
||||||
|
|
||||||
SET(_matching_FILES )
|
|
||||||
FOREACH (_current_FILE ${ARGN})
|
|
||||||
|
|
||||||
GET_FILENAME_COMPONENT(_abs_FILE ${_current_FILE} ABSOLUTE)
|
|
||||||
# if "SKIP_AUTOMOC" is set to true, we will not handle this file here.
|
|
||||||
# This is required to make uic work correctly:
|
|
||||||
# we need to add generated .cpp files to the sources (to compile them),
|
|
||||||
# but we cannot let automoc handle them, as the .cpp files don't exist yet when
|
|
||||||
# cmake is run for the very first time on them -> however the .cpp files might
|
|
||||||
# exist at a later run. at that time we need to skip them, so that we don't add two
|
|
||||||
# different rules for the same moc file
|
|
||||||
GET_SOURCE_FILE_PROPERTY(_skip ${_abs_FILE} SKIP_AUTOMOC)
|
|
||||||
|
|
||||||
IF ( NOT _skip AND EXISTS ${_abs_FILE} )
|
|
||||||
|
|
||||||
FILE(READ ${_abs_FILE} _contents)
|
|
||||||
|
|
||||||
GET_FILENAME_COMPONENT(_abs_PATH ${_abs_FILE} PATH)
|
|
||||||
|
|
||||||
STRING(REGEX MATCHALL "# *include +[^ ]+\\.moc[\">]" _match "${_contents}")
|
|
||||||
IF(_match)
|
|
||||||
FOREACH (_current_MOC_INC ${_match})
|
|
||||||
STRING(REGEX MATCH "[^ <\"]+\\.moc" _current_MOC "${_current_MOC_INC}")
|
|
||||||
|
|
||||||
GET_FILENAME_COMPONENT(_basename ${_current_MOC} NAME_WE)
|
|
||||||
IF(EXISTS ${_abs_PATH}/${_basename}.hpp)
|
|
||||||
SET(_header ${_abs_PATH}/${_basename}.hpp)
|
|
||||||
ELSE(EXISTS ${_abs_PATH}/${_basename}.hpp)
|
|
||||||
SET(_header ${_abs_PATH}/${_basename}.h)
|
|
||||||
ENDIF(EXISTS ${_abs_PATH}/${_basename}.hpp)
|
|
||||||
SET(_moc ${CMAKE_CURRENT_BINARY_DIR}/${_current_MOC})
|
|
||||||
QT4_CREATE_MOC_COMMAND(${_header} ${_moc} "${_moc_INCS}" "")
|
|
||||||
MACRO_ADD_FILE_DEPENDENCIES(${_abs_FILE} ${_moc})
|
|
||||||
ENDFOREACH (_current_MOC_INC)
|
|
||||||
ENDIF(_match)
|
|
||||||
ENDIF ( NOT _skip AND EXISTS ${_abs_FILE} )
|
|
||||||
ENDFOREACH (_current_FILE)
|
|
||||||
ENDMACRO(QT4_AUTOMOC)
|
|
||||||
|
|
||||||
|
|
||||||
# Portability helpers.
|
|
||||||
|
|
||||||
set(QT_QTGUI_LIBRARIES
|
|
||||||
${Qt5Gui_LIBRARIES}
|
|
||||||
${Qt5Widgets_LIBRARIES}
|
|
||||||
${Qt5PrintSupport_LIBRARIES}
|
|
||||||
${Qt5Svg_LIBRARIES}
|
|
||||||
)
|
|
||||||
|
|
||||||
set(QT_INCLUDES
|
|
||||||
${Qt5Gui_INCLUDE_DIRS}
|
|
||||||
${Qt5Widgets_INCLUDE_DIRS}
|
|
||||||
${Qt5PrintSupport_INCLUDE_DIRS}
|
|
||||||
${Qt5Svg_INCLUDE_DIRS}
|
|
||||||
)
|
|
||||||
set(QT_QTGUI_LIBRARY ${QT_QTGUI_LIBRARIES})
|
|
||||||
|
|
||||||
set(_qt_modules
|
|
||||||
Core
|
|
||||||
Declarative
|
|
||||||
Widgets
|
|
||||||
Script
|
|
||||||
ScriptTools
|
|
||||||
DBus
|
|
||||||
Network
|
|
||||||
Test
|
|
||||||
Designer
|
|
||||||
Concurrent
|
|
||||||
Xml
|
|
||||||
UiTools
|
|
||||||
Qml
|
|
||||||
Quick
|
|
||||||
WebKit
|
|
||||||
WebKitWidgets
|
|
||||||
Sql
|
|
||||||
OpenGL
|
|
||||||
)
|
|
||||||
|
|
||||||
foreach(_module ${_qt_modules})
|
|
||||||
string(TOUPPER ${_module} _module_upper)
|
|
||||||
set(QT_QT${_module_upper}_LIBRARIES ${Qt5${_module}_LIBRARIES})
|
|
||||||
set(QT_QT${_module_upper}_LIBRARY ${QT_QT${_module_upper}_LIBRARIES})
|
|
||||||
list(APPEND QT_INCLUDES ${Qt5${_module}_INCLUDE_DIRS})
|
|
||||||
set(QT_QT${_module_upper}_FOUND ${Qt5${_module}_FOUND})
|
|
||||||
endforeach()
|
|
||||||
|
|
||||||
list(APPEND QT_QTCORE_LIBRARIES ${Qt5Concurrent_LIBRARIES})
|
|
||||||
list(APPEND QT_QTCORE_LIBRARY ${Qt5Concurrent_LIBRARIES})
|
|
||||||
|
|
||||||
list(APPEND QT_QTWEBKIT_LIBRARIES ${Qt5WebKitWidgets_LIBRARIES})
|
|
||||||
list(APPEND QT_QTWEBKIT_LIBRARY ${Qt5WebKitWidgets_LIBRARIES})
|
|
||||||
|
|
||||||
get_target_property(QT_QMAKE_EXECUTABLE Qt5::qmake LOCATION)
|
|
||||||
get_target_property(QT_RCC_EXECUTABLE Qt5::rcc LOCATION)
|
|
||||||
if (TARGET Qt5::uic)
|
|
||||||
get_target_property(QT_UIC_EXECUTABLE Qt5::uic LOCATION)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (TARGET Qt5::qdbuscpp2xml)
|
|
||||||
get_target_property(QT_QDBUSCPP2XML_EXECUTABLE Qt5::qdbuscpp2xml LOCATION)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (TARGET Qt5::qdbusxml2cpp)
|
|
||||||
get_target_property(QT_QDBUSXML2CPP_EXECUTABLE Qt5::qdbusxml2cpp LOCATION)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0)
|
|
||||||
|
|
||||||
macro(qt4_wrap_ui)
|
|
||||||
qt5_wrap_ui(${ARGN})
|
|
||||||
endmacro()
|
|
||||||
|
|
||||||
macro(qt4_wrap_cpp)
|
|
||||||
qt5_wrap_cpp(${ARGN})
|
|
||||||
endmacro()
|
|
||||||
|
|
||||||
macro(qt4_generate_moc)
|
|
||||||
qt5_generate_moc(${ARGN})
|
|
||||||
endmacro()
|
|
||||||
|
|
||||||
macro(qt4_add_dbus_adaptor)
|
|
||||||
qt5_add_dbus_adaptor(${ARGN})
|
|
||||||
endmacro()
|
|
||||||
|
|
||||||
macro(qt4_add_dbus_interfaces)
|
|
||||||
qt5_add_dbus_interfaces(${ARGN})
|
|
||||||
endmacro()
|
|
||||||
|
|
||||||
macro(qt4_add_dbus_interface)
|
|
||||||
qt5_add_dbus_interface(${ARGN})
|
|
||||||
endmacro()
|
|
||||||
|
|
||||||
macro(qt4_generate_dbus_interface)
|
|
||||||
qt5_generate_dbus_interface(${ARGN})
|
|
||||||
endmacro()
|
|
||||||
|
|
||||||
macro(qt4_add_resources)
|
|
||||||
qt5_add_resources(${ARGN})
|
|
||||||
endmacro()
|
|
@ -1,35 +0,0 @@
|
|||||||
if (CMAKE_COMPILER_IS_GNUCXX)
|
|
||||||
set (KDE4_ENABLE_EXCEPTIONS -fexceptions)
|
|
||||||
# Select flags.
|
|
||||||
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g")
|
|
||||||
set(CMAKE_CXX_FLAGS_RELEASE "-O2 -DNDEBUG -DQT_NO_DEBUG")
|
|
||||||
set(CMAKE_CXX_FLAGS_DEBUG "-g -O2 -fno-reorder-blocks -fno-schedule-insns -fno-inline")
|
|
||||||
set(CMAKE_CXX_FLAGS_DEBUGFULL "-g3 -fno-inline")
|
|
||||||
set(CMAKE_CXX_FLAGS_PROFILE "-g3 -fno-inline -ftest-coverage -fprofile-arcs")
|
|
||||||
set(CMAKE_C_FLAGS_RELWITHDEBINFO "-O2 -g")
|
|
||||||
set(CMAKE_C_FLAGS_RELEASE "-O2 -DNDEBUG -DQT_NO_DEBUG")
|
|
||||||
set(CMAKE_C_FLAGS_DEBUG "-g -O2 -fno-reorder-blocks -fno-schedule-insns -fno-inline")
|
|
||||||
set(CMAKE_C_FLAGS_DEBUGFULL "-g3 -fno-inline")
|
|
||||||
set(CMAKE_C_FLAGS_PROFILE "-g3 -fno-inline -ftest-coverage -fprofile-arcs")
|
|
||||||
|
|
||||||
if (CMAKE_SYSTEM_NAME MATCHES Linux)
|
|
||||||
set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-long-long -std=iso9899:1990 -Wundef -Wcast-align -Werror-implicit-function-declaration -Wchar-subscripts -Wall -W -Wpointer-arith -Wwrite-strings -Wformat-security -Wmissing-format-attribute -fno-common")
|
|
||||||
set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wnon-virtual-dtor -Wno-long-long -ansi -Wundef -Wcast-align -Wchar-subscripts -Wall -W -Wpointer-arith -Wformat-security -fno-exceptions -fno-check-new -fno-common -fPIC")
|
|
||||||
add_definitions (-D_BSD_SOURCE)
|
|
||||||
endif (CMAKE_SYSTEM_NAME MATCHES Linux)
|
|
||||||
|
|
||||||
endif(CMAKE_COMPILER_IS_GNUCXX)
|
|
||||||
|
|
||||||
if(MINGW)
|
|
||||||
set(CMAKE_RC_COMPILER_INIT windres)
|
|
||||||
enable_language(RC)
|
|
||||||
set(CMAKE_RC_COMPILE_OBJECT "<CMAKE_RC_COMPILER> -O coff -i <SOURCE> -o <OBJECT>")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(WIN32)
|
|
||||||
add_definitions(-DQT_NO_DEBUG -DQT_FORCE_ASSERTS -D_WIN32_WINNT=0x0501)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
|
|
||||||
set(XDG_APPS_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/share/applications)
|
|
||||||
|
|
@ -5,8 +5,7 @@ add_subdirectory(core)
|
|||||||
if(WITH_SNORE_DEAMON)
|
if(WITH_SNORE_DEAMON)
|
||||||
|
|
||||||
add_executable( snorenotify WIN32 main.cpp snorenotify.cpp trayicon.cpp ${SNORENOTIFY_DEAMON_DEPS})
|
add_executable( snorenotify WIN32 main.cpp snorenotify.cpp trayicon.cpp ${SNORENOTIFY_DEAMON_DEPS})
|
||||||
target_link_libraries( snorenotify libsnore ${QT_QTGUI_LIBRARY} )
|
target_link_libraries( snorenotify libsnore Qt5::Gui Qt5::Widgets )
|
||||||
|
|
||||||
install(TARGETS snorenotify RUNTIME DESTINATION bin
|
install(TARGETS snorenotify RUNTIME DESTINATION bin
|
||||||
LIBRARY DESTINATION lib
|
LIBRARY DESTINATION lib
|
||||||
ARCHIVE DESTINATION lib)
|
ARCHIVE DESTINATION lib)
|
||||||
|
@ -9,7 +9,7 @@ endif()
|
|||||||
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/version.cpp.in" "${CMAKE_CURRENT_BINARY_DIR}/version.cpp")
|
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/version.cpp.in" "${CMAKE_CURRENT_BINARY_DIR}/version.cpp")
|
||||||
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/LibsnoreConfig.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/Libsnore${SNORE_CamelCase_SUFFIX}Config.cmake" @ONLY)
|
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/LibsnoreConfig.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/Libsnore${SNORE_CamelCase_SUFFIX}Config.cmake" @ONLY)
|
||||||
|
|
||||||
QT4_ADD_RESOURCES(SNORENOTIFY_RCS ${SNORE_RCS})
|
QT5_ADD_RESOURCES(SNORENOTIFY_RCS ${SNORE_RCS})
|
||||||
|
|
||||||
add_subdirectory(notification)
|
add_subdirectory(notification)
|
||||||
add_subdirectory(plugins)
|
add_subdirectory(plugins)
|
||||||
@ -45,7 +45,7 @@ set_target_properties( libsnore PROPERTIES
|
|||||||
VERSION "${SNORE_VERSION_MAJOR}.${SNORE_VERSION_MINOR}.${SNORE_VERSION_PATCH}.${SNORE_VERSION_SUFFIX}"
|
VERSION "${SNORE_VERSION_MAJOR}.${SNORE_VERSION_MINOR}.${SNORE_VERSION_PATCH}.${SNORE_VERSION_SUFFIX}"
|
||||||
SOVERSION "${SNORE_VERSION_MAJOR}.${SNORE_VERSION_MINOR}"
|
SOVERSION "${SNORE_VERSION_MAJOR}.${SNORE_VERSION_MINOR}"
|
||||||
EXPORT_NAME Libsnore)
|
EXPORT_NAME Libsnore)
|
||||||
target_link_libraries( libsnore PUBLIC ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} ${QT_QTNETWORK_LIBRARY} )
|
target_link_libraries( libsnore PUBLIC Qt5::Core Qt5::Gui Qt5::Widgets Qt5::Network)
|
||||||
|
|
||||||
add_library(Snore::Libsnore ALIAS libsnore)
|
add_library(Snore::Libsnore ALIAS libsnore)
|
||||||
|
|
||||||
|
@ -69,25 +69,26 @@ SnoreCore *SnorePlugin::snore()
|
|||||||
|
|
||||||
QVariant SnorePlugin::value(const QString &key)
|
QVariant SnorePlugin::value(const QString &key)
|
||||||
{
|
{
|
||||||
return snore()->d()->settings()->value(normaliseKey(key));
|
return snore()->settings()->value(normaliseKey(key));
|
||||||
}
|
}
|
||||||
|
|
||||||
void SnorePlugin::setValue(const QString &key, const QVariant &value)
|
void SnorePlugin::setValue(const QString &key, const QVariant &value)
|
||||||
{
|
{
|
||||||
snore()->d()->settings()->setValue(normaliseKey(key), value);
|
snore()->settings()->setValue(normaliseKey(key), value);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SnorePlugin::setDefaultValue(const QString &key, const QVariant &value)
|
void SnorePlugin::setDefaultValue(const QString &key, const QVariant &value, const QString &help)
|
||||||
{
|
{
|
||||||
QString pk(normaliseKey(key));
|
QString pk(normaliseKey(key));
|
||||||
if (!snore()->d()->settings()->contains(pk)) {
|
snore()->d()->addSettingsDescription(pk,help);
|
||||||
snore()->d()->settings()->setValue(normaliseKey(key), value);
|
if (!snore()->settings()->contains(pk)) {
|
||||||
|
snore()->settings()->setValue(normaliseKey(key), value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QString SnorePlugin::normaliseKey(const QString &key)
|
QString SnorePlugin::normaliseKey(const QString &key)
|
||||||
{
|
{
|
||||||
return QString("%1/%2").arg(name(), key);
|
return QString("%1/%2").arg(m_name, key);
|
||||||
}
|
}
|
||||||
|
|
||||||
const QString &SnorePlugin::name() const
|
const QString &SnorePlugin::name() const
|
||||||
|
@ -56,7 +56,7 @@ public:
|
|||||||
|
|
||||||
QVariant value(const QString &key);
|
QVariant value(const QString &key);
|
||||||
void setValue(const QString &key, const QVariant &value);
|
void setValue(const QString &key, const QVariant &value);
|
||||||
void setDefaultValue(const QString &key, const QVariant &value);
|
void setDefaultValue(const QString &key, const QVariant &value,const QString &help);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
SnorePlugin() {}
|
SnorePlugin() {}
|
||||||
@ -75,18 +75,4 @@ Q_DECLARE_INTERFACE(Snore::SnorePlugin,
|
|||||||
|
|
||||||
SNORE_EXPORT QDebug operator<< (QDebug, const Snore::SnorePlugin::PluginTypes &);
|
SNORE_EXPORT QDebug operator<< (QDebug, const Snore::SnorePlugin::PluginTypes &);
|
||||||
|
|
||||||
//compatability defines to reduce the number of ifdefs to make fiat compile with qt4 and qt5
|
|
||||||
#if QT_VERSION >= QT_VERSION_CHECK(5,0,0)
|
|
||||||
# if defined(Q_EXPORT_PLUGIN)
|
|
||||||
# undef Q_EXPORT_PLUGIN
|
|
||||||
# endif
|
|
||||||
# if defined(Q_EXPORT_PLUGIN2)
|
|
||||||
# undef Q_EXPORT_PLUGIN2
|
|
||||||
# endif
|
|
||||||
# define Q_EXPORT_PLUGIN(a)
|
|
||||||
# define Q_EXPORT_PLUGIN2(a, b)
|
|
||||||
#else
|
|
||||||
# define Q_PLUGIN_METADATA(a)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif//SNORE_PLUGINS_H
|
#endif//SNORE_PLUGINS_H
|
||||||
|
@ -231,6 +231,18 @@ bool SnoreCore::primaryBackendSupportsRichtext()
|
|||||||
return d->m_notificationBackend->supportsRichtext();
|
return d->m_notificationBackend->supportsRichtext();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QSettings *SnoreCore::settings()
|
||||||
|
{
|
||||||
|
Q_D(SnoreCore);
|
||||||
|
return d->m_settings;
|
||||||
|
}
|
||||||
|
|
||||||
|
const QHash<QString, QString> &SnoreCore::settingsDescription() const
|
||||||
|
{
|
||||||
|
Q_D(const SnoreCore);
|
||||||
|
return d->m_help;
|
||||||
|
}
|
||||||
|
|
||||||
const SnoreCorePrivate *SnoreCore::d()
|
const SnoreCorePrivate *SnoreCore::d()
|
||||||
{
|
{
|
||||||
Q_D(SnoreCore);
|
Q_D(SnoreCore);
|
||||||
|
@ -65,7 +65,7 @@ public:
|
|||||||
* Creates a Notification Manager SnoreCore
|
* Creates a Notification Manager SnoreCore
|
||||||
* @param trayIcon a QSystemTrayIcon which can later be used by the fallback notification backend.
|
* @param trayIcon a QSystemTrayIcon which can later be used by the fallback notification backend.
|
||||||
*/
|
*/
|
||||||
SnoreCore(QSystemTrayIcon *trayIcon = NULL);
|
SnoreCore(QSystemTrayIcon *trayIcon = nullptr);
|
||||||
~SnoreCore();
|
~SnoreCore();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -171,8 +171,18 @@ public:
|
|||||||
*/
|
*/
|
||||||
bool primaryBackendSupportsRichtext();
|
bool primaryBackendSupportsRichtext();
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return a pointer to the global settings
|
||||||
|
*/
|
||||||
|
QSettings *settings();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return a hashmap containing the documentation of the settings keys.
|
||||||
|
*/
|
||||||
|
const QHash<QString,QString> &settingsDescription() const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @return a pointer to the private class, for internal use only.
|
* @return a pointer to the private class, for internal use only.
|
||||||
*/
|
*/
|
||||||
const SnoreCorePrivate *d();
|
const SnoreCorePrivate *d();
|
||||||
|
@ -26,9 +26,7 @@
|
|||||||
#include "version.h"
|
#include "version.h"
|
||||||
|
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#if QT_VERSION >= QT_VERSION_CHECK(5,0,0)
|
|
||||||
#include <QTemporaryDir>
|
#include <QTemporaryDir>
|
||||||
#endif
|
|
||||||
|
|
||||||
using namespace Snore;
|
using namespace Snore;
|
||||||
|
|
||||||
@ -85,17 +83,8 @@ void SnoreCorePrivate::registerMetaTypes()
|
|||||||
|
|
||||||
QString SnoreCorePrivate::tempPath()
|
QString SnoreCorePrivate::tempPath()
|
||||||
{
|
{
|
||||||
#if QT_VERSION >= QT_VERSION_CHECK(5,0,0)
|
|
||||||
static QTemporaryDir dir;
|
static QTemporaryDir dir;
|
||||||
return dir.path();
|
return dir.path();
|
||||||
#else
|
|
||||||
static QString dir;
|
|
||||||
if (dir.isEmpty()) {
|
|
||||||
dir = QString("%1/%2").arg(QDir::tempPath(), "libsnore");
|
|
||||||
QDir::temp().mkpath("libsnore");
|
|
||||||
}
|
|
||||||
return dir;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SnoreCorePrivate::primaryBackendCanUpdateNotification() const
|
bool SnoreCorePrivate::primaryBackendCanUpdateNotification() const
|
||||||
@ -103,9 +92,9 @@ bool SnoreCorePrivate::primaryBackendCanUpdateNotification() const
|
|||||||
return m_notificationBackend->canUpdateNotification();
|
return m_notificationBackend->canUpdateNotification();
|
||||||
}
|
}
|
||||||
|
|
||||||
QSettings *SnoreCorePrivate::settings() const
|
void SnoreCorePrivate::addSettingsDescription(const QString &key, const QString &help) const
|
||||||
{
|
{
|
||||||
return m_settings;
|
m_help[key] = help;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SnoreCorePrivate::slotNotificationClosed(Notification n)
|
void SnoreCorePrivate::slotNotificationClosed(Notification n)
|
||||||
|
@ -62,7 +62,7 @@ public:
|
|||||||
*/
|
*/
|
||||||
bool primaryBackendCanUpdateNotification() const;
|
bool primaryBackendCanUpdateNotification() const;
|
||||||
|
|
||||||
QSettings *settings() const;
|
void addSettingsDescription(const QString &key, const QString &help) const;
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void applicationRegistered(const Snore::Application &);
|
void applicationRegistered(const Snore::Application &);
|
||||||
@ -87,6 +87,7 @@ private:
|
|||||||
Application m_defaultApp;
|
Application m_defaultApp;
|
||||||
|
|
||||||
QSettings *m_settings;
|
QSettings *m_settings;
|
||||||
|
mutable QHash<QString,QString> m_help;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@ if(NOT WITH_FREEDESKTOP_FRONTEND AND UNIX AND NOT APPLE)
|
|||||||
|
|
||||||
|
|
||||||
add_library(libsnore_backend_freedesktop MODULE ${FREEDESKTOP_NOTIFICATION_SRC} )
|
add_library(libsnore_backend_freedesktop MODULE ${FREEDESKTOP_NOTIFICATION_SRC} )
|
||||||
target_link_libraries(libsnore_backend_freedesktop Snore::Libsnore ${QT_QTGUI_LIBRARY} ${QT_QTDBUS_LIBRARY} )
|
target_link_libraries(libsnore_backend_freedesktop Snore::Libsnore Qt5::DBus )
|
||||||
|
|
||||||
install(TARGETS libsnore_backend_freedesktop ${SNORE_PLUGIN_INSTALL_PATH})
|
install(TARGETS libsnore_backend_freedesktop ${SNORE_PLUGIN_INSTALL_PATH})
|
||||||
endif()
|
endif()
|
||||||
|
@ -31,7 +31,7 @@ FreedesktopImageHint::FreedesktopImageHint()
|
|||||||
FreedesktopImageHint::FreedesktopImageHint(const QImage &img)
|
FreedesktopImageHint::FreedesktopImageHint(const QImage &img)
|
||||||
{
|
{
|
||||||
QImage image(img.convertToFormat(QImage::Format_ARGB32));
|
QImage image(img.convertToFormat(QImage::Format_ARGB32));
|
||||||
imageData = QByteArray((char *)image.rgbSwapped().bits(), image.numBytes());
|
imageData = QByteArray((char *)image.rgbSwapped().bits(), image.byteCount());
|
||||||
width = image.width();
|
width = image.width();
|
||||||
height = image.height();
|
height = image.height();
|
||||||
rowstride = image.bytesPerLine();
|
rowstride = image.bytesPerLine();
|
||||||
|
@ -9,7 +9,7 @@ if(SnoreGrowl++_FOUND)
|
|||||||
set( GROWL_SRC growlbackend.cpp)
|
set( GROWL_SRC growlbackend.cpp)
|
||||||
|
|
||||||
add_library(libsnore_backend_growl MODULE ${GROWL_SRC} )
|
add_library(libsnore_backend_growl MODULE ${GROWL_SRC} )
|
||||||
target_link_libraries(libsnore_backend_growl Snore::Libsnore Snore::SnoreGrowl++ ${QT_QTCORE_LIBRARY} ${CMAKE_THREAD_LIBS_INIT})
|
target_link_libraries(libsnore_backend_growl Snore::Libsnore Snore::SnoreGrowl++ ${CMAKE_THREAD_LIBS_INIT})
|
||||||
|
|
||||||
|
|
||||||
install(TARGETS libsnore_backend_growl ${SNORE_PLUGIN_INSTALL_PATH})
|
install(TARGETS libsnore_backend_growl ${SNORE_PLUGIN_INSTALL_PATH})
|
||||||
|
@ -26,8 +26,6 @@
|
|||||||
|
|
||||||
using namespace Snore;
|
using namespace Snore;
|
||||||
|
|
||||||
Q_EXPORT_PLUGIN2(libsnore_backend_growl, GrowlBackend)
|
|
||||||
|
|
||||||
GrowlBackend *GrowlBackend::s_instance = NULL;
|
GrowlBackend *GrowlBackend::s_instance = NULL;
|
||||||
|
|
||||||
GrowlBackend::GrowlBackend():
|
GrowlBackend::GrowlBackend():
|
||||||
|
@ -8,7 +8,7 @@ if(WIN32)
|
|||||||
snarl.cpp
|
snarl.cpp
|
||||||
)
|
)
|
||||||
add_library(libsnore_backend_snarl MODULE ${SNARL_SRC} )
|
add_library(libsnore_backend_snarl MODULE ${SNARL_SRC} )
|
||||||
target_link_libraries(libsnore_backend_snarl Snore::Libsnore ${QT_QTCORE_LIBRARY} )
|
target_link_libraries(libsnore_backend_snarl Snore::Libsnore )
|
||||||
if(MINGW)
|
if(MINGW)
|
||||||
set_target_properties(libsnore_backend_snarl PROPERTIES COMPILE_FLAGS "-Wno-conversion-null -Wno-unused")
|
set_target_properties(libsnore_backend_snarl PROPERTIES COMPILE_FLAGS "-Wno-conversion-null -Wno-unused")
|
||||||
endif(MINGW)
|
endif(MINGW)
|
||||||
|
@ -34,8 +34,6 @@
|
|||||||
using namespace Snore;
|
using namespace Snore;
|
||||||
using namespace Snarl::V42;
|
using namespace Snarl::V42;
|
||||||
|
|
||||||
Q_EXPORT_PLUGIN2(libsnore_backend_snarl, SnarlBackend)
|
|
||||||
|
|
||||||
class SnarlBackend::SnarlWidget: public QWidget
|
class SnarlBackend::SnarlWidget: public QWidget
|
||||||
{
|
{
|
||||||
//Q_OBJECT
|
//Q_OBJECT
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
QT4_ADD_RESOURCES(SNORE_RCS ${CMAKE_CURRENT_SOURCE_DIR}/snore_notification.qrc)
|
QT5_ADD_RESOURCES(SNORE_RCS ${CMAKE_CURRENT_SOURCE_DIR}/snore_notification.qrc)
|
||||||
|
|
||||||
set( SNORE_SRC
|
set( SNORE_SRC
|
||||||
snorenotifier.cpp
|
snorenotifier.cpp
|
||||||
@ -8,7 +8,7 @@ set( SNORE_SRC
|
|||||||
|
|
||||||
|
|
||||||
add_library(libsnore_backend_snore MODULE ${SNORE_SRC} )
|
add_library(libsnore_backend_snore MODULE ${SNORE_SRC} )
|
||||||
target_link_libraries(libsnore_backend_snore Snore::Libsnore ${QT_QTCORE_LIBRARY} ${QT_QTDECLARATIVE_LIBRARY})
|
target_link_libraries(libsnore_backend_snore Snore::Libsnore Qt5::Declarative)
|
||||||
|
|
||||||
install(TARGETS libsnore_backend_snore ${SNORE_PLUGIN_INSTALL_PATH})
|
install(TARGETS libsnore_backend_snore ${SNORE_PLUGIN_INSTALL_PATH})
|
||||||
|
|
||||||
|
@ -37,14 +37,11 @@ NotifyWidget::NotifyWidget(int pos, QWidget *parent) :
|
|||||||
{
|
{
|
||||||
m_qmlNotification = rootObject();
|
m_qmlNotification = rootObject();
|
||||||
|
|
||||||
this->setWindowFlags(Qt::WindowStaysOnTopHint | Qt::FramelessWindowHint | Qt::WindowSystemMenuHint
|
this->setWindowFlags(Qt::WindowStaysOnTopHint | Qt::FramelessWindowHint | Qt::WindowSystemMenuHint | Qt::WindowDoesNotAcceptFocus
|
||||||
#ifdef Q_OS_MAC
|
#ifdef Q_OS_MAC
|
||||||
| Qt::SubWindow
|
| Qt::SubWindow
|
||||||
#else
|
#else
|
||||||
| Qt::ToolTip
|
| Qt::ToolTip
|
||||||
#endif
|
|
||||||
#if QT_VERSION >= QT_VERSION_CHECK(5,0,0)
|
|
||||||
| Qt::WindowDoesNotAcceptFocus
|
|
||||||
#endif
|
#endif
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -23,8 +23,6 @@
|
|||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <QThread>
|
#include <QThread>
|
||||||
|
|
||||||
Q_EXPORT_PLUGIN2(libsnore_backend_snore, SnoreNotifier)
|
|
||||||
|
|
||||||
using namespace Snore;
|
using namespace Snore;
|
||||||
|
|
||||||
SnoreNotifier::SnoreNotifier():
|
SnoreNotifier::SnoreNotifier():
|
||||||
|
@ -5,7 +5,7 @@ if(WIN32)
|
|||||||
snoretoast.cpp
|
snoretoast.cpp
|
||||||
)
|
)
|
||||||
add_library(libsnore_backend_snoretoast MODULE ${TOASTER_SRC} )
|
add_library(libsnore_backend_snoretoast MODULE ${TOASTER_SRC} )
|
||||||
target_link_libraries(libsnore_backend_snoretoast Snore::Libsnore ${QT_QTCORE_LIBRARY} )
|
target_link_libraries(libsnore_backend_snoretoast Snore::Libsnore)
|
||||||
|
|
||||||
install(TARGETS libsnore_backend_snoretoast ${SNORE_PLUGIN_INSTALL_PATH})
|
install(TARGETS libsnore_backend_snoretoast ${SNORE_PLUGIN_INSTALL_PATH})
|
||||||
|
|
||||||
|
@ -13,8 +13,6 @@
|
|||||||
|
|
||||||
using namespace Snore;
|
using namespace Snore;
|
||||||
|
|
||||||
Q_EXPORT_PLUGIN2(libsnore_backend_snoretoast, SnoreToast)
|
|
||||||
|
|
||||||
SnoreToast::SnoreToast():
|
SnoreToast::SnoreToast():
|
||||||
SnoreBackend("Windows 8", true, false)
|
SnoreBackend("Windows 8", true, false)
|
||||||
{
|
{
|
||||||
|
@ -2,6 +2,6 @@ set( trayicon_SRC
|
|||||||
trayiconnotifer.cpp
|
trayiconnotifer.cpp
|
||||||
)
|
)
|
||||||
add_library(libsnore_backend_trayicon MODULE ${trayicon_SRC} )
|
add_library(libsnore_backend_trayicon MODULE ${trayicon_SRC} )
|
||||||
target_link_libraries(libsnore_backend_trayicon Snore::Libsnore ${QT_QTCORE_LIBRARY} )
|
target_link_libraries(libsnore_backend_trayicon Snore::Libsnore)
|
||||||
|
|
||||||
install(TARGETS libsnore_backend_trayicon ${SNORE_PLUGIN_INSTALL_PATH})
|
install(TARGETS libsnore_backend_trayicon ${SNORE_PLUGIN_INSTALL_PATH})
|
||||||
|
@ -9,8 +9,6 @@
|
|||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
using namespace Snore;
|
using namespace Snore;
|
||||||
|
|
||||||
Q_EXPORT_PLUGIN2(libsnore_backend_trayicon, TrayIconNotifer)
|
|
||||||
|
|
||||||
TrayIconNotifer::TrayIconNotifer() :
|
TrayIconNotifer::TrayIconNotifer() :
|
||||||
SnoreBackend("SystemTray", true, false),
|
SnoreBackend("SystemTray", true, false),
|
||||||
m_trayIcon(NULL),
|
m_trayIcon(NULL),
|
||||||
|
@ -18,10 +18,10 @@ if(WITH_FREEDESKTOP_FRONTEND)
|
|||||||
../../backends/freedesktop/fredesktopnotification.cpp
|
../../backends/freedesktop/fredesktopnotification.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
qt4_add_dbus_adaptor( FREEDESKTOP_NOTIFICATION_FRONTEND_SRC org.freedesktop.Notifications.xml freedesktopnotificationfrontend.h FreedesktopFrontend)
|
qt5_add_dbus_adaptor( FREEDESKTOP_NOTIFICATION_FRONTEND_SRC org.freedesktop.Notifications.xml freedesktopnotificationfrontend.h FreedesktopFrontend)
|
||||||
|
|
||||||
add_library(libsnore_frontend_freedesktop MODULE ${FREEDESKTOP_NOTIFICATION_FRONTEND_SRC} )
|
add_library(libsnore_frontend_freedesktop MODULE ${FREEDESKTOP_NOTIFICATION_FRONTEND_SRC} )
|
||||||
target_link_libraries(libsnore_frontend_freedesktop Snore::Libsnore ${QT_QTDBUS_LIBRARY} ${QT_QTGUI_LIBRARY} )
|
target_link_libraries(libsnore_frontend_freedesktop Snore::Libsnore Qt5::DBus )
|
||||||
|
|
||||||
|
|
||||||
#install the dbus interface
|
#install the dbus interface
|
||||||
|
@ -31,8 +31,6 @@
|
|||||||
|
|
||||||
using namespace Snore;
|
using namespace Snore;
|
||||||
|
|
||||||
Q_EXPORT_PLUGIN2(libsnore_frontend_freedesktop, FreedesktopFrontend)
|
|
||||||
|
|
||||||
FreedesktopFrontend::FreedesktopFrontend():
|
FreedesktopFrontend::FreedesktopFrontend():
|
||||||
SnoreFrontend("Freedesktop")
|
SnoreFrontend("Freedesktop")
|
||||||
{
|
{
|
||||||
|
@ -3,6 +3,6 @@ set( SNARL_NETWORK_SRC
|
|||||||
parser.cpp
|
parser.cpp
|
||||||
)
|
)
|
||||||
add_library(libsnore_frontend_snarlnetwork MODULE ${SNARL_NETWORK_SRC} )
|
add_library(libsnore_frontend_snarlnetwork MODULE ${SNARL_NETWORK_SRC} )
|
||||||
target_link_libraries(libsnore_frontend_snarlnetwork Snore::Libsnore ${QT_QTNETWORK_LIBRARY} )
|
target_link_libraries(libsnore_frontend_snarlnetwork Snore::Libsnore)
|
||||||
|
|
||||||
install(TARGETS libsnore_frontend_snarlnetwork ${SNORE_PLUGIN_INSTALL_PATH})
|
install(TARGETS libsnore_frontend_snarlnetwork ${SNORE_PLUGIN_INSTALL_PATH})
|
||||||
|
@ -26,8 +26,6 @@
|
|||||||
#include <iostream>
|
#include <iostream>
|
||||||
using namespace Snore;
|
using namespace Snore;
|
||||||
|
|
||||||
Q_EXPORT_PLUGIN2(libsnore_frontend_snarlnetwork, SnarlNetworkFrontend)
|
|
||||||
|
|
||||||
SnarlNetworkFrontend::SnarlNetworkFrontend():
|
SnarlNetworkFrontend::SnarlNetworkFrontend():
|
||||||
SnoreFrontend("SnarlNetwork")
|
SnoreFrontend("SnarlNetwork")
|
||||||
{
|
{
|
||||||
@ -98,7 +96,7 @@ void SnarlNetworkFrontend::handleMessages()
|
|||||||
const QString out("SNP/1.1/0/OK");
|
const QString out("SNP/1.1/0/OK");
|
||||||
QTcpSocket *client = qobject_cast<QTcpSocket *>(sender());
|
QTcpSocket *client = qobject_cast<QTcpSocket *>(sender());
|
||||||
|
|
||||||
QStringList messages(QString::fromAscii(client->readAll()).trimmed().split("\r\n"));
|
QStringList messages(QString::fromLatin1(client->readAll()).trimmed().split("\r\n"));
|
||||||
foreach(const QString & s, messages) {
|
foreach(const QString & s, messages) {
|
||||||
if (s.isEmpty()) {
|
if (s.isEmpty()) {
|
||||||
continue;
|
continue;
|
||||||
|
@ -58,7 +58,7 @@ private:
|
|||||||
inline void write(QTcpSocket *dest, const QString &msg)
|
inline void write(QTcpSocket *dest, const QString &msg)
|
||||||
{
|
{
|
||||||
snoreDebug(SNORE_DEBUG) << msg;
|
snoreDebug(SNORE_DEBUG) << msg;
|
||||||
dest->write(msg.toAscii());
|
dest->write(msg.toLatin1());
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
@ -2,7 +2,7 @@ set( TOASTY_SRC
|
|||||||
toasty.cpp
|
toasty.cpp
|
||||||
)
|
)
|
||||||
add_library(libsnore_secondary_backend_toasty MODULE ${TOASTY_SRC} )
|
add_library(libsnore_secondary_backend_toasty MODULE ${TOASTY_SRC} )
|
||||||
target_link_libraries(libsnore_secondary_backend_toasty Snore::Libsnore ${QT_QTCORE_LIBRARY} )
|
target_link_libraries(libsnore_secondary_backend_toasty Snore::Libsnore)
|
||||||
|
|
||||||
install(TARGETS libsnore_secondary_backend_toasty ${SNORE_PLUGIN_INSTALL_PATH})
|
install(TARGETS libsnore_secondary_backend_toasty ${SNORE_PLUGIN_INSTALL_PATH})
|
||||||
|
|
||||||
|
@ -3,8 +3,6 @@
|
|||||||
#include <QtNetwork>
|
#include <QtNetwork>
|
||||||
#include <QImage>
|
#include <QImage>
|
||||||
|
|
||||||
Q_EXPORT_PLUGIN2(libsnore_secondary_backend_toasty, Toasty)
|
|
||||||
|
|
||||||
using namespace Snore;
|
using namespace Snore;
|
||||||
|
|
||||||
Toasty::Toasty():
|
Toasty::Toasty():
|
||||||
@ -72,8 +70,8 @@ void Toasty::slotRequestFinished()
|
|||||||
bool Toasty::initialize(SnoreCore *snore)
|
bool Toasty::initialize(SnoreCore *snore)
|
||||||
{
|
{
|
||||||
if (SnoreSecondaryBackend::initialize(snore)) {
|
if (SnoreSecondaryBackend::initialize(snore)) {
|
||||||
setDefaultValue("DEVICEID", "");
|
setDefaultValue("DeviceID", "", "The ID provided for your device by Toasty");
|
||||||
snoreDebug(SNORE_DEBUG) << value("DEVICEID");
|
snoreDebug(SNORE_DEBUG) << value("DeviceID");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
@ -31,6 +31,7 @@
|
|||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
|
||||||
using namespace Snore;
|
using namespace Snore;
|
||||||
|
|
||||||
SnoreNotify::SnoreNotify():
|
SnoreNotify::SnoreNotify():
|
||||||
|
Loading…
x
Reference in New Issue
Block a user