1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-03-16 08:29:15 +01:00

GCS-Fix eventloop on the connect board while loop

This commit is contained in:
PT_Dreamer 2012-10-15 19:39:20 +01:00
parent e78cd29c5f
commit b318861619

View File

@ -446,6 +446,10 @@ bool UploaderGadgetWidget::autoUpdate()
delete dfu;
dfu = NULL;
}
QEventLoop loop;
QTimer timer;
timer.setSingleShot(true);
connect(&timer,SIGNAL(timeout()),&loop,SLOT(quit()));
while(USBMonitor::instance()->availableDevices(0x20a0,-1,-1,-1).length()>0)
{
emit autoUpdateSignal(WAITING_DISCONNECT,QVariant());
@ -454,6 +458,8 @@ bool UploaderGadgetWidget::autoUpdate()
emit autoUpdateSignal(FAILURE,QVariant());
return false;
}
timer.start(500);
loop.exec();
}
emit autoUpdateSignal(WAITING_CONNECT,0);
autoUpdateConnectTimeout=0;