mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-08-07 01:55:53 +08:00
Removed IContext
Network and voice samples work using them and have to allocate their own vatlib objects now. refs #221
This commit is contained in:
@@ -4,12 +4,12 @@
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "client.h"
|
||||
#include "blackmisc/context.h"
|
||||
#include "blackcore/network_vatlib.h"
|
||||
#include <iostream>
|
||||
#include <QStringList>
|
||||
|
||||
Client::Client(BlackMisc::IContext &ctx)
|
||||
: m_net(&ctx.getObject<BlackCore::INetwork>())
|
||||
Client::Client(QObject *parent)
|
||||
: QObject(parent), m_net(new BlackCore::CNetworkVatlib(this))
|
||||
{
|
||||
using namespace BlackCore;
|
||||
connect(m_net, &INetwork::atcPositionUpdate, this, &Client::atcPositionUpdate);
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
#define __BLACKSAMPLE_CLI_CLIENT_H__
|
||||
|
||||
#include "blackcore/network.h"
|
||||
#include "blackmisc/context.h"
|
||||
#include <QObject>
|
||||
#include <QTextStream>
|
||||
#include <QMap>
|
||||
@@ -18,7 +17,7 @@ class Client : public QObject
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
Client(BlackMisc::IContext &);
|
||||
Client(QObject *parent = nullptr);
|
||||
|
||||
signals:
|
||||
void quit();
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "blackcore/network_vatlib.h"
|
||||
#include "blackmisc/context.h"
|
||||
#include "client.h"
|
||||
#include "reader.h"
|
||||
#include <QCoreApplication>
|
||||
@@ -14,12 +13,7 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
QCoreApplication app (argc, argv);
|
||||
|
||||
BlackMisc::CApplicationContext ctx;
|
||||
BlackMisc::IContext::setInstance(ctx);
|
||||
BlackCore::CNetworkVatlib net;
|
||||
ctx.setObject<BlackCore::INetwork>(net);
|
||||
|
||||
Client client(ctx);
|
||||
Client client(&app);
|
||||
LineReader reader;
|
||||
QObject::connect(&reader, SIGNAL(command(const QString&)), &client, SLOT(command(const QString&)));
|
||||
QObject::connect(&client, SIGNAL(quit()), &reader, SLOT(terminate()));
|
||||
|
||||
Reference in New Issue
Block a user