Don't add android hosts synchronously in menu popup (it started slowing)

* This was fast before but I started noticing the lag. Instead, we can
  do it asynchronously when polling for remote host status, every few
  seconds. This should still be good enough as people are probably going
  to be used to devices taking a moment to appear.
This commit is contained in:
baldurk
2018-01-10 14:06:07 +00:00
parent 01ee0e32ba
commit dc98914eef
+2 -2
View File
@@ -1380,6 +1380,8 @@ void MainWindow::remoteProbe()
{
if(!m_Ctx.IsCaptureLoaded() && !m_Ctx.IsCaptureLoading())
{
GUIInvoke::call([this] { m_Ctx.Config().AddAndroidHosts(); });
for(RemoteHost *host : m_Ctx.Config().RemoteHosts)
{
// don't mess with a host we're connected to - this is handled anyway
@@ -1463,8 +1465,6 @@ void MainWindow::messageCheck()
void MainWindow::FillRemotesMenu(QMenu *menu, bool includeLocalhost)
{
m_Ctx.Config().AddAndroidHosts();
menu->clear();
for(int i = 0; i < m_Ctx.Config().RemoteHosts.count(); i++)