A couple of xbus cleanups

* Use function for xbus service name as it is in X-Plane plugin
* Remove unsafe asserts
This commit is contained in:
Michał Garapich
2015-03-11 20:45:01 +01:00
committed by Roland Winklmeier
parent ad8f84e344
commit b3b3f65ee3
2 changed files with 19 additions and 8 deletions

View File

@@ -24,14 +24,16 @@ using namespace BlackMisc::Simulation;
using namespace BlackMisc::Geo;
using namespace BlackSim;
namespace {
inline QString xbusServiceName() {
return QStringLiteral("org.swift.xbus");
}
}
namespace BlackSimPlugin
{
namespace XPlane
{
static inline QString xbusServiceName() {
return QStringLiteral("org.swift.xbus");
}
CSimulatorXPlane::CSimulatorXPlane(IOwnAircraftProvider *ownAircraftProvider, IRemoteAircraftProvider *remoteAircraftProvider, QObject *parent) :
CSimulatorCommon(CSimulatorInfo::XP(), ownAircraftProvider, remoteAircraftProvider, parent)
@@ -232,7 +234,10 @@ namespace BlackSimPlugin
void CSimulatorXPlane::displayStatusMessage(const BlackMisc::CStatusMessage &message) const
{
Q_ASSERT(isConnected());
/* We do not assert here as status message may come because of network problems */
if (!isConnected())
return;
// TODO XPLMSpeakString()?
// http://www.xsquawkbox.net/xpsdk/mediawiki/XPLMSpeakString
Q_UNUSED(message);
@@ -240,7 +245,9 @@ namespace BlackSimPlugin
void CSimulatorXPlane::displayTextMessage(const BlackMisc::Network::CTextMessage &message) const
{
Q_ASSERT(isConnected());
if (!isConnected())
return;
// TODO XPLMSpeakString()?
// http://www.xsquawkbox.net/xpsdk/mediawiki/XPLMSpeakString
Q_UNUSED(message);