[xswiftbus] Make xswiftbus completely Qt free

This commit is contained in:
Roland Winklmeier
2018-03-25 16:10:54 +02:00
parent b0a8fcaa45
commit 6a8ae67e06
13 changed files with 525 additions and 429 deletions

View File

@@ -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)