Connect to local portgroup later in the app startup sequence

This allows drone to init itself and wait for connections before we
attempt to connect to it

Fixes #266
This commit is contained in:
Srivats P 2019-02-22 20:34:59 +05:30
parent 00bc01898d
commit 0d1b4be682
2 changed files with 6 additions and 6 deletions

View File

@ -153,6 +153,12 @@ MainWindow::MainWindow(QWidget *parent)
this, SLOT(onNewVersion(QString))); this, SLOT(onNewVersion(QString)));
updater->checkForNewVersion(); updater->checkForNewVersion();
// Add the "Local" Port Group
if (appParams.optLocalDrone()) {
PortGroup *pg = new PortGroup;
pgl->addPortGroup(*pg);
}
if (appParams.argumentCount()) { if (appParams.argumentCount()) {
QString fileName = appParams.argument(0); QString fileName = appParams.argument(0);
if (QFile::exists(fileName)) if (QFile::exists(fileName))

View File

@ -43,12 +43,6 @@ PortGroupList::PortGroupList()
deviceGroupModelTester_ = new ModelTest(getDeviceGroupModel()); deviceGroupModelTester_ = new ModelTest(getDeviceGroupModel());
deviceModelTester_ = new ModelTest(getDeviceModel()); deviceModelTester_ = new ModelTest(getDeviceModel());
#endif #endif
// Add the "Local" Port Group
if (appParams.optLocalDrone()) {
PortGroup *pg = new PortGroup;
addPortGroup(*pg);
}
} }
PortGroupList::~PortGroupList() PortGroupList::~PortGroupList()