1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-06 06:07:37 +02: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" ) ); m_manager.addProviderFile( QUrl( "http://bakery.tomahawk-player.org:10480/resolvers/providers.xml" ) );
} }
AtticaManager::~AtticaManager()
{
}
Content::List Content::List
AtticaManager::resolvers() const AtticaManager::resolvers() const
{ {
@@ -286,4 +281,4 @@ AtticaManager::removeDirectory( const QString& dir ) const
} }
} }
return !has_err; return !has_err;
} }

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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