log0.4
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <QJsonObject>
|
||||
#include <QJsonArray>
|
||||
#include <QVector>
|
||||
#include <QString>
|
||||
#include <QHash>
|
||||
@@ -27,9 +28,17 @@ public:
|
||||
bool loadFromDaemonConfig(const QJsonObject& root, QString* errorMessage = nullptr);
|
||||
|
||||
const QVector<DeviceTreeNode>& nodes() const { return m_nodes; }
|
||||
QVector<DeviceTreeNode>& nodesMutable() { return m_nodes; }
|
||||
|
||||
const DeviceTreeNode* findById(const QString& id) const;
|
||||
|
||||
// 序列化为 daemon_config.json 所需格式
|
||||
QJsonArray toDeviceTreeJson() const;
|
||||
QJsonObject toDaemonConfigRoot() const;
|
||||
|
||||
// 当外部直接修改 nodesMutable() 后,需要重建索引
|
||||
void rebuildIndex();
|
||||
|
||||
private:
|
||||
QVector<DeviceTreeNode> m_nodes;
|
||||
QHash<QString, int> m_indexById;
|
||||
|
||||
Reference in New Issue
Block a user