1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-29 14:52:12 +01:00

Reverted unnecessary changes to configtaskwidget.cpp

This commit is contained in:
Brian Webb 2012-05-19 14:18:29 -07:00
parent 6a7179120d
commit 723f68f763

View File

@ -32,7 +32,7 @@
/** /**
* Constructor * Constructor
*/ */
ConfigTaskWidget::ConfigTaskWidget(QWidget *parent) : QWidget(parent),isConnected(false),smartsave(NULL),dirty(false),outOfLimitsStyle("background-color: rgb(255, 0, 0);") ConfigTaskWidget::ConfigTaskWidget(QWidget *parent) : QWidget(parent),isConnected(false),smartsave(NULL),dirty(false),outOfLimitsStyle("background-color: rgb(255, 0, 0);"),timeOut(NULL)
{ {
pm = ExtensionSystem::PluginManager::instance(); pm = ExtensionSystem::PluginManager::instance();
objManager = pm->getObject<UAVObjectManager>(); objManager = pm->getObject<UAVObjectManager>();
@ -176,6 +176,10 @@ ConfigTaskWidget::~ConfigTaskWidget()
if(oTw) if(oTw)
delete oTw; delete oTw;
} }
if(timeOut)
{
delete timeOut;
}
} }
void ConfigTaskWidget::saveObjectToSD(UAVObject *obj) void ConfigTaskWidget::saveObjectToSD(UAVObject *obj)
@ -781,7 +785,7 @@ void ConfigTaskWidget::reloadButtonClicked()
if(!list) if(!list)
return; return;
ObjectPersistence* objper = dynamic_cast<ObjectPersistence*>( getObjectManager()->getObject(ObjectPersistence::NAME) ); ObjectPersistence* objper = dynamic_cast<ObjectPersistence*>( getObjectManager()->getObject(ObjectPersistence::NAME) );
QTimer * timeOut=new QTimer(this); timeOut=new QTimer(this);
QEventLoop * eventLoop=new QEventLoop(this); QEventLoop * eventLoop=new QEventLoop(this);
connect(timeOut, SIGNAL(timeout()),eventLoop,SLOT(quit())); connect(timeOut, SIGNAL(timeout()),eventLoop,SLOT(quit()));
connect(objper, SIGNAL(objectUpdated(UAVObject*)), eventLoop, SLOT(quit())); connect(objper, SIGNAL(objectUpdated(UAVObject*)), eventLoop, SLOT(quit()));
@ -800,13 +804,22 @@ void ConfigTaskWidget::reloadButtonClicked()
eventLoop->exec(); eventLoop->exec();
if(timeOut->isActive()) if(timeOut->isActive())
{ {
oTw->object->requestUpdate();
setWidgetFromField(oTw->widget,oTw->field,oTw->index,oTw->scale,oTw->isLimited); setWidgetFromField(oTw->widget,oTw->field,oTw->index,oTw->scale,oTw->isLimited);
} }
timeOut->stop(); timeOut->stop();
} }
} }
delete eventLoop; if(eventLoop)
delete timeOut; {
delete eventLoop;
eventLoop=NULL;
}
if(timeOut)
{
delete timeOut;
timeOut=NULL;
}
} }
/** /**
@ -998,7 +1011,6 @@ bool ConfigTaskWidget::setWidgetFromVariant(QWidget *widget, QVariant value, dou
cb->setText(value.toString()); cb->setText(value.toString());
else else
cb->setText(QString::number((value.toDouble()/scale))); cb->setText(QString::number((value.toDouble()/scale)));
return true;
} }
else else
return false; return false;