1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-03-20 15:59:42 +01:00

Don't crash when running with --headless

This commit is contained in:
Jeff Mitchell 2012-06-19 11:36:48 -04:00
parent f2989dd4d9
commit 3b40b9b4a9
5 changed files with 21 additions and 3 deletions

View File

@ -198,6 +198,8 @@ TomahawkApp::init()
QFontMetrics fm( f );
TomahawkUtils::setHeaderHeight( fm.height() + 8 );
#endif
TomahawkUtils::setHeadless( m_headless );
TomahawkSettings* s = TomahawkSettings::instance();

View File

@ -98,7 +98,7 @@ public:
virtual bool loadUrl( const QString& url );
bool isTomahawkLoaded() const { return m_loaded; }
signals:
void tomahawkLoaded();

View File

@ -170,7 +170,7 @@ ACLRegistry::isAuthorizedUser( const QString& dbid, const QString &username, ACL
#ifdef ENABLE_HEADLESS
user.acl = ACLRegistry::Stream;
#else
else
if ( !TomahawkUtils::headless() )
{
getUserDecision( user, username );
return ACLRegistry::NotFound;

View File

@ -64,7 +64,7 @@ namespace TomahawkUtils
{
static quint64 s_infosystemRequestId = 0;
static QMutex s_infosystemRequestIdMutex;
static bool s_headless = false;
#ifdef Q_WS_MAC
QString
@ -76,6 +76,20 @@ appSupportFolderPath()
#endif // Q_WS_MAC
bool
headless()
{
return s_headless;
}
void
setHeadless( bool headless )
{
s_headless = headless;
}
QString
appFriendlyVersion()
{

View File

@ -87,6 +87,8 @@ namespace TomahawkUtils
QNetworkProxy m_proxy;
};
DLLEXPORT bool headless();
DLLEXPORT void setHeadless( bool headless );
DLLEXPORT QString appFriendlyVersion();