MCPcopy Create free account
hub / github.com/Audio4Linux/JDSP4Linux / saveRules

Method saveRules

src/data/PresetManager.cpp:151–167  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

149}
150
151void PresetManager::saveRules() const
152{
153 QFile json(rulesPath());
154 if(!json.open(QIODevice::WriteOnly)){
155 Log::error("PresetRuleTableModel::save: Cannot open json file");
156 return;
157 }
158
159 QJsonArray root;
160 for(const auto& item : _rules)
161 {
162 root.append(item.toJson());
163 }
164
165 json.write(QJsonDocument(root).toJson(QJsonDocument::Indented));
166 json.close();
167}
168
169PresetListModel *PresetManager::presetModel() const
170{

Callers

nothing calls this directly

Calls 3

appendMethod · 0.80
toJsonMethod · 0.80
writeMethod · 0.45

Tested by

no test coverage detected