diff --git a/companion/src/eeprominterface.cpp b/companion/src/eeprominterface.cpp index 1200c65a8..144fc24aa 100644 --- a/companion/src/eeprominterface.cpp +++ b/companion/src/eeprominterface.cpp @@ -1055,17 +1055,17 @@ bool GeneralSettings::switchPositionAllowedTaranis(int index) const if (index == 0) return true; SwitchInfo info = switchInfoFromSwitchPositionTaranis(abs(index)); - if (index < 0 && switchConfig[info.index] != GeneralSettings::SWITCH_3POS) + if (index < 0 && switchConfig[info.index] != SWITCH_3POS) return false; else if (info.position == 1) - return switchConfig[info.index] == GeneralSettings::SWITCH_3POS; + return switchConfig[info.index] == SWITCH_3POS; else - return switchConfig[info.index] != GeneralSettings::SWITCH_NONE; + return switchConfig[info.index] != SWITCH_NONE; } bool GeneralSettings::switchSourceAllowedTaranis(int index) const { - return switchConfig[index] != GeneralSettings::SWITCH_NONE; + return switchConfig[index] != SWITCH_NONE; } bool GeneralSettings::isPotAvailable(int index) const diff --git a/companion/src/mdichild.cpp b/companion/src/mdichild.cpp index ce7bdd5a7..2bd71c140 100644 --- a/companion/src/mdichild.cpp +++ b/companion/src/mdichild.cpp @@ -58,7 +58,7 @@ MdiChild::MdiChild(MainWindow * parent): connect(ui->modelsList, SIGNAL(doubleClicked(QModelIndex)), this, SLOT(openModelEditWindow())); connect(ui->modelsList, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(showModelsListContextMenu(const QPoint &))); // connect(ui->modelsList, SIGNAL(currentItemChanged(QTreeWidgetItem *, QTreeWidgetItem *)), this, SLOT(onCurrentItemChanged(QTreeWidgetItem *, QTreeWidgetItem *))); - + ui->modelsList->setContextMenuPolicy(Qt::CustomContextMenu); ui->modelsList->setSelectionBehavior(QAbstractItemView::SelectRows); ui->modelsList->setSelectionMode(QAbstractItemView::ExtendedSelection); @@ -66,7 +66,7 @@ MdiChild::MdiChild(MainWindow * parent): // ui->modelsList->setAcceptDrops(true); // ui->modelsList->setDragDropOverwriteMode(true); // ui->modelsList->setDropIndicatorShown(true); - + if (!(isMaximized() || isMinimized())) { adjustSize(); } @@ -148,7 +148,7 @@ void MdiChild::showModelsListContextMenu(const QPoint & pos) else { return; } - + contextMenu.exec(globalPos); } @@ -190,10 +190,10 @@ void MdiChild::copy() { QByteArray gmData; doCopy(&gmData); - + QMimeData * mimeData = new QMimeData; mimeData->setData("application/x-companion", gmData); - + QClipboard * clipboard = QApplication::clipboard(); clipboard->setMimeData(mimeData, QClipboard::Clipboard); } @@ -220,7 +220,7 @@ void MdiChild::doPaste(QByteArray * gmData, int index) char * gData = gmData->data(); bool modified = false; int size = 0; - + while (size < gmData->size()) { char c = *gData++; size++; @@ -358,7 +358,7 @@ void MdiChild::categoryDelete() if (categoryIndex < 0 || categoryIndex >= (int)radioData.categories.size()) { return; } - + for (unsigned i=0; i= (int)radioData.categories.size()) { return; } - + ModelData model; model.category = categoryIndex; model.used = true; - sprintf(model.filename, "model%lu.bin", radioData.models.size()+1); + sprintf(model.filename, "model%lu.bin", (long unsigned)radioData.models.size()+1); strcpy(model.name, tr("New model").toStdString().c_str()); radioData.models.push_back(model); radioData.setCurrentModel(radioData.models.size() - 1); @@ -539,11 +539,11 @@ bool MdiChild::saveFile(const QString & filename, bool setCurrent) if (IS_SKY9X(board)) { path.replace(".eepe", ".bin"); } - + radioData.fixModelFilenames(); Storage storage(path); bool result = storage.write(radioData); - + if (result && setCurrent) { setCurrentFile(path); } @@ -688,7 +688,7 @@ bool MdiChild::loadBackup() QMessageBox::critical(this, tr("Error"), tr("Unable to find file %1!").arg(fileName)); return false; } - + // TODO int index = getCurrentRow(); int eeprom_size = file.size(); @@ -711,7 +711,7 @@ bool MdiChild::loadBackup() return false; } - + #if 0 std::bitset errorsEeprom((unsigned long long)LoadBackup(radioData, (uint8_t *)eeprom.data(), eeprom_size, index)); if (!errorsEeprom.test(ALL_OK)) {