1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-07-31 03:10:12 +02:00

more style fixes

This commit is contained in:
Patrick von Reth
2013-07-24 10:33:45 +02:00
parent 501a72d79b
commit 25fae63088
4 changed files with 82 additions and 23 deletions

View File

@@ -297,6 +297,11 @@ if( WIN32 )
macro_log_feature(QTSPARKLE_FOUND "qtsparkle" "Library for creating auto updaters written in Qt" "https://github.com/davidsansome/qtsparkle" FALSE "" "")
endif( WIN32 )
if( WIN32 OR APPLE )
macro_optional_find_package(Libsnore)
macro_log_feature(LIBSNORE_FOUND "SnoreNotify" "Library for notifications" "https://github.com/TheOneRing/Snorenotify" FALSE "" "")
endif()
#TODO: support external qxt
set(QXTWEB_FOUND TRUE)
set(QXTWEB_LIBRARIES qxtweb-standalone)

View File

@@ -0,0 +1,48 @@
########################################################################################
# Copyright (c) 2010 Patrick von Reth <patrick.vonreth@gmail.com> #
# #
# 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, see <http://www.gnu.org/licenses/>. #
########################################################################################
# - Try to find the libsnore library
# Once done this will define
#
# LIBSNORE_FOUND - system has the LIBSNORE library
# LIBSNORE_LIBRARIES - The libraries needed to use LIBSNORE
# LIBSNORE_PLUGIN_PATH - Path of the plugins
find_path(LIBSNORE_INCLUDE_DIR
NAMES snore/core/snore.h
PATHS ${KDE4_INCLUDE_DIR}
)
find_library(LIBSNORE_LIBRARY
NAMES
libsnore
snore
PATHS ${KDE4_LIB_DIR}
)
find_path(LIBSNORE_PLUGIN_PATH snoreplugins)
if(LIBSNORE_LIBRARY AND LIBSNORE_PLUGIN_PATH)
set(LIBSNORE_PLUGIN_PATH ${LIBSNORE_PLUGIN_PATH}/snoreplugins)
endif()
set(LIBSNORE_LIBRARIES ${LIBSNORE_LIBRARY})
set(LIBSNORE_INCLUDE_DIRS ${LIBSNORE_INCLUDE_DIR})
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(LIBSNORE DEFAULT_MSG LIBSNORE_LIBRARIES LIBSNORE_INCLUDE_DIRS)
mark_as_advanced(LIBSNORE_LIBRARIES LIBSNORE_INCLUDE_DIRS)

View File

@@ -3,7 +3,6 @@ include_directories(
${Boost_INCLUDE_DIR}
)
if(WIN32 OR APPLE)
find_package(Libsnore)
if(BUILD_GUI AND LIBSNORE_FOUND)
SET(snore_srcs
snorenotify/SnoreNotifyPlugin.cpp

View File

@@ -72,10 +72,19 @@ SnoreNotifyPlugin::SnoreNotifyPlugin()
m_snore = new Snore::SnoreCore();
m_snore->loadPlugins( Snore::PluginContainer::BACKEND );
QString backend = qgetenv( "SNORE_BACKEND" ).constData();
backend.isEmpty()?m_snore->setPrimaryNotificationBackend():m_snore->setPrimaryNotificationBackend( backend );
tDebug( LOGVERBOSE ) << Q_FUNC_INFO << m_snore->primaryNotificationBackend();
m_application = new Snore::Application( qApp->applicationName(), m_defaultIcon );
if( backend.isEmpty() )
{
m_snore->setPrimaryNotificationBackend();
}
else
{
m_snore->setPrimaryNotificationBackend( backend );
}
tDebug( LOGVERBOSE ) << Q_FUNC_INFO << m_snore->primaryNotificationBackend();
m_application = new Snore::Application( qApp->applicationName(), m_defaultIcon );
m_snore->addApplication( m_application );
m_snore->applicationIsInitialized( m_application );
@@ -86,8 +95,6 @@ SnoreNotifyPlugin::SnoreNotifyPlugin()
addAlert( InfoInboxReceived, tr( "You recived a Song recomondation" ) );
connect( m_snore, SIGNAL( actionInvoked( Snore::Notification ) ), this, SLOT( slotActionInvoked( Snore::Notification ) ) );
}
@@ -113,28 +120,28 @@ SnoreNotifyPlugin::pushInfo( Tomahawk::InfoSystem::InfoPushData pushData )
switch ( pushData.type )
{
case Tomahawk::InfoSystem::InfoTrackUnresolved:
notifyUser( Tomahawk::InfoSystem::InfoTrackUnresolved,"The current track could not be resolved. Tomahawk will pick back up with the next resolvable track from this source." );
return;
case Tomahawk::InfoSystem::InfoTrackUnresolved:
notifyUser( Tomahawk::InfoSystem::InfoTrackUnresolved,"The current track could not be resolved. Tomahawk will pick back up with the next resolvable track from this source." );
return;
case Tomahawk::InfoSystem::InfoNotifyUser:
notifyUser( Tomahawk::InfoSystem::InfoNotifyUser,pushData.infoPair.second.toString() );
return;
case Tomahawk::InfoSystem::InfoNotifyUser:
notifyUser( Tomahawk::InfoSystem::InfoNotifyUser,pushData.infoPair.second.toString() );
return;
case Tomahawk::InfoSystem::InfoNowStopped:
notifyUser( Tomahawk::InfoSystem::InfoNowStopped, "Tomahawk stopped playback." );
return;
case Tomahawk::InfoSystem::InfoNowStopped:
notifyUser( Tomahawk::InfoSystem::InfoNowStopped, "Tomahawk stopped playback." );
return;
case Tomahawk::InfoSystem::InfoNowPlaying:
nowPlaying( pushData.infoPair.second );
return;
case Tomahawk::InfoSystem::InfoNowPlaying:
nowPlaying( pushData.infoPair.second );
return;
case Tomahawk::InfoSystem::InfoInboxReceived:
inboxReceived( pushData.infoPair.second );
return;
case Tomahawk::InfoSystem::InfoInboxReceived:
inboxReceived( pushData.infoPair.second );
return;
default:
return;
default:
return;
}
}