Advance Wayland and KDE package bring-up

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
2026-04-14 10:51:06 +01:00
parent 51f3c21121
commit cf12defd28
15214 changed files with 20594243 additions and 269 deletions
@@ -0,0 +1,81 @@
/*
SPDX-FileCopyrightText: 2010 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.net>
SPDX-FileContributor: Stephen Kelly <stephen@kdab.com>
SPDX-License-Identifier: LGPL-2.0-or-later
*/
#include "modeldumper.h"
#include <QAbstractItemModel>
ModelDumper::ModelDumper()
{
}
static int num;
void ModelDumper::dumpModel(const QAbstractItemModel *const model, QIODevice *device) const
{
num = 1;
device->write(dumpLevel(model, QModelIndex(), 1).toLatin1());
}
QString ModelDumper::dumpModel(const QAbstractItemModel *const model) const
{
num = 1;
return dumpLevel(model, QModelIndex(), 1);
}
QString ModelDumper::dumpTree(const QAbstractItemModel *const model, const QModelIndex &index) const
{
num = 1;
return dumpLevel(model, index, 1);
}
QString ModelDumper::dumpTree(const QAbstractItemModel *const model, const QModelIndex &index, int start, int end) const
{
num = 1;
return dumpLevel(model, index, 1, start, end);
}
void ModelDumper::dumpTree(const QAbstractItemModel *const model, QIODevice *device, const QModelIndex &index) const
{
num = 1;
device->write(dumpLevel(model, index, 1).toLatin1());
}
void ModelDumper::dumpTree(const QAbstractItemModel *const model, QIODevice *device, const QModelIndex &index, int start, int end) const
{
num = 1;
device->write(dumpLevel(model, index, 1, start, end).toLatin1());
}
QString ModelDumper::dumpLevel(const QAbstractItemModel *const model, const QModelIndex &parent, int level) const
{
const int rowCount = model->rowCount(parent);
return dumpLevel(model, parent, level, 0, rowCount - 1);
}
QString ModelDumper::dumpLevel(const QAbstractItemModel *const model, const QModelIndex &parent, int level, int start, int end) const
{
QString lines;
for (int row = start; row <= end; ++row) {
QString line;
line.append("\"");
for (int l = 0; l < level; ++l) {
line.append("- ");
}
line.append(QString::number(num++));
line.append("\"");
line.append("\n");
lines.append(line);
static const int column = 0;
const QModelIndex idx = model->index(row, column, parent);
if (model->hasChildren(idx)) {
lines.append(dumpLevel(model, idx, level + 1));
}
}
return lines;
}