1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-03-21 00:09:47 +01:00

Merge pull request #96 from x8lucas8x/amarokfork

Some changes to make libtomahawk more usable by third-parties
This commit is contained in:
Christian Muehlhaeuser 2012-05-30 01:09:40 -07:00
commit 62f041cc2a
17 changed files with 32 additions and 28 deletions

View File

@ -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)

View File

@ -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

View File

@ -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 <accounts/AccountModelFilterProxy.h>
#include <accounts/ResolverAccount.h>
#include "utils/Logger.h"
#include "AccountFactoryWrapper.h"
#include "accounts/AccountFactoryWrapper.h"
#include "accounts/spotify/SpotifyAccount.h"
#include "ui_ProxyDialog.h"

View File

@ -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 )
Q_EXPORT_PLUGIN2( Tomahawk::Accounts::AccountFactory, Tomahawk::Accounts::ZeroconfFactory )

View File

@ -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;
};
}

View File

@ -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}/.. ..

View File

@ -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 )
{

View File

@ -19,6 +19,7 @@
#ifndef ACCOUNTDELEGATE_H
#define ACCOUNTDELEGATE_H
#include "DllMacro.h"
#include <QStyledItemDelegate>
#include "accounts/AccountModel.h"
@ -31,7 +32,7 @@ namespace Accounts
class Account;
class AccountDelegate : public QStyledItemDelegate
class DLLEXPORT AccountDelegate : public QStyledItemDelegate
{
Q_OBJECT
public:

View File

@ -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"

View File

@ -19,6 +19,8 @@
#ifndef ACCOUNTFACTORYWRAPPER_H
#define ACCOUNTFACTORYWRAPPER_H
#include "DllMacro.h"
#include <QDialog>
#include <QModelIndex>
@ -33,7 +35,7 @@ class Account;
class Ui_AccountFactoryWrapper;
// class AccountFactoryWrapper_
class AccountFactoryWrapper : public QDialog
class DLLEXPORT AccountFactoryWrapper : public QDialog
{
Q_OBJECT
public:

View File

@ -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"
#include "GuiHelpers.moc"

View File

@ -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
#endif