nodetable: correctly update with time

This commit is contained in:
itsmattkc
2020-06-18 16:30:57 +10:00
parent e47c985baa
commit 57f858dd92
8 changed files with 100 additions and 16 deletions
+6 -2
View File
@@ -44,7 +44,12 @@ void NodeValueDatabase::Insert(const NodeInput *key, const NodeValueTable &value
NodeValueTable NodeValueDatabase::Merge() const
{
return NodeValueTable::Merge(tables_.values());
QHash<QString, NodeValueTable> copy = tables_;
// Kinda hacky, but we don't need this table to slipstream
copy.remove(QStringLiteral("global"));
return NodeValueTable::Merge(copy.values());
}
NodeValue::NodeValue() :
@@ -176,7 +181,6 @@ NodeValueTable NodeValueTable::Merge(QList<NodeValueTable> tables)
NodeValueTable merged_table;
// Slipstreams all tables together
// FIXME: I don't actually know if this is the right approach...
foreach (const NodeValueTable& t, tables) {
if (row >= t.Count()) {
continue;
+9 -2
View File
@@ -108,14 +108,21 @@ public:
using const_iterator = QHash<QString, NodeValueTable>::const_iterator;
inline QHash<QString, NodeValueTable>::const_iterator begin() const {
inline QHash<QString, NodeValueTable>::const_iterator begin() const
{
return tables_.cbegin();
}
inline QHash<QString, NodeValueTable>::const_iterator end() const {
inline QHash<QString, NodeValueTable>::const_iterator end() const
{
return tables_.cend();
}
inline bool contains(const QString& s) const
{
return tables_.contains(s);
}
private:
QHash<QString, NodeValueTable> tables_;