mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-11 16:44:05 +02:00
Only call X11InitThreads on Qt <4.8
This commit is contained in:
@@ -28,21 +28,19 @@
|
|||||||
|
|
||||||
#include "qca.h"
|
#include "qca.h"
|
||||||
|
|
||||||
#ifdef Q_WS_MAC
|
#ifdef Q_OS_MAC
|
||||||
#include "TomahawkApp_Mac.h"
|
#include "TomahawkApp_Mac.h"
|
||||||
#include </System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/AE.framework/Versions/A/Headers/AppleEvents.h>
|
#include </System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/AE.framework/Versions/A/Headers/AppleEvents.h>
|
||||||
static pascal OSErr appleEventHandler( const AppleEvent*, AppleEvent*, long );
|
static pascal OSErr appleEventHandler( const AppleEvent*, AppleEvent*, long );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef ENABLE_HEADLESS
|
#include "TomahawkSettingsGui.h"
|
||||||
#include "TomahawkSettingsGui.h"
|
#ifdef WITH_CRASHREPORTER
|
||||||
#ifdef WITH_CRASHREPORTER
|
#include "libcrashreporter-handler/Handler.h"
|
||||||
#include "libcrashreporter-handler/Handler.h"
|
#endif
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef Q_WS_X11 // This is probably a very bad idea with Qt5 anyway... because (if at all) X lives in a QPA plugin
|
#if QT_VERSION < QT_VERSION_CHECK( 4, 8, 0 )
|
||||||
#include <X11/Xlib.h>
|
#include <X11/Xlib.h>
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
@@ -133,7 +131,7 @@ main( int argc, char *argv[] )
|
|||||||
QCA::Initializer init;
|
QCA::Initializer init;
|
||||||
Q_UNUSED( init )
|
Q_UNUSED( init )
|
||||||
|
|
||||||
#ifdef Q_WS_MAC
|
#ifdef Q_OS_MAC
|
||||||
// Do Mac specific startup to get media keys working.
|
// Do Mac specific startup to get media keys working.
|
||||||
// This must go before QApplication initialisation.
|
// This must go before QApplication initialisation.
|
||||||
Tomahawk::macMain();
|
Tomahawk::macMain();
|
||||||
@@ -145,11 +143,13 @@ main( int argc, char *argv[] )
|
|||||||
// used for url handler
|
// used for url handler
|
||||||
AEEventHandlerUPP h = AEEventHandlerUPP( appleEventHandler );
|
AEEventHandlerUPP h = AEEventHandlerUPP( appleEventHandler );
|
||||||
AEInstallEventHandler( 'GURL', 'GURL', h, 0, false );
|
AEInstallEventHandler( 'GURL', 'GURL', h, 0, false );
|
||||||
#endif // Q_WS_MAC
|
#endif // Q_OS_MAC
|
||||||
#endif //Q_OS_WIN
|
#endif //Q_OS_WIN
|
||||||
|
|
||||||
#ifdef Q_WS_X11
|
#if QT_VERSION < QT_VERSION_CHECK( 4, 8, 0 )
|
||||||
XInitThreads();
|
XInitThreads();
|
||||||
|
#else
|
||||||
|
QCoreApplication::setAttribute( Qt::AA_X11InitThreads );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
TomahawkApp a( argc, argv );
|
TomahawkApp a( argc, argv );
|
||||||
@@ -164,10 +164,8 @@ main( int argc, char *argv[] )
|
|||||||
new TomahawkSettingsGui( &a );
|
new TomahawkSettingsGui( &a );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef ENABLE_HEADLESS
|
|
||||||
#ifdef WITH_CRASHREPORTER
|
#ifdef WITH_CRASHREPORTER
|
||||||
new CrashReporter::Handler( QDir::tempPath(), TomahawkSettings::instance()->crashReporterEnabled() && !TomahawkUtils::headless(), "tomahawk_crash_reporter" );
|
new CrashReporter::Handler( QDir::tempPath(), TomahawkSettings::instance()->crashReporterEnabled() && !TomahawkUtils::headless(), "tomahawk_crash_reporter" );
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
KDSingleApplicationGuard guard( KDSingleApplicationGuard::AutoKillOtherInstances );
|
KDSingleApplicationGuard guard( KDSingleApplicationGuard::AutoKillOtherInstances );
|
||||||
@@ -195,7 +193,7 @@ main( int argc, char *argv[] )
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#ifdef Q_WS_MAC
|
#ifdef Q_OS_MAC
|
||||||
static pascal OSErr
|
static pascal OSErr
|
||||||
appleEventHandler( const AppleEvent* e, AppleEvent*, long )
|
appleEventHandler( const AppleEvent* e, AppleEvent*, long )
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user