mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-02 12:20:45 +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 );
|
TomahawkUtils::setHeaderHeight( fm.height() + 8 );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
TomahawkUtils::setHeadless( m_headless );
|
||||||
|
|
||||||
TomahawkSettings* s = TomahawkSettings::instance();
|
TomahawkSettings* s = TomahawkSettings::instance();
|
||||||
|
|
||||||
tDebug( LOGINFO ) << "Setting NAM.";
|
tDebug( LOGINFO ) << "Setting NAM.";
|
||||||
|
@@ -170,7 +170,7 @@ ACLRegistry::isAuthorizedUser( const QString& dbid, const QString &username, ACL
|
|||||||
#ifdef ENABLE_HEADLESS
|
#ifdef ENABLE_HEADLESS
|
||||||
user.acl = ACLRegistry::Stream;
|
user.acl = ACLRegistry::Stream;
|
||||||
#else
|
#else
|
||||||
else
|
if ( !TomahawkUtils::headless() )
|
||||||
{
|
{
|
||||||
getUserDecision( user, username );
|
getUserDecision( user, username );
|
||||||
return ACLRegistry::NotFound;
|
return ACLRegistry::NotFound;
|
||||||
|
@@ -64,7 +64,7 @@ namespace TomahawkUtils
|
|||||||
{
|
{
|
||||||
static quint64 s_infosystemRequestId = 0;
|
static quint64 s_infosystemRequestId = 0;
|
||||||
static QMutex s_infosystemRequestIdMutex;
|
static QMutex s_infosystemRequestIdMutex;
|
||||||
|
static bool s_headless = false;
|
||||||
|
|
||||||
#ifdef Q_WS_MAC
|
#ifdef Q_WS_MAC
|
||||||
QString
|
QString
|
||||||
@@ -76,6 +76,20 @@ appSupportFolderPath()
|
|||||||
#endif // Q_WS_MAC
|
#endif // Q_WS_MAC
|
||||||
|
|
||||||
|
|
||||||
|
bool
|
||||||
|
headless()
|
||||||
|
{
|
||||||
|
return s_headless;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
setHeadless( bool headless )
|
||||||
|
{
|
||||||
|
s_headless = headless;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
QString
|
QString
|
||||||
appFriendlyVersion()
|
appFriendlyVersion()
|
||||||
{
|
{
|
||||||
|
@@ -87,6 +87,8 @@ namespace TomahawkUtils
|
|||||||
QNetworkProxy m_proxy;
|
QNetworkProxy m_proxy;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
DLLEXPORT bool headless();
|
||||||
|
DLLEXPORT void setHeadless( bool headless );
|
||||||
|
|
||||||
DLLEXPORT QString appFriendlyVersion();
|
DLLEXPORT QString appFriendlyVersion();
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user