1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-07-31 19:30:21 +02:00

* Now supports scrobbling in headless mode, too.

This commit is contained in:
Christian Muehlhaeuser
2010-11-14 06:24:51 +01:00
parent 09351e6356
commit c63d9caf85
2 changed files with 13 additions and 12 deletions

View File

@@ -42,16 +42,15 @@ namespace Tomahawk
}
}
#ifndef TOMAHAWK_HEADLESS
class TomahawkWindow;
class PlaylistManager;
#include <QStackedWidget>
#ifndef NO_LIBLASTFM
#include <lastfm/NetworkAccessManager>
#include "scrobbler.h"
#endif
#ifndef TOMAHAWK_HEADLESS
class TomahawkWindow;
class PlaylistManager;
#include <QStackedWidget>
#endif
@@ -130,11 +129,12 @@ private:
QSharedPointer<Jabber> m_jabber;
XMPPBot* m_xmppBot;
#ifndef TOMAHAWK_HEADLESS
TomahawkWindow* m_mainwindow;
#ifndef NO_LIBLASTFM
Scrobbler* m_scrobbler;
#endif
#ifndef TOMAHAWK_HEADLESS
TomahawkWindow* m_mainwindow;
#endif
QMap< QString,boost::function<QSharedPointer<QIODevice>(Tomahawk::result_ptr)> > m_iofactories;

View File

@@ -115,9 +115,10 @@ TomahawkApp::TomahawkApp( int& argc, char *argv[] )
m_mainwindow = 0;
m_headless = arguments().contains( "--headless" );
setWindowIcon( QIcon( RESPATH "icons/tomahawk-icon-128x128.png" ) );
#endif
#ifndef NO_LIBLASTFM
m_scrobbler = 0;
#endif
#endif
qDebug() << "TomahawkApp thread:" << this->thread();
@@ -132,10 +133,6 @@ TomahawkApp::TomahawkApp( int& argc, char *argv[] )
m_audioEngine = new AudioEngine;
setupDatabase();
#ifndef TOMAHAWK_HEADLESS
if ( !m_headless )
{
#ifndef NO_LIBLASTFM
m_scrobbler = new Scrobbler( this );
m_nam = new lastfm::NetworkAccessManager( this );
@@ -155,6 +152,10 @@ TomahawkApp::TomahawkApp( int& argc, char *argv[] )
m_nam = new QNetworkAccessManager;
#endif
#ifndef TOMAHAWK_HEADLESS
if ( !m_headless )
{
m_mainwindow = new TomahawkWindow();
m_mainwindow->show();
connect( m_mainwindow, SIGNAL( settingsChanged() ), SIGNAL( settingsChanged() ) );