chore(cpn): rename storage format Labels to Tree (#7625)
This commit is contained in:
@@ -6,7 +6,7 @@ set(${PROJECT_NAME}_NAMES
|
|||||||
appdata
|
appdata
|
||||||
firmwareinterface
|
firmwareinterface
|
||||||
storage
|
storage
|
||||||
labeled
|
tree
|
||||||
sdcard
|
sdcard
|
||||||
etx
|
etx
|
||||||
yaml
|
yaml
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ bool EtxFormat::load(RadioData & radioData)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool result = LabelsStorageFormat::load(radioData);
|
bool result = TreeStorageFormat::load(radioData);
|
||||||
mz_zip_reader_end(&zip_archive);
|
mz_zip_reader_end(&zip_archive);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@@ -60,7 +60,7 @@ bool EtxFormat::write(RadioData & radioData)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool result = LabelsStorageFormat::write(radioData);
|
bool result = TreeStorageFormat::write(radioData);
|
||||||
|
|
||||||
if (result) {
|
if (result) {
|
||||||
// finalize archive and get contents
|
// finalize archive and get contents
|
||||||
|
|||||||
@@ -21,17 +21,17 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "labeled.h"
|
#include "tree.h"
|
||||||
|
|
||||||
#include <QtCore>
|
#include <QtCore>
|
||||||
|
|
||||||
class EtxFormat : public LabelsStorageFormat
|
class EtxFormat : public TreeStorageFormat
|
||||||
{
|
{
|
||||||
Q_DECLARE_TR_FUNCTIONS(EtxFormat)
|
Q_DECLARE_TR_FUNCTIONS(EtxFormat)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
EtxFormat(const QString & filename):
|
EtxFormat(const QString & filename):
|
||||||
LabelsStorageFormat(filename)
|
TreeStorageFormat(filename)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ bool SdcardFormat::write(RadioData & radioData)
|
|||||||
dir.mkdir("RADIO");
|
dir.mkdir("RADIO");
|
||||||
dir.mkdir("MODELS");
|
dir.mkdir("MODELS");
|
||||||
dir.mkdir("IMAGES");
|
dir.mkdir("IMAGES");
|
||||||
return LabelsStorageFormat::write(radioData);
|
return TreeStorageFormat::write(radioData);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SdcardFormat::loadFile(QByteArray & filedata, const QString & filename, bool optional)
|
bool SdcardFormat::loadFile(QByteArray & filedata, const QString & filename, bool optional)
|
||||||
|
|||||||
@@ -21,17 +21,17 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "labeled.h"
|
#include "tree.h"
|
||||||
|
|
||||||
#include <QtCore>
|
#include <QtCore>
|
||||||
|
|
||||||
class SdcardFormat : public LabelsStorageFormat
|
class SdcardFormat : public TreeStorageFormat
|
||||||
{
|
{
|
||||||
Q_DECLARE_TR_FUNCTIONS(SdcardFormat)
|
Q_DECLARE_TR_FUNCTIONS(SdcardFormat)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
SdcardFormat(const QString & filename):
|
SdcardFormat(const QString & filename):
|
||||||
LabelsStorageFormat(filename)
|
TreeStorageFormat(filename)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -19,14 +19,14 @@
|
|||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "labeled.h"
|
#include "tree.h"
|
||||||
#include "firmwares/opentx/opentxinterface.h"
|
#include "firmwares/opentx/opentxinterface.h"
|
||||||
#include "firmwares/edgetx/edgetxinterface.h"
|
#include "firmwares/edgetx/edgetxinterface.h"
|
||||||
#include "progressdialog.h"
|
#include "progressdialog.h"
|
||||||
|
|
||||||
#include <regex>
|
#include <regex>
|
||||||
|
|
||||||
StorageType LabelsStorageFormat::probeFormat()
|
StorageType TreeStorageFormat::probeFormat()
|
||||||
{
|
{
|
||||||
if (QFile(filename + "/RADIO/radio.yml").exists()) // converted
|
if (QFile(filename + "/RADIO/radio.yml").exists()) // converted
|
||||||
return getStorageType("radio.yml");
|
return getStorageType("radio.yml");
|
||||||
@@ -34,7 +34,7 @@ StorageType LabelsStorageFormat::probeFormat()
|
|||||||
return getStorageType(filename);
|
return getStorageType(filename);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool LabelsStorageFormat::load(RadioData & radioData)
|
bool TreeStorageFormat::load(RadioData & radioData)
|
||||||
{
|
{
|
||||||
int steps = 2; // initialisation and load radio.yml
|
int steps = 2; // initialisation and load radio.yml
|
||||||
bool hasLabels = getCurrentFirmware()->getCapability(HasModelLabels);
|
bool hasLabels = getCurrentFirmware()->getCapability(HasModelLabels);
|
||||||
@@ -211,7 +211,7 @@ bool LabelsStorageFormat::load(RadioData & radioData)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool LabelsStorageFormat::write(RadioData & radioData)
|
bool TreeStorageFormat::write(RadioData & radioData)
|
||||||
{
|
{
|
||||||
// TODO
|
// TODO
|
||||||
// move all unique radio settings to a separate file eg RADIO/hardware.yml.
|
// move all unique radio settings to a separate file eg RADIO/hardware.yml.
|
||||||
@@ -377,7 +377,7 @@ bool LabelsStorageFormat::write(RadioData & radioData)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool LabelsStorageFormat::loadChecklist(ModelData & model)
|
bool TreeStorageFormat::loadChecklist(ModelData & model)
|
||||||
{
|
{
|
||||||
const QString fname("MODELS/" + model.getChecklistFilename());
|
const QString fname("MODELS/" + model.getChecklistFilename());
|
||||||
//qDebug() << "Searching for checklist file:" << fname;
|
//qDebug() << "Searching for checklist file:" << fname;
|
||||||
@@ -388,7 +388,7 @@ bool LabelsStorageFormat::loadChecklist(ModelData & model)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool LabelsStorageFormat::writeChecklist(const ModelData & model)
|
bool TreeStorageFormat::writeChecklist(const ModelData & model)
|
||||||
{
|
{
|
||||||
if (!model.checklistData.isEmpty()) {
|
if (!model.checklistData.isEmpty()) {
|
||||||
const QString fname("MODELS/" + model.getChecklistFilename());
|
const QString fname("MODELS/" + model.getChecklistFilename());
|
||||||
@@ -401,7 +401,7 @@ bool LabelsStorageFormat::writeChecklist(const ModelData & model)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool LabelsStorageFormat::loadRadioSettings(GeneralSettings & generalSettings)
|
bool TreeStorageFormat::loadRadioSettings(GeneralSettings & generalSettings)
|
||||||
{
|
{
|
||||||
QByteArray radioSettingsBuffer;
|
QByteArray radioSettingsBuffer;
|
||||||
|
|
||||||
@@ -31,12 +31,12 @@
|
|||||||
#include <list>
|
#include <list>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
class LabelsStorageFormat : public StorageFormat
|
class TreeStorageFormat : public StorageFormat
|
||||||
{
|
{
|
||||||
Q_DECLARE_TR_FUNCTIONS(LabelsStorageFormat)
|
Q_DECLARE_TR_FUNCTIONS(TreeStorageFormat)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
LabelsStorageFormat(const QString & filename):
|
TreeStorageFormat(const QString & filename):
|
||||||
StorageFormat(filename)
|
StorageFormat(filename)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user