mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-01 03:40:16 +02:00
Don't crash when running with --headless
This commit is contained in:
@@ -199,6 +199,8 @@ TomahawkApp::init()
|
||||
TomahawkUtils::setHeaderHeight( fm.height() + 8 );
|
||||
#endif
|
||||
|
||||
TomahawkUtils::setHeadless( m_headless );
|
||||
|
||||
TomahawkSettings* s = TomahawkSettings::instance();
|
||||
|
||||
tDebug( LOGINFO ) << "Setting NAM.";
|
||||
|
@@ -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;
|
||||
|
@@ -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()
|
||||
{
|
||||
|
@@ -87,6 +87,8 @@ namespace TomahawkUtils
|
||||
QNetworkProxy m_proxy;
|
||||
};
|
||||
|
||||
DLLEXPORT bool headless();
|
||||
DLLEXPORT void setHeadless( bool headless );
|
||||
|
||||
DLLEXPORT QString appFriendlyVersion();
|
||||
|
||||
|
Reference in New Issue
Block a user