From fdde364307558d697c8a5b808ad89283db46e6f6 Mon Sep 17 00:00:00 2001 From: bsongis Date: Tue, 27 May 2014 15:17:15 +0200 Subject: [PATCH] Refactoring --- companion/src/apppreferencesdialog.cpp | 10 ++++---- companion/src/avroutputdialog.cpp | 2 +- companion/src/eeprominterface.cpp | 23 ++++++++++++++++++- companion/src/eeprominterface.h | 18 +++++++++++---- .../src/firmwares/opentx/opentxinterface.h | 4 ++-- companion/src/googleanalytics.h | 2 +- companion/src/mainwindow.cpp | 6 ++--- companion/src/mdichild.cpp | 4 ++-- companion/src/printdialog.cpp | 2 +- companion/src/simulation/simulatordialog.cpp | 7 ++---- companion/src/simulation/simulatordialog.h | 1 - 11 files changed, 53 insertions(+), 26 deletions(-) diff --git a/companion/src/apppreferencesdialog.cpp b/companion/src/apppreferencesdialog.cpp index dfbdefbac..485029775 100644 --- a/companion/src/apppreferencesdialog.cpp +++ b/companion/src/apppreferencesdialog.cpp @@ -188,7 +188,7 @@ void AppPreferencesDialog::initSettings() FirmwareInterface * current_firmware = GetCurrentFirmware(); foreach(FirmwareInterface * firmware, firmwares) { - ui->downloadVerCB->addItem(firmware->name, firmware->id); + ui->downloadVerCB->addItem(firmware->getName(), firmware->getId()); if (current_firmware == firmware) { ui->downloadVerCB->setCurrentIndex(ui->downloadVerCB->count() - 1); } @@ -366,7 +366,7 @@ void AppPreferencesDialog::baseFirmwareChanged() QVariant selected_firmware = ui->downloadVerCB->itemData(ui->downloadVerCB->currentIndex()); voice=NULL; foreach(FirmwareInterface * firmware, firmwares) { - if (firmware->id == selected_firmware) { + if (firmware->getId() == selected_firmware) { showVoice(firmware->voice); populateFirmwareOptions(firmware); break; @@ -380,8 +380,8 @@ FirmwareVariant AppPreferencesDialog::getFirmwareVariant() QVariant selected_firmware = ui->downloadVerCB->itemData(ui->downloadVerCB->currentIndex()); bool voice=false; foreach(FirmwareInterface * firmware, firmwares) { - if (firmware->id == selected_firmware) { - QString id = firmware->id; + QString id = firmware->getId(); + if (id == selected_firmware) { foreach(QCheckBox *cb, optionsCheckBoxes) { if (cb->isChecked()) { if (cb->text()=="voice" && cb->isChecked()) @@ -414,7 +414,7 @@ void AppPreferencesDialog::firmwareOptionChanged(bool state) if (cb && state) { QVariant selected_firmware = ui->downloadVerCB->itemData(ui->downloadVerCB->currentIndex()); foreach(firmware, firmwares) { - if (firmware->id == selected_firmware) { + if (firmware->getId() == selected_firmware) { foreach(QList