mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-03 07:35:48 +08:00
[xswiftbus] Make xswiftbus completely Qt free
This commit is contained in:
@@ -20,17 +20,6 @@
|
||||
#define XPLM_MSG_LIVERY_LOADED 108
|
||||
#endif
|
||||
|
||||
// Change QSharedPointer<QCoreApplication> to QSharedPointer<QApplication> below
|
||||
// in case you want to have Qt Gui components inside a X-Plane plugin. The current
|
||||
// default was used since QApplication causes an infinite loop in X-Plane on MacOS
|
||||
// platforms. X-Plane is allocating an NSApplication but never calling run(), rather
|
||||
// it controls the main loop itself and pumps the event Q as needed. This causes
|
||||
// unusual start conditions for QCocoaEventDispatcher and ends up in the infinite
|
||||
// loop. Since QCoreApplication is not using QCocoaEventDispatcher it works fine
|
||||
// and is used as a workaround.
|
||||
// See https://dev.vatsim-germany.org/issues/293 for more information.
|
||||
|
||||
QSharedPointer<QCoreApplication> g_qApp;
|
||||
XSwiftBus::CPlugin *g_plugin;
|
||||
|
||||
PLUGIN_API int XPluginStart(char *o_name, char *o_sig, char *o_desc)
|
||||
@@ -54,10 +43,6 @@ PLUGIN_API void XPluginStop()
|
||||
|
||||
PLUGIN_API int XPluginEnable()
|
||||
{
|
||||
QXPlaneMessageHandler::install();
|
||||
g_qApp = QSharedApplication::sharedInstance();
|
||||
QXPlaneEventLoop::exec();
|
||||
|
||||
g_plugin = new XSwiftBus::CPlugin;
|
||||
return 1;
|
||||
}
|
||||
@@ -65,7 +50,6 @@ PLUGIN_API int XPluginEnable()
|
||||
PLUGIN_API void XPluginDisable()
|
||||
{
|
||||
delete g_plugin;
|
||||
g_qApp.reset();
|
||||
}
|
||||
|
||||
PLUGIN_API void XPluginReceiveMessage(XPLMPluginID from, long msg, void *param)
|
||||
|
||||
Reference in New Issue
Block a user