diff --git a/CMakeModules/FindJreen.cmake b/CMakeModules/FindJreen.cmake index 3788e9f23..e1f97d16c 100644 --- a/CMakeModules/FindJreen.cmake +++ b/CMakeModules/FindJreen.cmake @@ -30,7 +30,6 @@ ENDIF() INCLUDE(FindPackageHandleStandardArgs) FIND_PACKAGE_HANDLE_STANDARD_ARGS(Jreen - REQUIRED_VARS JREEN_LIBRARIES JREEN_INCLUDE_DIR - VERSION_VAR PC_JREEN_VERSION) + REQUIRED_VARS JREEN_LIBRARIES JREEN_INCLUDE_DIR) MARK_AS_ADVANCED(JREEN_INCLUDE_DIR JREEN_LIBRARIES) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 07e594c76..61479c7c7 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -68,8 +68,6 @@ SET( tomahawkSourcesGui ${tomahawkSourcesGui} sourcetree/items/GroupItem.cpp sourcetree/items/HistoryItem.cpp - utils/GuiHelpers.cpp - accounts/lastfm/LastFmAccount.cpp accounts/lastfm/LastFmConfig.cpp accounts/lastfm/LastFmInfoPlugin.cpp @@ -82,13 +80,9 @@ SET( tomahawkSourcesGui ${tomahawkSourcesGui} AudioControls.cpp SettingsDialog.cpp DiagnosticsDialog.cpp - AccountDelegate.cpp SettingsListDelegate.cpp - DelegateConfigWrapper.cpp TomahawkWindow.cpp LoadXSPFDialog.cpp - AccountFactoryWrapper.cpp - AccountFactoryWrapperDelegate.cpp SocialWidget.cpp ) @@ -107,7 +101,6 @@ SET( tomahawkUI ${tomahawkUI} AudioControls.ui LoadXSPFDialog.ui - AccountFactoryWrapper.ui SocialWidget.ui ) @@ -122,7 +115,6 @@ INCLUDE_DIRECTORIES( network sourcetree topbar - utils libtomahawk mac diff --git a/src/SettingsDialog.cpp b/src/SettingsDialog.cpp index c9cc2546c..54fab5fa5 100644 --- a/src/SettingsDialog.cpp +++ b/src/SettingsDialog.cpp @@ -32,16 +32,16 @@ #include "AtticaManager.h" #include "TomahawkApp.h" #include "TomahawkSettings.h" -#include "DelegateConfigWrapper.h" +#include "accounts/DelegateConfigWrapper.h" #include "MusicScanner.h" #include "Pipeline.h" #include "Resolver.h" #include "ExternalResolverGui.h" #include "utils/TomahawkUtilsGui.h" -#include "GuiHelpers.h" +#include "utils/GuiHelpers.h" #include "ScanManager.h" #include "SettingsListDelegate.h" -#include "AccountDelegate.h" +#include "accounts/AccountDelegate.h" #include "database/Database.h" #include "network/Servent.h" #include "utils/AnimatedSpinner.h" @@ -51,7 +51,7 @@ #include #include #include "utils/Logger.h" -#include "AccountFactoryWrapper.h" +#include "accounts/AccountFactoryWrapper.h" #include "accounts/spotify/SpotifyAccount.h" #include "ui_ProxyDialog.h" diff --git a/src/accounts/zeroconf/ZeroconfAccount.cpp b/src/accounts/zeroconf/ZeroconfAccount.cpp index 44d74e057..364022a37 100644 --- a/src/accounts/zeroconf/ZeroconfAccount.cpp +++ b/src/accounts/zeroconf/ZeroconfAccount.cpp @@ -86,7 +86,7 @@ void ZeroconfAccount::authenticate() { if ( !isAuthenticated() ) - static_cast< ZeroconfPlugin* >( m_sipPlugin.data() )->connectPlugin(); + sipPlugin()->connectPlugin(); } @@ -94,7 +94,7 @@ void ZeroconfAccount::deauthenticate() { if ( isAuthenticated() ) - static_cast< ZeroconfPlugin* >( m_sipPlugin.data() )->disconnectPlugin(); + sipPlugin()->disconnectPlugin(); } @@ -112,7 +112,7 @@ ZeroconfAccount::connectionState() const return Disconnected; // TODO can we get called before sipPlugin()? - return static_cast< ZeroconfPlugin* >( m_sipPlugin.data() )->connectionState(); + return m_sipPlugin.data()->connectionState(); } @@ -120,10 +120,10 @@ SipPlugin* ZeroconfAccount::sipPlugin() { if ( m_sipPlugin.isNull() ) - m_sipPlugin = QWeakPointer< SipPlugin >( new ZeroconfPlugin( this ) ); + m_sipPlugin = QWeakPointer< ZeroconfPlugin >( new ZeroconfPlugin( this ) ); return m_sipPlugin.data(); } -Q_EXPORT_PLUGIN2( Tomahawk::Accounts::AccountFactory, Tomahawk::Accounts::ZeroconfFactory ) \ No newline at end of file +Q_EXPORT_PLUGIN2( Tomahawk::Accounts::AccountFactory, Tomahawk::Accounts::ZeroconfFactory ) diff --git a/src/accounts/zeroconf/ZeroconfAccount.h b/src/accounts/zeroconf/ZeroconfAccount.h index 30d43e038..136c971c0 100644 --- a/src/accounts/zeroconf/ZeroconfAccount.h +++ b/src/accounts/zeroconf/ZeroconfAccount.h @@ -19,6 +19,7 @@ #ifndef ZEROCONF_ACCOUNTS_H #define ZEROCONF_ACCOUNTS_H +#include "Zeroconf.h" #include "accounts/Account.h" #include "../AccountDllMacro.h" @@ -71,7 +72,7 @@ public: QWidget* aclWidget() { return 0; } private: - QWeakPointer< SipPlugin > m_sipPlugin; + QWeakPointer< ZeroconfPlugin > m_sipPlugin; }; } diff --git a/src/libtomahawk/CMakeLists.txt b/src/libtomahawk/CMakeLists.txt index 4a1f0c049..ab645e2cb 100644 --- a/src/libtomahawk/CMakeLists.txt +++ b/src/libtomahawk/CMakeLists.txt @@ -191,6 +191,10 @@ set( libSources accounts/AccountModel.cpp accounts/AccountModelFilterProxy.cpp accounts/ResolverAccount.cpp + accounts/AccountDelegate.cpp + accounts/DelegateConfigWrapper.cpp + accounts/AccountFactoryWrapper.cpp + accounts/AccountFactoryWrapperDelegate.cpp sip/SipPlugin.cpp sip/SipHandler.cpp sip/SipInfo.cpp @@ -288,6 +292,7 @@ set( libSources utils/Qnr_IoDeviceStream.cpp utils/XspfLoader.cpp utils/TomahawkCache.cpp + utils/GuiHelpers.cpp thirdparty/kdsingleapplicationguard/kdsingleapplicationguard.cpp thirdparty/kdsingleapplicationguard/kdsharedmemorylocker.cpp @@ -311,6 +316,7 @@ set( libUI ${libUI} playlist/QueueView.ui context/ContextWidget.ui infobar/InfoBar.ui + accounts/AccountFactoryWrapper.ui ) include_directories( . ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR}/.. .. diff --git a/src/AccountDelegate.cpp b/src/libtomahawk/accounts/AccountDelegate.cpp similarity index 99% rename from src/AccountDelegate.cpp rename to src/libtomahawk/accounts/AccountDelegate.cpp index 7434fd826..a674d582b 100644 --- a/src/AccountDelegate.cpp +++ b/src/libtomahawk/accounts/AccountDelegate.cpp @@ -604,6 +604,7 @@ AccountDelegate::drawStatus( QPainter* painter, const QPointF& rightTopEdge, Acc { QPixmap p; QString statusText; + const Account::ConnectionState state = acct->connectionState(); if ( state == Account::Connected ) { diff --git a/src/AccountDelegate.h b/src/libtomahawk/accounts/AccountDelegate.h similarity index 97% rename from src/AccountDelegate.h rename to src/libtomahawk/accounts/AccountDelegate.h index 6fbcdffdb..1b70a7df6 100644 --- a/src/AccountDelegate.h +++ b/src/libtomahawk/accounts/AccountDelegate.h @@ -19,6 +19,7 @@ #ifndef ACCOUNTDELEGATE_H #define ACCOUNTDELEGATE_H +#include "DllMacro.h" #include #include "accounts/AccountModel.h" @@ -31,7 +32,7 @@ namespace Accounts class Account; -class AccountDelegate : public QStyledItemDelegate +class DLLEXPORT AccountDelegate : public QStyledItemDelegate { Q_OBJECT public: diff --git a/src/AccountFactoryWrapper.cpp b/src/libtomahawk/accounts/AccountFactoryWrapper.cpp similarity index 99% rename from src/AccountFactoryWrapper.cpp rename to src/libtomahawk/accounts/AccountFactoryWrapper.cpp index adf5cb41d..4b1214b1c 100644 --- a/src/AccountFactoryWrapper.cpp +++ b/src/libtomahawk/accounts/AccountFactoryWrapper.cpp @@ -20,7 +20,7 @@ #include "accounts/Account.h" #include "accounts/AccountManager.h" -#include "GuiHelpers.h" +#include "utils/GuiHelpers.h" #include "AccountFactoryWrapperDelegate.h" #include "DelegateConfigWrapper.h" #include "ui_AccountFactoryWrapper.h" diff --git a/src/AccountFactoryWrapper.h b/src/libtomahawk/accounts/AccountFactoryWrapper.h similarity index 95% rename from src/AccountFactoryWrapper.h rename to src/libtomahawk/accounts/AccountFactoryWrapper.h index 00e31e672..ac8bf195d 100644 --- a/src/AccountFactoryWrapper.h +++ b/src/libtomahawk/accounts/AccountFactoryWrapper.h @@ -19,6 +19,8 @@ #ifndef ACCOUNTFACTORYWRAPPER_H #define ACCOUNTFACTORYWRAPPER_H +#include "DllMacro.h" + #include #include @@ -33,7 +35,7 @@ class Account; class Ui_AccountFactoryWrapper; // class AccountFactoryWrapper_ -class AccountFactoryWrapper : public QDialog +class DLLEXPORT AccountFactoryWrapper : public QDialog { Q_OBJECT public: diff --git a/src/AccountFactoryWrapper.ui b/src/libtomahawk/accounts/AccountFactoryWrapper.ui similarity index 100% rename from src/AccountFactoryWrapper.ui rename to src/libtomahawk/accounts/AccountFactoryWrapper.ui diff --git a/src/AccountFactoryWrapperDelegate.cpp b/src/libtomahawk/accounts/AccountFactoryWrapperDelegate.cpp similarity index 100% rename from src/AccountFactoryWrapperDelegate.cpp rename to src/libtomahawk/accounts/AccountFactoryWrapperDelegate.cpp diff --git a/src/AccountFactoryWrapperDelegate.h b/src/libtomahawk/accounts/AccountFactoryWrapperDelegate.h similarity index 100% rename from src/AccountFactoryWrapperDelegate.h rename to src/libtomahawk/accounts/AccountFactoryWrapperDelegate.h diff --git a/src/DelegateConfigWrapper.cpp b/src/libtomahawk/accounts/DelegateConfigWrapper.cpp similarity index 100% rename from src/DelegateConfigWrapper.cpp rename to src/libtomahawk/accounts/DelegateConfigWrapper.cpp diff --git a/src/DelegateConfigWrapper.h b/src/libtomahawk/accounts/DelegateConfigWrapper.h similarity index 100% rename from src/DelegateConfigWrapper.h rename to src/libtomahawk/accounts/DelegateConfigWrapper.h diff --git a/src/utils/GuiHelpers.cpp b/src/libtomahawk/utils/GuiHelpers.cpp similarity index 98% rename from src/utils/GuiHelpers.cpp rename to src/libtomahawk/utils/GuiHelpers.cpp index 6a77d1b6c..a682f8b9c 100644 --- a/src/utils/GuiHelpers.cpp +++ b/src/libtomahawk/utils/GuiHelpers.cpp @@ -22,7 +22,7 @@ #include "accounts/Account.h" #include "accounts/AccountManager.h" -#include "DelegateConfigWrapper.h" +#include "accounts/DelegateConfigWrapper.h" #include "TomahawkSettings.h" namespace TomahawkUtils @@ -169,4 +169,4 @@ openAccountConfig( Tomahawk::Accounts::Account* account, QWidget* parent, bool s } // namespace TomahawkUtils -#include "GuiHelpers.moc" \ No newline at end of file +#include "GuiHelpers.moc" diff --git a/src/utils/GuiHelpers.h b/src/libtomahawk/utils/GuiHelpers.h similarity index 80% rename from src/utils/GuiHelpers.h rename to src/libtomahawk/utils/GuiHelpers.h index f17ccd43c..9fe8f3873 100644 --- a/src/utils/GuiHelpers.h +++ b/src/libtomahawk/utils/GuiHelpers.h @@ -19,6 +19,8 @@ #ifndef TOMAHAWK_GUI_HELPERS_H #define TOMAHAWK_GUI_HELPERS_H +#include "DllMacro.h" + class QWidget; namespace Tomahawk { namespace Accounts { @@ -29,8 +31,8 @@ namespace Tomahawk { namespace TomahawkUtils { - void createAccountFromFactory( Tomahawk::Accounts::AccountFactory*, QWidget* parent ); - void openAccountConfig( Tomahawk::Accounts::Account*, QWidget* parent, bool showDelete = false ); + DLLEXPORT void createAccountFromFactory( Tomahawk::Accounts::AccountFactory*, QWidget* parent ); + DLLEXPORT void openAccountConfig( Tomahawk::Accounts::Account*, QWidget* parent, bool showDelete = false ); } -#endif \ No newline at end of file +#endif