Ref T739, make member of CAfvClient a "pointer"

* we can use forward declaration for m_voiceClient
* make IContextAudio -> BlackMisc::CIdentifiable
* removed delayedInitMicrophone, RR will move it to another place
This commit is contained in:
Klaus Basan
2019-10-09 14:56:04 +02:00
committed by Mat Sutcliffe
parent 3bf4eda702
commit ff33b59683
6 changed files with 89 additions and 84 deletions

View File

@@ -13,8 +13,8 @@
#include "afvmapdialog.h"
#include "ui_afvmapdialog.h"
//#include <QQmlContext>
//#include <QQmlEngine>
// #include <QQmlContext>
// #include <QQmlEngine>
using namespace BlackCore::Afv::Model;
using namespace BlackCore::Afv::Clients;
@@ -27,28 +27,31 @@ namespace BlackGui
QDialog(parent),
ui(new Ui::CAfvMapDialog)
{
/**
m_afvMapReader = new CAfvMapReader(this);
m_afvMapReader->updateFromMap();
// if (sGui && !sGui->isShuttingDown() && sGui->getIContextAudio())
// {
// if (sGui->getIContextAudio()->isUsingImplementingObject())
// {
// m_afvClient = &sGui->getCoreFacade()->getCContextAudio()->voiceClient();
// }
// }
CAfvClient *afvClient = nullptr;
if (sGui && !sGui->isShuttingDown() && sGui->getIContextAudio())
{
if (sGui->getIContextAudio()->isUsingImplementingObject())
{
afvClient = sGui->getCoreFacade()->getCContextAudio()->voiceClient();
}
}
ui->setupUi(this);
// QQmlContext *ctxt = ui->qw_AfvMap->rootContext();
// ctxt->setContextProperty("afvMapReader", m_afvMapReader);
QQmlContext *ctxt = ui->qw_AfvMap->rootContext();
ctxt->setContextProperty("afvMapReader", m_afvMapReader);
// if (m_afvClient)
// {
// ctxt->setContextProperty("voiceClient", m_afvClient);
// }
if (m_afvClient)
{
ctxt->setContextProperty("voiceClient", afvClient);
}
// // ui->qw_AfvMap->engine()->setBaseUrl(":/blackgui/qml");
// ui->qw_AfvMap->setSource(QUrl("qrc:/blackgui/qml/AFVMap.qml"));
// ui->qw_AfvMap->engine()->setBaseUrl(":/blackgui/qml");
ui->qw_AfvMap->setSource(QUrl("qrc:/blackgui/qml/AFVMap.qml"));
**/
}
CAfvMapDialog::~CAfvMapDialog() { }

View File

@@ -43,7 +43,7 @@ namespace BlackGui
private:
QScopedPointer<Ui::CAfvMapDialog> ui;
BlackCore::Afv::Model::CAfvMapReader *m_afvMapReader = nullptr;
BlackCore::Afv::Clients::CAfvClient *m_afvClient = nullptr;
BlackCore::Afv::Clients::CAfvClient *m_afvClient = nullptr;
};
} // ns
} // ns