mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2024-12-02 10:24:11 +01:00
OP-1222 Uncrustified code.
This commit is contained in:
parent
b0e337c540
commit
8d76e6f671
@ -162,6 +162,7 @@ void AirframeInitialTuningPage::loadValidFiles()
|
|||||||
QStringList files = templateDir.entryList();
|
QStringList files = templateDir.entryList();
|
||||||
foreach(QString fileName, files) {
|
foreach(QString fileName, files) {
|
||||||
QFile file(QString("%1/%2").arg(templateDir.absolutePath()).arg(fileName));
|
QFile file(QString("%1/%2").arg(templateDir.absolutePath()).arg(fileName));
|
||||||
|
|
||||||
if (file.open(QFile::ReadOnly)) {
|
if (file.open(QFile::ReadOnly)) {
|
||||||
QByteArray jsonData = file.readAll();
|
QByteArray jsonData = file.readAll();
|
||||||
QJsonDocument templateDoc = QJsonDocument::fromJson(jsonData);
|
QJsonDocument templateDoc = QJsonDocument::fromJson(jsonData);
|
||||||
@ -185,6 +186,7 @@ void AirframeInitialTuningPage::setupTemplateList()
|
|||||||
item->setData(Qt::UserRole + 1, QVariant::fromValue((QJsonObject *)NULL));
|
item->setData(Qt::UserRole + 1, QVariant::fromValue((QJsonObject *)NULL));
|
||||||
foreach(QString templ, m_templates.keys()) {
|
foreach(QString templ, m_templates.keys()) {
|
||||||
QJsonObject *json = m_templates[templ];
|
QJsonObject *json = m_templates[templ];
|
||||||
|
|
||||||
item = new QListWidgetItem(json->value("name").toString(), ui->templateList);
|
item = new QListWidgetItem(json->value("name").toString(), ui->templateList);
|
||||||
item->setData(Qt::UserRole + 1, QVariant::fromValue(json));
|
item->setData(Qt::UserRole + 1, QVariant::fromValue(json));
|
||||||
}
|
}
|
||||||
|
@ -753,11 +753,12 @@ void VehicleConfigurationHelper::applyManualControlDefaults()
|
|||||||
void VehicleConfigurationHelper::applyTemplateSettings()
|
void VehicleConfigurationHelper::applyTemplateSettings()
|
||||||
{
|
{
|
||||||
if (m_configSource->getVehicleTemplate() != NULL) {
|
if (m_configSource->getVehicleTemplate() != NULL) {
|
||||||
QJsonObject* json = m_configSource->getVehicleTemplate();
|
QJsonObject *json = m_configSource->getVehicleTemplate();
|
||||||
QList<UAVObject*> updatedObjects;
|
QList<UAVObject *> updatedObjects;
|
||||||
m_uavoManager->fromJson(*json, &updatedObjects);
|
m_uavoManager->fromJson(*json, &updatedObjects);
|
||||||
foreach (UAVObject* object, updatedObjects) {
|
foreach(UAVObject * object, updatedObjects) {
|
||||||
UAVDataObject *dataObj = dynamic_cast<UAVDataObject*>(object);
|
UAVDataObject *dataObj = dynamic_cast<UAVDataObject *>(object);
|
||||||
|
|
||||||
if (dataObj != NULL) {
|
if (dataObj != NULL) {
|
||||||
addModifiedObject(dataObj, QString(tr("Writing template settings for %1")).arg(object->getName()));
|
addModifiedObject(dataObj, QString(tr("Writing template settings for %1")).arg(object->getName()));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user