mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-13 17:43:59 +02:00
Prefix HTTP API v1.0 members
This commit is contained in:
committed by
Michael Zanetti
parent
a381c5e3f1
commit
419a3f1cd2
@@ -269,10 +269,10 @@ TomahawkApp::~TomahawkApp()
|
|||||||
{
|
{
|
||||||
tDebug( LOGVERBOSE ) << "Shutting down Tomahawk...";
|
tDebug( LOGVERBOSE ) << "Shutting down Tomahawk...";
|
||||||
|
|
||||||
if ( !m_session.isNull() )
|
if ( !m_httpv1_session.isNull() )
|
||||||
delete m_session.data();
|
delete m_httpv1_session.data();
|
||||||
if ( !m_connector.isNull() )
|
if ( !m_httpv1_connector.isNull() )
|
||||||
delete m_connector.data();
|
delete m_httpv1_connector.data();
|
||||||
|
|
||||||
if ( Pipeline::instance() )
|
if ( Pipeline::instance() )
|
||||||
Pipeline::instance()->stop();
|
Pipeline::instance()->stop();
|
||||||
@@ -468,40 +468,40 @@ TomahawkApp::initHTTP()
|
|||||||
if ( !TomahawkSettings::instance()->httpEnabled() )
|
if ( !TomahawkSettings::instance()->httpEnabled() )
|
||||||
{
|
{
|
||||||
tLog() << "Stopping HTTPd, not enabled";
|
tLog() << "Stopping HTTPd, not enabled";
|
||||||
if ( !m_session.isNull() )
|
if ( !m_httpv1_session.isNull() )
|
||||||
delete m_session.data();
|
delete m_httpv1_session.data();
|
||||||
if ( !m_connector.isNull() )
|
if ( !m_httpv1_connector.isNull() )
|
||||||
delete m_connector.data();
|
delete m_httpv1_connector.data();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( m_session )
|
if ( m_httpv1_session )
|
||||||
{
|
{
|
||||||
tLog() << "HTTPd session already exists, returning";
|
tLog() << "HTTPd session already exists, returning";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_session = QPointer< QxtHttpSessionManager >( new QxtHttpSessionManager() );
|
m_httpv1_session = QPointer< QxtHttpSessionManager >( new QxtHttpSessionManager() );
|
||||||
m_connector = QPointer< QxtHttpServerConnector >( new QxtHttpServerConnector );
|
m_httpv1_connector = QPointer< QxtHttpServerConnector >( new QxtHttpServerConnector );
|
||||||
if ( m_session.isNull() || m_connector.isNull() )
|
if ( m_httpv1_session.isNull() || m_httpv1_connector.isNull() )
|
||||||
{
|
{
|
||||||
if ( !m_session.isNull() )
|
if ( !m_httpv1_session.isNull() )
|
||||||
delete m_session.data();
|
delete m_httpv1_session.data();
|
||||||
if ( !m_connector.isNull() )
|
if ( !m_httpv1_connector.isNull() )
|
||||||
delete m_connector.data();
|
delete m_httpv1_connector.data();
|
||||||
tLog() << "Failed to start HTTPd, could not create object";
|
tLog() << "Failed to start HTTPd, could not create object";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_session.data()->setPort( 60210 ); //TODO config
|
m_httpv1_session.data()->setPort( 60210 ); //TODO config
|
||||||
m_session.data()->setListenInterface( QHostAddress::LocalHost );
|
m_httpv1_session.data()->setListenInterface( QHostAddress::LocalHost );
|
||||||
m_session.data()->setConnector( m_connector.data() );
|
m_httpv1_session.data()->setConnector( m_httpv1_connector.data() );
|
||||||
|
|
||||||
Api_v1* api = new Api_v1( m_session.data() );
|
Api_v1* api = new Api_v1( m_httpv1_session.data() );
|
||||||
m_session.data()->setStaticContentService( api );
|
m_httpv1_session.data()->setStaticContentService( api );
|
||||||
|
|
||||||
tLog() << "Starting HTTPd on" << m_session.data()->listenInterface().toString() << m_session.data()->port();
|
tLog() << "Starting HTTPd on" << m_httpv1_session.data()->listenInterface().toString() << m_httpv1_session.data()->port();
|
||||||
m_session.data()->start();
|
m_httpv1_session.data()->start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -144,8 +144,8 @@ private:
|
|||||||
|
|
||||||
bool m_headless;
|
bool m_headless;
|
||||||
|
|
||||||
QPointer< QxtHttpServerConnector > m_connector;
|
QPointer< QxtHttpServerConnector > m_httpv1_connector;
|
||||||
QPointer< QxtHttpSessionManager > m_session;
|
QPointer< QxtHttpSessionManager > m_httpv1_session;
|
||||||
};
|
};
|
||||||
|
|
||||||
Q_DECLARE_METATYPE( PairList )
|
Q_DECLARE_METATYPE( PairList )
|
||||||
|
Reference in New Issue
Block a user