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

make compile without attica

This commit is contained in:
Leo Franchi 2011-09-09 17:03:49 -04:00
parent 3a7cab851d
commit c6259d2feb
7 changed files with 29 additions and 22 deletions

View File

@ -43,11 +43,6 @@ AtticaManager::AtticaManager( QObject* parent )
m_manager.addProviderFile( QUrl( "http://bakery.tomahawk-player.org:10480/resolvers/providers.xml" ) );
}
AtticaManager::~AtticaManager()
{
}
Content::List
AtticaManager::resolvers() const
{
@ -286,4 +281,4 @@ AtticaManager::removeDirectory( const QString& dir ) const
}
}
return !has_err;
}
}

View File

@ -20,10 +20,13 @@
#define ATTICAMANAGER_H
#include <QObject>
#include <QHash>
#ifdef LIBATTICA_FOUND
#include <attica/provider.h>
#include <attica/providermanager.h>
#include <attica/content.h>
#endif
class AtticaManager : public QObject
{
@ -48,8 +51,9 @@ public:
}
explicit AtticaManager ( QObject* parent = 0 );
virtual ~AtticaManager();
virtual ~AtticaManager() {}
#ifdef LIBATTICA_FOUND
bool resolversLoaded() const;
Attica::Content::List resolvers() const;
@ -81,6 +85,7 @@ private:
Attica::Provider m_resolverProvider;
Attica::Content::List m_resolvers;
StateHash m_resolverStates;
#endif
static AtticaManager* s_instance;
};

View File

@ -78,11 +78,6 @@ SET( tomahawkSourcesGui ${tomahawkSourcesGui}
settingslistdelegate.cpp
resolversmodel.cpp
tomahawkwindow.cpp
GetNewStuffDialog.cpp
GetNewStuffDelegate.cpp
GetNewStuffModel.cpp
AtticaManager.cpp
)
SET( tomahawkHeaders ${tomahawkHeaders}
@ -132,9 +127,6 @@ SET( tomahawkHeadersGui ${tomahawkHeadersGui}
delegateconfigwrapper.h
tomahawkwindow.h
GetNewStuffDialog.h
GetNewStuffDelegate.h
GetNewStuffModel.h
AtticaManager.h
)
@ -208,6 +200,8 @@ IF(QCA2_FOUND)
ENDIF(QCA2_FOUND)
IF(LIBATTICA_FOUND)
SET( tomahawkSources ${tomahawkSources} AtticaManager.cpp GetNewStuffDialog.cpp GetNewStuffDelegate.cpp GetNewStuffModel.cpp )
SET( tomahawkHeaders ${tomahawkHeaders} GetNewStuffDialog.h GetNewStuffDelegate.h GetNewStuffModel.h )
INCLUDE_DIRECTORIES( ${LIBATTICA_INCLUDE_DIR} )
ENDIF(LIBATTICA_FOUND)

View File

@ -18,5 +18,6 @@
#cmakedefine LIBLASTFM_FOUND
#cmakedefine GLOOX_FOUND
#cmakedefine QCA2_FOUND
#cmakedefine LIBATTICA_FOUND
#endif // CONFIG_H_IN

View File

@ -191,13 +191,18 @@ SettingsDialog::SettingsDialog( QWidget *parent )
m_resolversModel = new ResolversModel( s->allScriptResolvers(), s->enabledScriptResolvers(), this );
ui->scriptList->setModel( m_resolversModel );
#ifdef LIBATTICA_FOUND
connect( ui->getMoreResolvers, SIGNAL( clicked() ), this, SLOT( getMoreResolvers() ) );
connect( AtticaManager::instance(), SIGNAL( resolverInstalled( QString ) ), this, SLOT( atticaResolverInstalled( QString ) ) );
connect( AtticaManager::instance(), SIGNAL( resolverUninstalled( QString ) ), this, SLOT( atticaResolverUninstalled( QString ) ) );
#else
ui->getMoreResolvers->hide();
#endif
connect( ui->scriptList->selectionModel(), SIGNAL( selectionChanged( QItemSelection,QItemSelection ) ), this, SLOT( scriptSelectionChanged() ) );
connect( ui->addScript, SIGNAL( clicked( bool ) ), this, SLOT( addScriptResolver() ) );
connect( ui->removeScript, SIGNAL( clicked( bool ) ), this, SLOT( removeScriptResolver() ) );
connect( AtticaManager::instance(), SIGNAL( resolverInstalled( QString ) ), this, SLOT( atticaResolverInstalled( QString ) ) );
connect( AtticaManager::instance(), SIGNAL( resolverUninstalled( QString ) ), this, SLOT( atticaResolverUninstalled( QString ) ) );
connect( ui->buttonBrowse_2, SIGNAL( clicked() ), SLOT( showPathSelector() ) );
connect( ui->proxyButton, SIGNAL( clicked() ), SLOT( showProxySettings() ) );
connect( ui->checkBoxStaticPreferred, SIGNAL( toggled(bool) ), SLOT( toggleUpnp(bool) ) );
@ -546,18 +551,19 @@ SettingsDialog::removeScriptResolver()
void
SettingsDialog::getMoreResolvers()
{
#ifdef Q_OS_MAC
#if defined(Q_WS_MAC) && defined(LIBATTICA_FOUND)
GetNewStuffDialog* diag = new GetNewStuffDialog( this, Qt::Sheet );
connect( diag, SIGNAL( finished( int ) ), this, SLOT( getMoreResolversFinished(int)));
diag->show();
#else
#elif defined(LIBATTICA_FOUND)
GetNewStuffDialog diag( this );
int ret = diag.exec();
#endif
}
#ifdef LIBATTICA_FOUND
void
SettingsDialog::atticaResolverInstalled( const QString& resolverId )
{
@ -569,7 +575,7 @@ SettingsDialog::atticaResolverUninstalled ( const QString& resolverId )
{
m_resolversModel->removeResolver( AtticaManager::instance()->pathFromId( resolverId ) );
}
#endif
void
SettingsDialog::scriptSelectionChanged()

View File

@ -86,8 +86,10 @@ private slots:
void removeScriptResolver();
void getMoreResolvers();
void getMoreResolversFinished( int );
#ifdef LIBATTICA_FOUND
void atticaResolverInstalled( const QString& );
void atticaResolverUninstalled( const QString& );
#endif
void openResolverConfig( const QString& );
void sipItemClicked ( const QModelIndex& );

View File

@ -232,8 +232,10 @@ TomahawkApp::init()
tDebug() << "Init Pipeline.";
initPipeline();
#ifdef LIBATTICA_FOUND
// load remote list of resolvers able to be installed
AtticaManager::instance();
#endif
if ( arguments().contains( "--http" ) || TomahawkSettings::instance()->value( "network/http", true ).toBool() )
{
@ -279,7 +281,9 @@ TomahawkApp::~TomahawkApp()
delete m_mainwindow;
#endif
#ifdef LIBATTICA_FOUND
delete AtticaManager::instance();
#endif
if ( !m_audioEngine.isNull() )
delete m_audioEngine.data();