swaymux/sway_bindings/SwayRecords.cpp

24 lines
588 B
C++
Raw Normal View History

2024-03-12 11:48:43 +01:00
//
// 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";
}