mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-05-03 16:25:54 +08:00
Contexts' getRuntime method uses static_cast instead of reinterpret_cast.
This required a few changes in include order and forward declarations to fix the real reason why reinterpret_cast was mistakenly used. refs #81
This commit is contained in:
@@ -1,6 +1,10 @@
|
|||||||
#include "tool.h"
|
#include "tool.h"
|
||||||
#include "blackcore/coreruntime.h"
|
#include "blackcore/coreruntime.h"
|
||||||
|
#include "blackcore/context_network.h"
|
||||||
|
#include "blackcore/context_voice.h"
|
||||||
#include "blackmisc/valuemap.h"
|
#include "blackmisc/valuemap.h"
|
||||||
|
#include "blackmisc/avallclasses.h"
|
||||||
|
#include "blackmisc/pqallquantities.h"
|
||||||
#include <QTextStream>
|
#include <QTextStream>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QFuture>
|
#include <QFuture>
|
||||||
|
|||||||
@@ -6,7 +6,9 @@
|
|||||||
#include "context_network.h"
|
#include "context_network.h"
|
||||||
#include "coreruntime.h"
|
#include "coreruntime.h"
|
||||||
#include "blackmisc/avatcstationlist.h"
|
#include "blackmisc/avatcstationlist.h"
|
||||||
|
#include "context_settings.h"
|
||||||
#include <QtXml/QDomElement>
|
#include <QtXml/QDomElement>
|
||||||
|
#include <QNetworkAccessManager>
|
||||||
|
|
||||||
using namespace BlackMisc;
|
using namespace BlackMisc;
|
||||||
using namespace BlackMisc::PhysicalQuantities;
|
using namespace BlackMisc::PhysicalQuantities;
|
||||||
|
|||||||
@@ -12,6 +12,7 @@
|
|||||||
#include "blackmisc/avallclasses.h"
|
#include "blackmisc/avallclasses.h"
|
||||||
#include "blackmisc/statusmessage.h"
|
#include "blackmisc/statusmessage.h"
|
||||||
#include "blackmisc/statusmessagelist.h"
|
#include "blackmisc/statusmessagelist.h"
|
||||||
|
#include "blackcore/coreruntime.h"
|
||||||
|
|
||||||
class QNetworkAccessManager;
|
class QNetworkAccessManager;
|
||||||
class QNetworkReply;
|
class QNetworkReply;
|
||||||
@@ -20,8 +21,6 @@ class QNetworkReply;
|
|||||||
|
|
||||||
namespace BlackCore
|
namespace BlackCore
|
||||||
{
|
{
|
||||||
class CCoreRuntime;
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Network context
|
* \brief Network context
|
||||||
*/
|
*/
|
||||||
@@ -60,7 +59,7 @@ namespace BlackCore
|
|||||||
*/
|
*/
|
||||||
const CCoreRuntime *getRuntime() const
|
const CCoreRuntime *getRuntime() const
|
||||||
{
|
{
|
||||||
return reinterpret_cast<CCoreRuntime *>(this->parent());
|
return static_cast<CCoreRuntime *>(this->parent());
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
|||||||
@@ -10,6 +10,8 @@
|
|||||||
#include <QMetaEnum>
|
#include <QMetaEnum>
|
||||||
#include <QUrl>
|
#include <QUrl>
|
||||||
#include <QNetworkRequest>
|
#include <QNetworkRequest>
|
||||||
|
#include <QNetworkReply>
|
||||||
|
#include <QNetworkAccessManager>
|
||||||
#include <QXmlStreamReader>
|
#include <QXmlStreamReader>
|
||||||
#include <QtXml/QDomElement>
|
#include <QtXml/QDomElement>
|
||||||
|
|
||||||
|
|||||||
@@ -10,14 +10,13 @@
|
|||||||
#include "blackcore/context_settings_interface.h"
|
#include "blackcore/context_settings_interface.h"
|
||||||
#include "blackmisc/statusmessage.h"
|
#include "blackmisc/statusmessage.h"
|
||||||
#include "blackmisc/statusmessagelist.h"
|
#include "blackmisc/statusmessagelist.h"
|
||||||
|
#include "blackcore/coreruntime.h"
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
|
|
||||||
#define BLACKCORE_CONTEXTSETTINGS_INTERFACENAME "blackcore.contextsettings"
|
#define BLACKCORE_CONTEXTSETTINGS_INTERFACENAME "blackcore.contextsettings"
|
||||||
|
|
||||||
namespace BlackCore
|
namespace BlackCore
|
||||||
{
|
{
|
||||||
class CCoreRuntime;
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Network context
|
* \brief Network context
|
||||||
*/
|
*/
|
||||||
@@ -56,7 +55,7 @@ namespace BlackCore
|
|||||||
*/
|
*/
|
||||||
const CCoreRuntime *getRuntime() const
|
const CCoreRuntime *getRuntime() const
|
||||||
{
|
{
|
||||||
return reinterpret_cast<CCoreRuntime *>(this->parent());
|
return static_cast<CCoreRuntime *>(this->parent());
|
||||||
}
|
}
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
|
|||||||
@@ -13,6 +13,7 @@
|
|||||||
#include "blackmisc/statusmessage.h"
|
#include "blackmisc/statusmessage.h"
|
||||||
#include "blackmisc/statusmessagelist.h"
|
#include "blackmisc/statusmessagelist.h"
|
||||||
#include "blackmisc/nwuserlist.h"
|
#include "blackmisc/nwuserlist.h"
|
||||||
|
#include "blackcore/coreruntime.h"
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QNetworkAccessManager>
|
#include <QNetworkAccessManager>
|
||||||
#include <QNetworkRequest>
|
#include <QNetworkRequest>
|
||||||
@@ -25,8 +26,6 @@
|
|||||||
|
|
||||||
namespace BlackCore
|
namespace BlackCore
|
||||||
{
|
{
|
||||||
class CCoreRuntime;
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Network context
|
* \brief Network context
|
||||||
*/
|
*/
|
||||||
@@ -65,7 +64,7 @@ namespace BlackCore
|
|||||||
*/
|
*/
|
||||||
const CCoreRuntime *getRuntime() const
|
const CCoreRuntime *getRuntime() const
|
||||||
{
|
{
|
||||||
return reinterpret_cast<CCoreRuntime *>(this->parent());
|
return static_cast<CCoreRuntime *>(this->parent());
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
|||||||
@@ -1,6 +1,10 @@
|
|||||||
#include "blackcore/coreruntime.h"
|
#include "blackcore/coreruntime.h"
|
||||||
#include "blackmisc/blackmiscfreefunctions.h"
|
#include "blackmisc/blackmiscfreefunctions.h"
|
||||||
#include "blackmisc/nwserver.h"
|
#include "blackmisc/nwserver.h"
|
||||||
|
#include "blackcore/context_application.h"
|
||||||
|
#include "blackcore/context_network.h"
|
||||||
|
#include "blackcore/context_settings.h"
|
||||||
|
#include "blackcore/context_voice.h"
|
||||||
|
|
||||||
namespace BlackCore
|
namespace BlackCore
|
||||||
{
|
{
|
||||||
@@ -39,4 +43,20 @@ namespace BlackCore
|
|||||||
// flag
|
// flag
|
||||||
m_init = true;
|
m_init = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
IContextNetwork *CCoreRuntime::getIContextNetwork() { return this->m_contextNetwork; }
|
||||||
|
|
||||||
|
const IContextNetwork *CCoreRuntime::getIContextNetwork() const { return this->m_contextNetwork; }
|
||||||
|
|
||||||
|
IContextVoice *CCoreRuntime::getIContextVoice() { return this->m_contextVoice; }
|
||||||
|
|
||||||
|
const IContextVoice *CCoreRuntime::getIContextVoice() const { return this->m_contextVoice; }
|
||||||
|
|
||||||
|
IContextSettings *CCoreRuntime::getIContextSettings() { return this->m_contextSettings; }
|
||||||
|
|
||||||
|
const IContextSettings *CCoreRuntime::getIContextSettings() const { return this->m_contextSettings; }
|
||||||
|
|
||||||
|
const IContextApplication *CCoreRuntime::getIContextApplication() const { return this->m_contextApplication; }
|
||||||
|
|
||||||
|
IContextApplication *CCoreRuntime::getIContextApplication() { return this->m_contextApplication; }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,12 +2,19 @@
|
|||||||
#define BLACKCORE_CORERUNTIME_H
|
#define BLACKCORE_CORERUNTIME_H
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include "dbus_server.h"
|
|
||||||
#include "context_network.h"
|
|
||||||
#include "context_settings.h"
|
|
||||||
|
|
||||||
namespace BlackCore
|
namespace BlackCore
|
||||||
{
|
{
|
||||||
|
class CDBusServer;
|
||||||
|
class CContextNetwork;
|
||||||
|
class CContextVoice;
|
||||||
|
class CContextSettings;
|
||||||
|
class CContextApplication;
|
||||||
|
class IContextNetwork;
|
||||||
|
class IContextVoice;
|
||||||
|
class IContextSettings;
|
||||||
|
class IContextApplication;
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief The CCoreRuntime class
|
* \brief The CCoreRuntime class
|
||||||
*/
|
*/
|
||||||
@@ -19,7 +26,9 @@ namespace BlackCore
|
|||||||
bool m_init; /*!< flag */
|
bool m_init; /*!< flag */
|
||||||
CDBusServer *m_dbusServer;
|
CDBusServer *m_dbusServer;
|
||||||
CContextNetwork *m_contextNetwork;
|
CContextNetwork *m_contextNetwork;
|
||||||
CContextSettings *m_settings;
|
CContextVoice *m_contextVoice;
|
||||||
|
CContextSettings *m_contextSettings;
|
||||||
|
CContextApplication *m_contextApplication;
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Init
|
* \brief Init
|
||||||
@@ -53,37 +62,50 @@ namespace BlackCore
|
|||||||
* \brief Context for network
|
* \brief Context for network
|
||||||
* \return
|
* \return
|
||||||
*/
|
*/
|
||||||
IContextNetwork *getIContextNetwork()
|
IContextNetwork *getIContextNetwork();
|
||||||
{
|
|
||||||
return this->m_contextNetwork;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Context for network
|
* \brief Context for network
|
||||||
* \return
|
* \return
|
||||||
*/
|
*/
|
||||||
const IContextNetwork *getIContextNetwork() const
|
const IContextNetwork *getIContextNetwork() const;
|
||||||
{
|
|
||||||
return this->m_contextNetwork;
|
/*!
|
||||||
}
|
* \brief Context for network
|
||||||
|
* \return
|
||||||
|
*/
|
||||||
|
IContextVoice *getIContextVoice();
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \brief Context for network
|
||||||
|
* \return
|
||||||
|
*/
|
||||||
|
const IContextVoice *getIContextVoice() const;
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Settings
|
* \brief Settings
|
||||||
* \return
|
* \return
|
||||||
*/
|
*/
|
||||||
IContextSettings *getIContextSettings()
|
IContextSettings *getIContextSettings();
|
||||||
{
|
|
||||||
return this->m_settings;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Settings
|
* \brief Settings
|
||||||
* \return
|
* \return
|
||||||
*/
|
*/
|
||||||
const IContextSettings *getIContextSettings() const
|
const IContextSettings *getIContextSettings() const;
|
||||||
{
|
|
||||||
return this->m_settings;
|
/*!
|
||||||
}
|
* \brief Context for application
|
||||||
|
* \return
|
||||||
|
*/
|
||||||
|
const IContextApplication *getIContextApplication() const;
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \brief Application
|
||||||
|
* \return
|
||||||
|
*/
|
||||||
|
IContextApplication *getIContextApplication();
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user