1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-08 23:26:40 +02:00

* Cleanly shutdown database again. General TomahawkApp cleanup.

This commit is contained in:
Christian Muehlhaeuser
2011-01-23 05:00:06 +01:00
parent 0acb83a778
commit 4ec5871f25
2 changed files with 8 additions and 10 deletions

View File

@@ -40,8 +40,6 @@ namespace Tomahawk
#ifndef TOMAHAWK_HEADLESS #ifndef TOMAHAWK_HEADLESS
class TomahawkWindow; class TomahawkWindow;
class PlaylistManager;
#include <QStackedWidget>
#endif #endif
@@ -85,6 +83,7 @@ private:
QList<Tomahawk::collection_ptr> m_collections; QList<Tomahawk::collection_ptr> m_collections;
QList<TomahawkPlugin*> m_plugins; QList<TomahawkPlugin*> m_plugins;
Database* m_database;
AudioEngine* m_audioEngine; AudioEngine* m_audioEngine;
SipHandler* m_sipHandler; SipHandler* m_sipHandler;
Servent* m_servent; Servent* m_servent;

View File

@@ -114,15 +114,11 @@ TomahawkApp::TomahawkApp( int& argc, char *argv[] )
setWindowIcon( QIcon( RESPATH "icons/tomahawk-icon-128x128.png" ) ); setWindowIcon( QIcon( RESPATH "icons/tomahawk-icon-128x128.png" ) );
#endif #endif
#ifndef NO_LIBLASTFM
m_scrobbler = 0;
#endif
qDebug() << "TomahawkApp thread:" << this->thread(); qDebug() << "TomahawkApp thread:" << this->thread();
setOrganizationName( "Tomahawk" ); setOrganizationName( "Tomahawk" );
setOrganizationDomain( "tomahawk.org" ); setOrganizationDomain( "tomahawk.org" );
setApplicationName( "Player" ); setApplicationName( "Player" );
setApplicationVersion( "1.0" ); // FIXME: last.fm "tst" auth requires 1.0 version according to docs, will change when we get our own identifier setApplicationVersion( "0.0.0" );
registerMetaTypes(); registerMetaTypes();
setupLogfile(); setupLogfile();
@@ -157,7 +153,8 @@ TomahawkApp::TomahawkApp( int& argc, char *argv[] )
#endif #endif
// Set up proxy // Set up proxy
if( TomahawkSettings::instance()->proxyType() != QNetworkProxy::NoProxy && !TomahawkSettings::instance()->proxyHost().isEmpty() ) if( TomahawkSettings::instance()->proxyType() != QNetworkProxy::NoProxy &&
!TomahawkSettings::instance()->proxyHost().isEmpty() )
{ {
qDebug() << "Setting proxy to saved values"; qDebug() << "Setting proxy to saved values";
TomahawkUtils::setProxy( new QNetworkProxy( static_cast<QNetworkProxy::ProxyType>(TomahawkSettings::instance()->proxyType()), TomahawkSettings::instance()->proxyHost(), TomahawkSettings::instance()->proxyPort(), TomahawkSettings::instance()->proxyUsername(), TomahawkSettings::instance()->proxyPassword() ) ); TomahawkUtils::setProxy( new QNetworkProxy( static_cast<QNetworkProxy::ProxyType>(TomahawkSettings::instance()->proxyType()), TomahawkSettings::instance()->proxyHost(), TomahawkSettings::instance()->proxyPort(), TomahawkSettings::instance()->proxyUsername(), TomahawkSettings::instance()->proxyPassword() ) );
@@ -211,6 +208,8 @@ TomahawkApp::~TomahawkApp()
delete m_mainwindow; delete m_mainwindow;
delete m_audioEngine; delete m_audioEngine;
#endif #endif
delete m_database;
} }
@@ -282,7 +281,7 @@ TomahawkApp::setupDatabase()
} }
qDebug() << "Using database:" << dbpath; qDebug() << "Using database:" << dbpath;
new Database( dbpath, this ); m_database = new Database( dbpath, this );
Pipeline::instance()->databaseReady(); Pipeline::instance()->databaseReady();
} }
@@ -391,7 +390,7 @@ TomahawkApp::setupSIP()
m_xmppBot = new XMPPBot( this ); m_xmppBot = new XMPPBot( this );
m_sipHandler->connect(); m_sipHandler->connect();
// m_sipHandler->setProxy( m_proxy ); // m_sipHandler->setProxy( *TomahawkUtils::proxy() );
} }
} }