mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-04 08:36:52 +08:00
Updating IContext to our current style and making it less reliant on macros.
Updating code that uses IContext to a more conformant pattern of usage.
This commit is contained in:
@@ -6,9 +6,9 @@
|
||||
#include "atclistmgr.h"
|
||||
#include "network.h"
|
||||
|
||||
BlackCore::CAtcListManager::CAtcListManager()
|
||||
BlackCore::CAtcListManager::CAtcListManager(BlackMisc::IContext &ctx)
|
||||
{
|
||||
INetwork *net = BlackMisc::IContext::getInstance().singleton<INetwork>();
|
||||
INetwork *net = &ctx.getObject<INetwork>();
|
||||
|
||||
connect(net, &INetwork::atcPositionUpdate, this, &CAtcListManager::update, Qt::QueuedConnection);
|
||||
connect(net, &INetwork::atcDisconnected, this, &CAtcListManager::remove, Qt::QueuedConnection);
|
||||
|
||||
@@ -25,8 +25,6 @@ namespace BlackCore
|
||||
Q_PROPERTY(BlackMisc::CAtcList list READ getList NOTIFY listChanged)
|
||||
|
||||
public:
|
||||
BLACK_INTERFACE(BlackCore::IAtcListManager)
|
||||
|
||||
/*!
|
||||
* Virtual destructor.
|
||||
*/
|
||||
@@ -49,7 +47,7 @@ namespace BlackCore
|
||||
/*!
|
||||
* Concrete ATC list manager. Implementation of IAtcListManager.
|
||||
*
|
||||
* Has a dependency on INetwork. An INetwork must be available through the IContext singleton.
|
||||
* Has a dependency on INetwork. An INetwork must be available through the IContext.
|
||||
*/
|
||||
class CAtcListManager : public IAtcListManager
|
||||
{
|
||||
@@ -58,8 +56,9 @@ namespace BlackCore
|
||||
public:
|
||||
/*!
|
||||
* Constructor.
|
||||
* \param context
|
||||
*/
|
||||
CAtcListManager();
|
||||
CAtcListManager(BlackMisc::IContext &context);
|
||||
|
||||
virtual const BlackMisc::CAtcList& getList() const { return m_list; }
|
||||
|
||||
|
||||
@@ -34,8 +34,6 @@ namespace BlackCore
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
BLACK_INTERFACE(BlackCore::INetwork)
|
||||
|
||||
virtual ~INetwork() {}
|
||||
|
||||
enum
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
#include "blackcore/simulator.h"
|
||||
#include "blackmisc/debug.h"
|
||||
|
||||
#include "blackmisc/context.h"
|
||||
#include <QtGlobal>
|
||||
#include <QLibrary>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user