Skip to content

Commit

Permalink
UNI: do not save packed IRs to file.
Browse files Browse the repository at this point in the history
  • Loading branch information
horacekj committed May 10, 2021
1 parent 6bc7c62 commit 78cf50c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions src/modules/uni.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ QJsonObject MtbUni::moduleInfo(bool state, bool config) const {
};

if (config)
uni["config"] = this->config.json(this->isIrSupport());
uni["config"] = this->config.json(this->isIrSupport(), false);

if (state && this->active && !this->busModuleInfo.inBootloader()) {
uni["state"] = QJsonObject{
Expand Down Expand Up @@ -540,7 +540,7 @@ std::vector<uint8_t> MtbUniConfig::serializeForMtbUsb(bool withIrs) const {
return result;
}

QJsonObject MtbUniConfig::json(bool withIrs) const {
QJsonObject MtbUniConfig::json(bool withIrs, bool file) const {
QJsonObject result;
{
QJsonArray array;
Expand Down Expand Up @@ -576,7 +576,8 @@ QJsonObject MtbUniConfig::json(bool withIrs) const {
irs >>= 1;
}
result["irs"] = array;
result["irsPacked"] = this->irs;
if (!file)
result["irsPacked"] = this->irs;
}

return result;
Expand Down Expand Up @@ -652,5 +653,5 @@ void MtbUni::loadConfig(const QJsonObject &json) {
void MtbUni::saveConfig(QJsonObject &json) const {
MtbModule::saveConfig(json);
if (this->configLoaded)
json["config"] = this->config.json(this->isIrSupport());
json["config"] = this->config.json(this->isIrSupport(), true);
}
2 changes: 1 addition & 1 deletion src/modules/uni.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ struct MtbUniConfig {
void fromMtbUsb(const std::vector<uint8_t>&);

void fromJson(const QJsonObject&);
QJsonObject json(bool withIrs) const;
QJsonObject json(bool withIrs, bool file) const;
};

class MtbUni : public MtbModule {
Expand Down

0 comments on commit 78cf50c

Please sign in to comment.