1
0
Fork 0
mirror of https://github.com/EdgeTX/edgetx.git synced 2025-07-26 01:35:16 +03:00

[Companion] Work in progress - QTreeView in MdiChild (#4197)

[Companion] QTreeView in MdiChild, Horus and X7 support added, fixes for #4224
This commit is contained in:
Bertrand Songis 2017-01-15 17:45:57 +01:00 committed by GitHub
parent d6b84371a9
commit a65aa3d6c7
60 changed files with 3539 additions and 3153 deletions

View file

@ -18,11 +18,12 @@
* GNU General Public License for more details.
*/
#include <QtGui>
#include "hexinterface.h"
#include "splash.h"
#include "firmwareinterface.h"
#include "helpers.h"
#include "storage.h"
#include <QtGui>
#define FW_MARK "FW"
#define VERS_MARK "VERS"
@ -30,25 +31,6 @@
#define TIME_MARK "TIME"
#define EEPR_MARK "EEPR"
int getFileType(const QString &fullFileName)
{
QString suffix = QFileInfo(fullFileName).suffix().toUpper();
if (suffix == "HEX")
return FILE_TYPE_HEX;
else if (suffix == "BIN")
return FILE_TYPE_BIN;
else if (suffix == "EEPM")
return FILE_TYPE_EEPM;
else if (suffix == "EEPE")
return FILE_TYPE_EEPE;
else if (suffix == "XML")
return FILE_TYPE_XML;
else if (suffix == "OTX")
return FILE_TYPE_OTX;
else
return 0;
}
FirmwareInterface::FirmwareInterface(const QString &filename):
flash(FSIZE_MAX, 0),
flashSize(0),
@ -355,9 +337,9 @@ unsigned int FirmwareInterface::save(QString fileName)
memcpy(binflash, flash.constData(), flashSize);
QFile file(fileName);
int fileType = getFileType(fileName);
int fileType = getStorageType(fileName);
if (fileType == FILE_TYPE_HEX) {
if (fileType == STORAGE_TYPE_HEX) {
if (!file.open(QIODevice::ReadWrite | QIODevice::Truncate | QIODevice::Text)) { //reading HEX TEXT file
free(binflash);
return -1;