24 lines
588 B
C++
24 lines
588 B
C++
|
//
|
||
|
// Created by grimmauld on 12.03.24.
|
||
|
//
|
||
|
|
||
|
#include "SwayRecords.h"
|
||
|
|
||
|
QVariant SwayRecord::data(const QModelIndex &index, int role) const {
|
||
|
if (!index.isValid() || role != Qt::DisplayRole)
|
||
|
return {};
|
||
|
|
||
|
switch (index.column()) {
|
||
|
case 0:
|
||
|
return QString::fromStdString(jsonFields[index.row()].first);
|
||
|
case 1:
|
||
|
return QString::fromStdString(jsonFields[index.row()].second);
|
||
|
default:
|
||
|
return {};
|
||
|
}
|
||
|
}
|
||
|
|
||
|
bool SwayRecord::shouldIgnoreKey(const std::string &key) {
|
||
|
return key == "floating_nodes" || key == "nodes";
|
||
|
}
|