Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion companion/src/shared/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ set(${PROJECT_NAME}_NAMES
scrollarea
textvalidator
exclusivecombogroup
widgetbindings
)

AddHeadersSources()
Expand All @@ -48,6 +47,8 @@ set(${PROJECT_NAME}_SRCS
curveimage.cpp
semanticversion.h
semanticversion.cpp
widgetbindings.h
widgetbindings.cpp
)

add_library(${PROJECT_NAME}
Expand Down
2 changes: 1 addition & 1 deletion companion/src/storage/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ set(${PROJECT_NAME}_NAMES
appdata
firmwareinterface
storage
labeled
tree
sdcard
etx
yaml
Expand Down
4 changes: 2 additions & 2 deletions companion/src/storage/etx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ bool EtxFormat::load(RadioData & radioData)
return false;
}

bool result = LabelsStorageFormat::load(radioData);
bool result = TreeStorageFormat::load(radioData);
mz_zip_reader_end(&zip_archive);
return result;
}
Expand All @@ -60,7 +60,7 @@ bool EtxFormat::write(RadioData & radioData)
return false;
}

bool result = LabelsStorageFormat::write(radioData);
bool result = TreeStorageFormat::write(radioData);

if (result) {
// finalize archive and get contents
Expand Down
6 changes: 3 additions & 3 deletions companion/src/storage/etx.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,17 @@

#pragma once

#include "labeled.h"
#include "tree.h"

#include <QtCore>

class EtxFormat : public LabelsStorageFormat
class EtxFormat : public TreeStorageFormat
{
Q_DECLARE_TR_FUNCTIONS(EtxFormat)

public:
EtxFormat(const QString & filename):
LabelsStorageFormat(filename)
TreeStorageFormat(filename)
{
}

Expand Down
2 changes: 1 addition & 1 deletion companion/src/storage/sdcard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ bool SdcardFormat::write(RadioData & radioData)
dir.mkdir("RADIO");
dir.mkdir("MODELS");
dir.mkdir("IMAGES");
return LabelsStorageFormat::write(radioData);
return TreeStorageFormat::write(radioData);
}

bool SdcardFormat::loadFile(QByteArray & filedata, const QString & filename, bool optional)
Expand Down
6 changes: 3 additions & 3 deletions companion/src/storage/sdcard.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,17 @@

#pragma once

#include "labeled.h"
#include "tree.h"

#include <QtCore>

class SdcardFormat : public LabelsStorageFormat
class SdcardFormat : public TreeStorageFormat
{
Q_DECLARE_TR_FUNCTIONS(SdcardFormat)

public:
SdcardFormat(const QString & filename):
LabelsStorageFormat(filename)
TreeStorageFormat(filename)
{
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,22 @@
* GNU General Public License for more details.
*/

#include "labeled.h"
#include "tree.h"
#include "firmwares/opentx/opentxinterface.h"
#include "firmwares/edgetx/edgetxinterface.h"
#include "progressdialog.h"

#include <regex>

StorageType LabelsStorageFormat::probeFormat()
StorageType TreeStorageFormat::probeFormat()
{
if (QFile(filename + "/RADIO/radio.yml").exists()) // converted
return getStorageType("radio.yml");
else
return getStorageType(filename);
}

bool LabelsStorageFormat::load(RadioData & radioData)
bool TreeStorageFormat::load(RadioData & radioData)
{
int steps = 2; // initialisation and load radio.yml
bool hasLabels = getCurrentFirmware()->getCapability(HasModelLabels);
Expand Down Expand Up @@ -211,7 +211,7 @@ bool LabelsStorageFormat::load(RadioData & radioData)
return true;
}

bool LabelsStorageFormat::write(RadioData & radioData)
bool TreeStorageFormat::write(RadioData & radioData)
{
// TODO
// move all unique radio settings to a separate file eg RADIO/hardware.yml.
Expand Down Expand Up @@ -377,7 +377,7 @@ bool LabelsStorageFormat::write(RadioData & radioData)
return true;
}

bool LabelsStorageFormat::loadChecklist(ModelData & model)
bool TreeStorageFormat::loadChecklist(ModelData & model)
{
const QString fname("MODELS/" + model.getChecklistFilename());
//qDebug() << "Searching for checklist file:" << fname;
Expand All @@ -388,7 +388,7 @@ bool LabelsStorageFormat::loadChecklist(ModelData & model)
return true;
}

bool LabelsStorageFormat::writeChecklist(const ModelData & model)
bool TreeStorageFormat::writeChecklist(const ModelData & model)
{
if (!model.checklistData.isEmpty()) {
const QString fname("MODELS/" + model.getChecklistFilename());
Expand All @@ -401,7 +401,7 @@ bool LabelsStorageFormat::writeChecklist(const ModelData & model)
return true;
}

bool LabelsStorageFormat::loadRadioSettings(GeneralSettings & generalSettings)
bool TreeStorageFormat::loadRadioSettings(GeneralSettings & generalSettings)
{
QByteArray radioSettingsBuffer;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@
#include <list>
#include <string>

class LabelsStorageFormat : public StorageFormat
class TreeStorageFormat : public StorageFormat
{
Q_DECLARE_TR_FUNCTIONS(LabelsStorageFormat)
Q_DECLARE_TR_FUNCTIONS(TreeStorageFormat)

public:
LabelsStorageFormat(const QString & filename):
TreeStorageFormat(const QString & filename):
StorageFormat(filename)
{
}
Expand Down
Loading