Bsongis/issue 4400 (#4425)

* Cosmetics before fixing #4400

* Cosmetics before fixing #4400

* Now one more conversion issue (SF => SH sources conversion from X9D to X7)

I don't know what is exactly the conversion issue as I don't have the original EEPROM, but I used this one for my tests, so I fix it

* Now we display correctly the corrupted mixers list so that copy/paste will work correctly (it was not consistent)

+ some cosmetics

* Test removed too quickly

* One global removed ;)
This commit is contained in:
Bertrand Songis
2017-02-10 17:17:52 +01:00
committed by GitHub
parent 4d16e8391e
commit 70cfbbd646
22 changed files with 1020 additions and 961 deletions
+1
View File
@@ -60,6 +60,7 @@ bool BinEepromFormat::write(const RadioData & radioData)
result = writeToFile(eeprom, eeprom_size);
}
else {
// TODO here we could call setError(eepromInterface->errors())
setError(QObject::tr("Cannot save EEPROM"));
result = false;
}
+3 -3
View File
@@ -330,16 +330,16 @@ bool FirmwareInterface::isValid()
return isValidFlag;
}
unsigned int FirmwareInterface::save(QString fileName)
unsigned int FirmwareInterface::save(const QString & filename)
{
uint8_t * binflash = (uint8_t*)malloc(FSIZE_MAX);
if (binflash == NULL) {
return -1;
}
memcpy(binflash, flash.constData(), flashSize);
QFile file(fileName);
QFile file(filename);
int fileType = getStorageType(fileName);
int fileType = getStorageType(filename);
if (fileType == STORAGE_TYPE_HEX) {
if (!file.open(QIODevice::ReadWrite | QIODevice::Truncate | QIODevice::Text)) { //reading HEX TEXT file
+1 -1
View File
@@ -56,7 +56,7 @@ class FirmwareInterface
int getSplashWidth();
uint getSplashHeight();
QImage::Format getSplashFormat();
unsigned int save(QString fileName);
unsigned int save(const QString & fileName);
bool isValid();
private:
+2 -1
View File
@@ -118,8 +118,9 @@ bool convertEEprom(const QString & sourceEEprom, const QString & destinationEEpr
}
QFile destinationFile(destinationEEprom);
if (!destinationFile.open(QIODevice::WriteOnly))
if (!destinationFile.open(QIODevice::WriteOnly)) {
return false;
}
int result = destinationFile.write(eeprom.constData(), size);
destinationFile.close();