diff --git a/src/accounts/accountdllmacro.h b/src/accounts/accountdllmacro.h new file mode 100644 index 000000000..bca08fc02 --- /dev/null +++ b/src/accounts/accountdllmacro.h @@ -0,0 +1,32 @@ +/* === This file is part of Tomahawk Player - === + * + * Copyright 2010-2011, Christian Muehlhaeuser + * + * 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 . + */ + +#ifndef ACCOUNTDLLMACRO_H +#define ACCOUNTDLLMACRO_H + +#ifdef Q_WS_WIN + #ifdef ACCOUNTDLLEXPORT_PRO + #define ACCOUNTDLLEXPORT __declspec(dllexport) + #else + #define ACCOUNTDLLEXPORT __declspec(dllimport) + #endif +#else + #define ACCOUNTDLLEXPORT +#endif + +#endif diff --git a/src/accounts/twitter/CMakeLists.txt b/src/accounts/twitter/CMakeLists.txt index 3cda7f736..0b667d85f 100644 --- a/src/accounts/twitter/CMakeLists.txt +++ b/src/accounts/twitter/CMakeLists.txt @@ -4,37 +4,31 @@ include( ${QT_USE_FILE} ) add_definitions( ${QT_DEFINITIONS} ) add_definitions( -DQT_PLUGIN ) add_definitions( -DQT_SHARED ) -add_definitions( -DDLLEXPORT_PRO ) +add_definitions( -DACCOUNTDLLEXPORT_PRO ) set( twitterAccountSources twitteraccount.cpp twitterconfigwidget.cpp + tomahawkoauthtwitter.cpp + sip/twittersip.cpp ) set( twitterAccountHeaders twitteraccount.h twitterconfigwidget.h + tomahawkoauthtwitter.h + sip/twittersip.h ) set( twitterAccountUI twitterconfigwidget.ui ) -set( tomahawkOAuthTwitterSources - tomahawkoauthtwitter.cpp -) - -set( tomahawkOAuthTwitterHeaders - tomahawkoauthtwitter.h -) - include_directories( . ${CMAKE_CURRENT_BINARY_DIR} .. ${QT_INCLUDE_DIR} ${QTWEETLIB_INCLUDE_DIR} ) -qt4_wrap_cpp( tomahawkOAuthTwitterMoc ${tomahawkOAuthTwitterHeaders} ) -add_library( tomahawk_oauth_twitter SHARED ${tomahawkOAuthTwitterSources} ${tomahawkOAuthTwitterMoc} ) qt4_wrap_cpp( twitterAccountMoc ${twitterAccountHeaders} ) qt4_wrap_ui( twitterAccountUI_H ${twitterAccountUI} ) qt4_add_resources( RC_SRCS "resources.qrc" ) @@ -48,16 +42,7 @@ SET( OS_SPECIFIC_LINK_LIBRARIES ) ENDIF( WIN32 ) -target_link_libraries( tomahawk_oauth_twitter - ${TOMAHAWK_LIBRARIES} - ${QTWEETLIB_LIBRARIES} - ${QT_LIBRARIES} - ${OS_SPECIFIC_LINK_LIBRARIES} -) - target_link_libraries( tomahawk_account_twitter - tomahawk_oauth_twitter - tomahawk_sip_twitter ${TOMAHAWK_LIBRARIES} ${QTWEETLIB_LIBRARIES} ${QT_LIBRARIES} @@ -68,5 +53,4 @@ IF( APPLE ) # SET( CMAKE_SHARED_LINKER_FLAGS ${CMAKE_SHARED_LINKER_FLAGS} "-undefined dynamic_lookup" ) ENDIF( APPLE ) -install( TARGETS tomahawk_oauth_twitter DESTINATION lib${LIB_SUFFIX} ) install( TARGETS tomahawk_account_twitter DESTINATION lib${LIB_SUFFIX} ) diff --git a/src/sip/twitter/twittersip.cpp b/src/accounts/twitter/sip/twittersip.cpp similarity index 99% rename from src/sip/twitter/twittersip.cpp rename to src/accounts/twitter/sip/twittersip.cpp index 0c80930e9..ddeba632b 100644 --- a/src/sip/twitter/twittersip.cpp +++ b/src/accounts/twitter/sip/twittersip.cpp @@ -155,6 +155,8 @@ TwitterSipPlugin::disconnectPlugin() void TwitterSipPlugin::accountAuthenticated( const QWeakPointer< TomahawkOAuthTwitter > &twitterAuth, const QTweetUser &user ) { + Q_UNUSED( user ); + if ( !isValid() ) return; diff --git a/src/sip/twitter/twittersip.h b/src/accounts/twitter/sip/twittersip.h similarity index 97% rename from src/sip/twitter/twittersip.h rename to src/accounts/twitter/sip/twittersip.h index 5036f9594..76631ac39 100644 --- a/src/sip/twitter/twittersip.h +++ b/src/accounts/twitter/sip/twittersip.h @@ -32,12 +32,12 @@ #include #include -#include "../sipdllmacro.h" +#include "accounts/accountdllmacro.h" #include "sip/SipPlugin.h" #include "accounts/account.h" #include "accounts/twitter/tomahawkoauthtwitter.h" -class SIPDLLEXPORT TwitterSipPlugin : public SipPlugin +class ACCOUNTDLLEXPORT TwitterSipPlugin : public SipPlugin { Q_OBJECT diff --git a/src/accounts/twitter/tomahawkoauthtwitter.cpp b/src/accounts/twitter/tomahawkoauthtwitter.cpp index 35cd98a9e..b9b7e653d 100644 --- a/src/accounts/twitter/tomahawkoauthtwitter.cpp +++ b/src/accounts/twitter/tomahawkoauthtwitter.cpp @@ -1,6 +1,6 @@ #include "tomahawkoauthtwitter.h" -#include +#include #include "utils/logger.h" diff --git a/src/accounts/twitter/tomahawkoauthtwitter.h b/src/accounts/twitter/tomahawkoauthtwitter.h index 12def04d3..7cd243efe 100644 --- a/src/accounts/twitter/tomahawkoauthtwitter.h +++ b/src/accounts/twitter/tomahawkoauthtwitter.h @@ -1,13 +1,13 @@ #ifndef TOMAHAWKOAUTHTWITTERACCOUNT #define TOMAHAWKOAUTHTWITTERACCOUNT -#include "dllmacro.h" +#include "accounts/accountdllmacro.h" #include #include #include -class DLLEXPORT TomahawkOAuthTwitter : public OAuthTwitter +class ACCOUNTDLLEXPORT TomahawkOAuthTwitter : public OAuthTwitter { Q_OBJECT diff --git a/src/accounts/twitter/twitteraccount.h b/src/accounts/twitter/twitteraccount.h index 9daa74139..a440f44bf 100644 --- a/src/accounts/twitter/twitteraccount.h +++ b/src/accounts/twitter/twitteraccount.h @@ -19,12 +19,11 @@ #ifndef TWITTERACCOUNT_H #define TWITTERACCOUNT_H -#include "dllmacro.h" - #include "twitterconfigwidget.h" #include "tomahawkoauthtwitter.h" -#include "sip/twitter/twittersip.h" +#include "sip/twittersip.h" +#include "accounts/accountdllmacro.h" #include "accounts/account.h" #define MYNAME "ACCOUNTTWITTER" @@ -35,7 +34,7 @@ namespace Tomahawk namespace Accounts { -class DLLEXPORT TwitterAccountFactory : public AccountFactory +class ACCOUNTDLLEXPORT TwitterAccountFactory : public AccountFactory { Q_OBJECT Q_INTERFACES( Tomahawk::Accounts::AccountFactory ) diff --git a/src/accounts/xmpp/CMakeLists.txt b/src/accounts/xmpp/CMakeLists.txt index 8660914e4..69fa87122 100644 --- a/src/accounts/xmpp/CMakeLists.txt +++ b/src/accounts/xmpp/CMakeLists.txt @@ -4,20 +4,29 @@ include( ${QT_USE_FILE} ) add_definitions( ${QT_DEFINITIONS} ) add_definitions( -DQT_PLUGIN ) add_definitions( -DQT_SHARED ) -add_definitions( -DDLLEXPORT_PRO ) +add_definitions( -DACCOUNTDLLEXPORT_PRO ) set( xmppAccountSources xmppaccount.cpp xmppconfigwidget.cpp + sip/xmppsip.cpp + sip/tomahawkxmppmessage.cpp + sip/tomahawkxmppmessagefactory.cpp + sip/avatarmanager.cpp + sip/xmlconsole.cpp ) set( xmppAccountHeaders xmppaccount.h xmppconfigwidget.h + sip/xmppsip.h + sip/avatarmanager.h + sip/xmlconsole.h ) set( xmppAccountUI xmppconfigwidget.ui + sip/xmlconsole.ui ) include_directories( . ${CMAKE_CURRENT_BINARY_DIR} .. @@ -39,9 +48,8 @@ SET( OS_SPECIFIC_LINK_LIBRARIES ENDIF( WIN32 ) target_link_libraries( tomahawk_account_xmpp - tomahawk_sip_xmpp ${TOMAHAWK_LIBRARIES} - ${JREEN_LIBRARY} + ${LIBJREEN_LIBRARY} ${QT_LIBRARIES} ${OS_SPECIFIC_LINK_LIBRARIES} ) @@ -51,3 +59,6 @@ IF( APPLE ) ENDIF( APPLE ) install( TARGETS tomahawk_account_xmpp DESTINATION lib${LIB_SUFFIX} ) + +#add_subdirectory(googlewrapper) + diff --git a/src/sip/xmpp/googlewrapper/CMakeLists.txt b/src/accounts/xmpp/googlewrapper/CMakeLists.txt similarity index 100% rename from src/sip/xmpp/googlewrapper/CMakeLists.txt rename to src/accounts/xmpp/googlewrapper/CMakeLists.txt diff --git a/src/sip/xmpp/googlewrapper/gmail-logo.png b/src/accounts/xmpp/googlewrapper/gmail-logo.png similarity index 100% rename from src/sip/xmpp/googlewrapper/gmail-logo.png rename to src/accounts/xmpp/googlewrapper/gmail-logo.png diff --git a/src/sip/xmpp/googlewrapper/googlewrapper.cpp b/src/accounts/xmpp/googlewrapper/googlewrapper.cpp similarity index 100% rename from src/sip/xmpp/googlewrapper/googlewrapper.cpp rename to src/accounts/xmpp/googlewrapper/googlewrapper.cpp diff --git a/src/sip/xmpp/googlewrapper/googlewrapper.h b/src/accounts/xmpp/googlewrapper/googlewrapper.h similarity index 100% rename from src/sip/xmpp/googlewrapper/googlewrapper.h rename to src/accounts/xmpp/googlewrapper/googlewrapper.h diff --git a/src/sip/xmpp/googlewrapper/resources.qrc b/src/accounts/xmpp/googlewrapper/resources.qrc similarity index 100% rename from src/sip/xmpp/googlewrapper/resources.qrc rename to src/accounts/xmpp/googlewrapper/resources.qrc diff --git a/src/sip/xmpp/avatarmanager.cpp b/src/accounts/xmpp/sip/avatarmanager.cpp similarity index 100% rename from src/sip/xmpp/avatarmanager.cpp rename to src/accounts/xmpp/sip/avatarmanager.cpp diff --git a/src/sip/xmpp/avatarmanager.h b/src/accounts/xmpp/sip/avatarmanager.h similarity index 92% rename from src/sip/xmpp/avatarmanager.h rename to src/accounts/xmpp/sip/avatarmanager.h index ea755d76e..c16711453 100644 --- a/src/sip/xmpp/avatarmanager.h +++ b/src/accounts/xmpp/sip/avatarmanager.h @@ -21,12 +21,12 @@ #include -#include -#include +#include +#include -#include "../sipdllmacro.h" +#include "accounts/accountdllmacro.h" -class SIPDLLEXPORT AvatarManager : public QObject +class ACCOUNTDLLEXPORT AvatarManager : public QObject { Q_OBJECT diff --git a/src/sip/xmpp/tomahawkxmppmessage.cpp b/src/accounts/xmpp/sip/tomahawkxmppmessage.cpp similarity index 100% rename from src/sip/xmpp/tomahawkxmppmessage.cpp rename to src/accounts/xmpp/sip/tomahawkxmppmessage.cpp diff --git a/src/sip/xmpp/tomahawkxmppmessage.h b/src/accounts/xmpp/sip/tomahawkxmppmessage.h similarity index 94% rename from src/sip/xmpp/tomahawkxmppmessage.h rename to src/accounts/xmpp/sip/tomahawkxmppmessage.h index 5d6e0b14f..8661c30bd 100644 --- a/src/sip/xmpp/tomahawkxmppmessage.h +++ b/src/accounts/xmpp/sip/tomahawkxmppmessage.h @@ -23,10 +23,10 @@ #define TOMAHAWK_SIP_MESSAGE_NS QLatin1String("http://www.tomhawk-player.org/sip/transports") -#include "../sipdllmacro.h" +#include "accounts/accountdllmacro.h" class TomahawkXmppMessagePrivate; -class SIPDLLEXPORT TomahawkXmppMessage : public Jreen::Payload +class ACCOUNTDLLEXPORT TomahawkXmppMessage : public Jreen::Payload { J_PAYLOAD(TomahawkXmppMessage) Q_DECLARE_PRIVATE(TomahawkXmppMessage) diff --git a/src/sip/xmpp/tomahawkxmppmessagefactory.cpp b/src/accounts/xmpp/sip/tomahawkxmppmessagefactory.cpp similarity index 100% rename from src/sip/xmpp/tomahawkxmppmessagefactory.cpp rename to src/accounts/xmpp/sip/tomahawkxmppmessagefactory.cpp diff --git a/src/sip/xmpp/tomahawkxmppmessagefactory.h b/src/accounts/xmpp/sip/tomahawkxmppmessagefactory.h similarity index 92% rename from src/sip/xmpp/tomahawkxmppmessagefactory.h rename to src/accounts/xmpp/sip/tomahawkxmppmessagefactory.h index 9d9aa6cab..ab713f30f 100644 --- a/src/sip/xmpp/tomahawkxmppmessagefactory.h +++ b/src/accounts/xmpp/sip/tomahawkxmppmessagefactory.h @@ -23,9 +23,9 @@ #include -#include "../sipdllmacro.h" +#include "accounts/accountdllmacro.h" -class SIPDLLEXPORT TomahawkXmppMessageFactory : public Jreen::PayloadFactory +class ACCOUNTDLLEXPORT TomahawkXmppMessageFactory : public Jreen::PayloadFactory { public: TomahawkXmppMessageFactory(); diff --git a/src/sip/xmpp/xmlconsole.cpp b/src/accounts/xmpp/sip/xmlconsole.cpp similarity index 100% rename from src/sip/xmpp/xmlconsole.cpp rename to src/accounts/xmpp/sip/xmlconsole.cpp diff --git a/src/sip/xmpp/xmlconsole.h b/src/accounts/xmpp/sip/xmlconsole.h similarity index 94% rename from src/sip/xmpp/xmlconsole.h rename to src/accounts/xmpp/sip/xmlconsole.h index 6254df941..4c8476953 100644 --- a/src/sip/xmpp/xmlconsole.h +++ b/src/accounts/xmpp/sip/xmlconsole.h @@ -23,18 +23,18 @@ #include #include -#include -#include -#include -#include +#include +#include +#include +#include namespace Ui { class XmlConsole; } -#include "../sipdllmacro.h" +#include "accounts/accountdllmacro.h" -class SIPDLLEXPORT XmlConsole : public QWidget, public Jreen::XmlStreamHandler +class ACCOUNTDLLEXPORT XmlConsole : public QWidget, public Jreen::XmlStreamHandler { Q_OBJECT diff --git a/src/sip/xmpp/xmlconsole.ui b/src/accounts/xmpp/sip/xmlconsole.ui similarity index 100% rename from src/sip/xmpp/xmlconsole.ui rename to src/accounts/xmpp/sip/xmlconsole.ui diff --git a/src/sip/xmpp/xmppsip.cpp b/src/accounts/xmpp/sip/xmppsip.cpp similarity index 100% rename from src/sip/xmpp/xmppsip.cpp rename to src/accounts/xmpp/sip/xmppsip.cpp diff --git a/src/sip/xmpp/xmppsip.h b/src/accounts/xmpp/sip/xmppsip.h similarity index 97% rename from src/sip/xmpp/xmppsip.h rename to src/accounts/xmpp/sip/xmppsip.h index f4e973f92..aa8efb10e 100644 --- a/src/sip/xmpp/xmppsip.h +++ b/src/accounts/xmpp/sip/xmppsip.h @@ -43,9 +43,9 @@ #define TOMAHAWK_FEATURE QLatin1String( "tomahawk:sip:v1" ) #define TOMAHAWK_CAP_NODE_NAME QLatin1String( "http://tomahawk-player.org/" ) -#include "../sipdllmacro.h" +#include "accounts/accountdllmacro.h" -class SIPDLLEXPORT XmppSipPlugin : public SipPlugin +class ACCOUNTDLLEXPORT XmppSipPlugin : public SipPlugin { Q_OBJECT diff --git a/src/accounts/xmpp/xmppaccount.h b/src/accounts/xmpp/xmppaccount.h index 4074224e6..9c0b314cf 100644 --- a/src/accounts/xmpp/xmppaccount.h +++ b/src/accounts/xmpp/xmppaccount.h @@ -20,9 +20,8 @@ #ifndef XMPPACCOUNT_H #define XMPPACCOUNT_H -#include "dllmacro.h" - -#include "sip/xmpp/xmppsip.h" +#include "sip/xmppsip.h" +#include "accounts/accountdllmacro.h" #include "accounts/account.h" #define MYNAME "ACCOUNTJABBER" @@ -35,7 +34,7 @@ namespace Tomahawk namespace Accounts { -class DLLEXPORT XmppAccountFactory : public AccountFactory +class ACCOUNTDLLEXPORT XmppAccountFactory : public AccountFactory { Q_OBJECT Q_INTERFACES( Tomahawk::Accounts::AccountFactory ) diff --git a/src/sip/CMakeLists.txt b/src/sip/CMakeLists.txt index a85c4010a..0f75b1e32 100644 --- a/src/sip/CMakeLists.txt +++ b/src/sip/CMakeLists.txt @@ -1,9 +1 @@ -IF( LIBJREEN_FOUND ) - ADD_SUBDIRECTORY( xmpp ) -ENDIF( LIBJREEN_FOUND ) - -IF( QTWEETLIB_FOUND ) - ADD_SUBDIRECTORY( twitter ) -ENDIF( QTWEETLIB_FOUND ) - #ADD_SUBDIRECTORY( zeroconf ) diff --git a/src/sip/twitter/CMakeLists.txt b/src/sip/twitter/CMakeLists.txt deleted file mode 100644 index 72f3a192e..000000000 --- a/src/sip/twitter/CMakeLists.txt +++ /dev/null @@ -1,46 +0,0 @@ -project( tomahawk ) - -include( ${QT_USE_FILE} ) -add_definitions( ${QT_DEFINITIONS} ) -add_definitions( -DQT_PLUGIN ) -add_definitions( -DQT_SHARED ) -add_definitions( -DSIPDLLEXPORT_PRO ) - -set( twitterSources - twittersip.cpp -) - -set( twitterHeaders - twittersip.h -) - -include_directories( . ${CMAKE_CURRENT_BINARY_DIR} .. - ${QT_INCLUDE_DIR} - ${QTWEETLIB_INCLUDE_DIR} -) - -qt4_add_resources( RC_SRCS "resources.qrc" ) -qt4_wrap_cpp( twitterMoc ${twitterHeaders} ) -add_library( tomahawk_sip_twitter SHARED ${twitterSources} ${twitterMoc} ${RC_SRCS} ) - -IF( WIN32 ) -SET( OS_SPECIFIC_LINK_LIBRARIES - ${OS_SPECIFIC_LINK_LIBRARIES} - "winmm.dll" - "iphlpapi.a" -) -ENDIF( WIN32 ) - -target_link_libraries( tomahawk_sip_twitter - tomahawk_oauth_twitter - ${TOMAHAWK_LIBRARIES} - ${QTWEETLIB_LIBRARIES} - ${QT_LIBRARIES} - ${OS_SPECIFIC_LINK_LIBRARIES} -) - -IF( APPLE ) -# SET( CMAKE_SHARED_LINKER_FLAGS ${CMAKE_SHARED_LINKER_FLAGS} "-undefined dynamic_lookup" ) -ENDIF( APPLE ) - -install( TARGETS tomahawk_sip_twitter DESTINATION lib${LIB_SUFFIX} ) diff --git a/src/sip/twitter/resources.qrc b/src/sip/twitter/resources.qrc deleted file mode 100644 index fc7df302f..000000000 --- a/src/sip/twitter/resources.qrc +++ /dev/null @@ -1,5 +0,0 @@ - - -twitter-icon.png - - diff --git a/src/sip/twitter/twitter-icon.png b/src/sip/twitter/twitter-icon.png deleted file mode 100644 index aab1fca87..000000000 Binary files a/src/sip/twitter/twitter-icon.png and /dev/null differ