mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-06 14:16:32 +02:00
* Now supports scrobbling in headless mode, too.
This commit is contained in:
@@ -42,16 +42,15 @@ namespace Tomahawk
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef TOMAHAWK_HEADLESS
|
|
||||||
class TomahawkWindow;
|
|
||||||
class PlaylistManager;
|
|
||||||
#include <QStackedWidget>
|
|
||||||
|
|
||||||
#ifndef NO_LIBLASTFM
|
#ifndef NO_LIBLASTFM
|
||||||
#include <lastfm/NetworkAccessManager>
|
#include <lastfm/NetworkAccessManager>
|
||||||
#include "scrobbler.h"
|
#include "scrobbler.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef TOMAHAWK_HEADLESS
|
||||||
|
class TomahawkWindow;
|
||||||
|
class PlaylistManager;
|
||||||
|
#include <QStackedWidget>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
@@ -130,11 +129,12 @@ private:
|
|||||||
QSharedPointer<Jabber> m_jabber;
|
QSharedPointer<Jabber> m_jabber;
|
||||||
XMPPBot* m_xmppBot;
|
XMPPBot* m_xmppBot;
|
||||||
|
|
||||||
#ifndef TOMAHAWK_HEADLESS
|
|
||||||
TomahawkWindow* m_mainwindow;
|
|
||||||
#ifndef NO_LIBLASTFM
|
#ifndef NO_LIBLASTFM
|
||||||
Scrobbler* m_scrobbler;
|
Scrobbler* m_scrobbler;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef TOMAHAWK_HEADLESS
|
||||||
|
TomahawkWindow* m_mainwindow;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
QMap< QString,boost::function<QSharedPointer<QIODevice>(Tomahawk::result_ptr)> > m_iofactories;
|
QMap< QString,boost::function<QSharedPointer<QIODevice>(Tomahawk::result_ptr)> > m_iofactories;
|
||||||
|
@@ -115,9 +115,10 @@ TomahawkApp::TomahawkApp( int& argc, char *argv[] )
|
|||||||
m_mainwindow = 0;
|
m_mainwindow = 0;
|
||||||
m_headless = arguments().contains( "--headless" );
|
m_headless = arguments().contains( "--headless" );
|
||||||
setWindowIcon( QIcon( RESPATH "icons/tomahawk-icon-128x128.png" ) );
|
setWindowIcon( QIcon( RESPATH "icons/tomahawk-icon-128x128.png" ) );
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef NO_LIBLASTFM
|
#ifndef NO_LIBLASTFM
|
||||||
m_scrobbler = 0;
|
m_scrobbler = 0;
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
qDebug() << "TomahawkApp thread:" << this->thread();
|
qDebug() << "TomahawkApp thread:" << this->thread();
|
||||||
@@ -132,10 +133,6 @@ TomahawkApp::TomahawkApp( int& argc, char *argv[] )
|
|||||||
m_audioEngine = new AudioEngine;
|
m_audioEngine = new AudioEngine;
|
||||||
setupDatabase();
|
setupDatabase();
|
||||||
|
|
||||||
#ifndef TOMAHAWK_HEADLESS
|
|
||||||
if ( !m_headless )
|
|
||||||
{
|
|
||||||
|
|
||||||
#ifndef NO_LIBLASTFM
|
#ifndef NO_LIBLASTFM
|
||||||
m_scrobbler = new Scrobbler( this );
|
m_scrobbler = new Scrobbler( this );
|
||||||
m_nam = new lastfm::NetworkAccessManager( this );
|
m_nam = new lastfm::NetworkAccessManager( this );
|
||||||
@@ -155,6 +152,10 @@ TomahawkApp::TomahawkApp( int& argc, char *argv[] )
|
|||||||
m_nam = new QNetworkAccessManager;
|
m_nam = new QNetworkAccessManager;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef TOMAHAWK_HEADLESS
|
||||||
|
if ( !m_headless )
|
||||||
|
{
|
||||||
|
|
||||||
m_mainwindow = new TomahawkWindow();
|
m_mainwindow = new TomahawkWindow();
|
||||||
m_mainwindow->show();
|
m_mainwindow->show();
|
||||||
connect( m_mainwindow, SIGNAL( settingsChanged() ), SIGNAL( settingsChanged() ) );
|
connect( m_mainwindow, SIGNAL( settingsChanged() ), SIGNAL( settingsChanged() ) );
|
||||||
|
Reference in New Issue
Block a user