From 0d1b4be6823a545f4094bc0c7b5dfaca452dbc51 Mon Sep 17 00:00:00 2001 From: Srivats P Date: Fri, 22 Feb 2019 20:34:59 +0530 Subject: [PATCH] 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 --- client/mainwindow.cpp | 6 ++++++ client/portgrouplist.cpp | 6 ------ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/client/mainwindow.cpp b/client/mainwindow.cpp index da375e0..cd2ee27 100644 --- a/client/mainwindow.cpp +++ b/client/mainwindow.cpp @@ -153,6 +153,12 @@ MainWindow::MainWindow(QWidget *parent) this, SLOT(onNewVersion(QString))); updater->checkForNewVersion(); + // Add the "Local" Port Group + if (appParams.optLocalDrone()) { + PortGroup *pg = new PortGroup; + pgl->addPortGroup(*pg); + } + if (appParams.argumentCount()) { QString fileName = appParams.argument(0); if (QFile::exists(fileName)) diff --git a/client/portgrouplist.cpp b/client/portgrouplist.cpp index 4b388e2..3e41365 100644 --- a/client/portgrouplist.cpp +++ b/client/portgrouplist.cpp @@ -43,12 +43,6 @@ PortGroupList::PortGroupList() deviceGroupModelTester_ = new ModelTest(getDeviceGroupModel()); deviceModelTester_ = new ModelTest(getDeviceModel()); #endif - - // Add the "Local" Port Group - if (appParams.optLocalDrone()) { - PortGroup *pg = new PortGroup; - addPortGroup(*pg); - } } PortGroupList::~PortGroupList()