f31522130f
Build system (5 gaps hardened): - COOKBOOK_OFFLINE defaults to true (fork-mode) - normalize_patch handles diff -ruN format - New 'repo validate-patches' command (25/25 relibc patches) - 14 patched Qt/Wayland/display recipes added to protected list - relibc archive regenerated with current patch chain Boot fixes (fixable): - Full ISO EFI partition: 16 MiB → 1 MiB (matches mini, BIOS hardcoded 2 MiB offset) - D-Bus system bus: absolute /usr/bin/dbus-daemon path (was skipped) - redbear-sessiond: absolute /usr/bin/redbear-sessiond path (was skipped) - daemon framework: silenced spurious INIT_NOTIFY warnings for oneshot_async services (P0-daemon-silence-init-notify.patch) - udev-shim: demoted INIT_NOTIFY warning to INFO (expected for oneshot_async) - relibc: comprehensive named semaphores (sem_open/close/unlink) replacing upstream todo!() stubs - greeterd: Wayland socket timeout 15s → 30s (compositor DRM wait) - greeter-ui: built and linked (header guard unification, sem_compat stubs removed) - mc: un-ignored in both configs, fixed glib/libiconv/pcre2 transitive deps - greeter config: removed stale keymapd dependency from display/greeter services - prefix toolchain: relibc headers synced, _RELIBC_STDLIB_H guard unified Unfixable (diagnosed, upstream): - i2c-hidd: abort on no-I2C-hardware (QEMU) — process::exit → relibc abort - kded6/greeter-ui: page fault 0x8 — Qt library null deref - Thread panics fd != -1 — Rust std library on Redox - DHCP timeout / eth0 MAC — QEMU user-mode networking - hwrngd/thermald — no hardware RNG/thermal in VM - live preload allocation — BIOS memory fragmentation, continues on demand
147 lines
4.9 KiB
C++
147 lines
4.9 KiB
C++
// Copyright (C) 2018 The Qt Company Ltd.
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
|
|
// Qt-Security score:significant
|
|
|
|
#ifndef QQMLTABLEINSTANCEMODEL_P_H
|
|
#define QQMLTABLEINSTANCEMODEL_P_H
|
|
|
|
//
|
|
// W A R N I N G
|
|
// -------------
|
|
//
|
|
// This file is not part of the Qt API. It exists purely as an
|
|
// implementation detail. This header file may change from version to
|
|
// version without notice, or even be removed.
|
|
//
|
|
// We mean it.
|
|
//
|
|
|
|
#include <QtQmlModels/private/qqmldelegatemodel_p.h>
|
|
#include <QtQmlModels/private/qqmldelegatemodel_p_p.h>
|
|
|
|
#include <QtCore/qpointer.h>
|
|
|
|
QT_REQUIRE_CONFIG(qml_table_model);
|
|
|
|
QT_BEGIN_NAMESPACE
|
|
|
|
class QQmlTableInstanceModel;
|
|
class QQmlAbstractDelegateComponent;
|
|
|
|
class QQmlTableInstanceModelIncubationTask : public QQDMIncubationTask
|
|
{
|
|
public:
|
|
QQmlTableInstanceModelIncubationTask(
|
|
QQmlTableInstanceModel *tableInstanceModel
|
|
, QQmlDelegateModelItem* modelItemToIncubate
|
|
, IncubationMode mode)
|
|
: QQDMIncubationTask(nullptr, mode)
|
|
, modelItemToIncubate(modelItemToIncubate)
|
|
, tableInstanceModel(tableInstanceModel) {
|
|
clear();
|
|
}
|
|
|
|
void statusChanged(Status status) override;
|
|
void setInitialState(QObject *object) override;
|
|
|
|
QQmlDelegateModelItem *modelItemToIncubate = nullptr;
|
|
QQmlTableInstanceModel *tableInstanceModel = nullptr;
|
|
};
|
|
|
|
class Q_QMLMODELS_EXPORT QQmlTableInstanceModel : public QQmlInstanceModel
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
QQmlTableInstanceModel(QQmlContext *qmlContext, QObject *parent = nullptr);
|
|
~QQmlTableInstanceModel() override;
|
|
|
|
void useImportVersion(QTypeRevision version);
|
|
|
|
int count() const override { return m_adaptorModel.count(); }
|
|
int rows() const { return m_adaptorModel.rowCount(); }
|
|
int columns() const { return m_adaptorModel.columnCount(); }
|
|
|
|
bool isValid() const override { return true; }
|
|
|
|
bool canFetchMore() const { return m_adaptorModel.canFetchMore(); }
|
|
void fetchMore() { m_adaptorModel.fetchMore(); }
|
|
|
|
QVariant model() const;
|
|
void setModel(const QVariant &model);
|
|
|
|
QQmlComponent *delegate() const;
|
|
void setDelegate(QQmlComponent *);
|
|
|
|
QQmlDelegateModel::DelegateModelAccess delegateModelAccess() const
|
|
{
|
|
return m_adaptorModel.delegateModelAccess;
|
|
}
|
|
void setDelegateModelAccess(QQmlDelegateModel::DelegateModelAccess delegateModelAccess)
|
|
{
|
|
m_adaptorModel.delegateModelAccess = delegateModelAccess;
|
|
}
|
|
|
|
const QAbstractItemModel *abstractItemModel() const override;
|
|
|
|
QObject *object(int index, QQmlIncubator::IncubationMode incubationMode = QQmlIncubator::AsynchronousIfNested) override;
|
|
ReleaseFlags release(QObject *object, ReusableFlag reusable = NotReusable) override;
|
|
void dispose(QObject *object);
|
|
void cancel(int) override;
|
|
|
|
void drainReusableItemsPool(int maxPoolTime) override;
|
|
int poolSize() override { return m_reusableItemsPool.size(); }
|
|
void reuseItem(QQmlDelegateModelItem *item, int newModelIndex);
|
|
|
|
QQmlIncubator::Status incubationStatus(int index) override;
|
|
|
|
bool setRequiredProperty(int index, const QString &name, const QVariant &value) final;
|
|
|
|
QVariant variantValue(int, const QString &) override { Q_UNREACHABLE_RETURN(QVariant()); }
|
|
void setWatchedRoles(const QList<QByteArray> &) override { Q_UNREACHABLE(); }
|
|
int indexOf(QObject *, QObject *) const override { Q_UNREACHABLE_RETURN(0); }
|
|
|
|
QQmlDelegateModelItem *getModelItem(int index);
|
|
|
|
signals:
|
|
void modelChanged();
|
|
|
|
private:
|
|
enum DestructionMode {
|
|
Deferred,
|
|
Immediate
|
|
};
|
|
|
|
QQmlComponent *resolveDelegate(int index);
|
|
|
|
QQmlAdaptorModel m_adaptorModel;
|
|
QQmlAbstractDelegateComponent *m_delegateChooser = nullptr;
|
|
QQmlComponent *m_delegate = nullptr;
|
|
QPointer<QQmlContext> m_qmlContext;
|
|
QQmlRefPointer<QQmlDelegateModelItemMetaType> m_metaType;
|
|
|
|
QHash<int, QQmlDelegateModelItem *> m_modelItems;
|
|
QQmlReusableDelegateModelItemsPool m_reusableItemsPool;
|
|
QList<QQmlIncubator *> m_finishedIncubationTasks;
|
|
|
|
void incubateModelItem(QQmlDelegateModelItem *modelItem, QQmlIncubator::IncubationMode incubationMode);
|
|
void incubatorStatusChanged(QQmlTableInstanceModelIncubationTask *dmIncubationTask, QQmlIncubator::Status status);
|
|
void deleteIncubationTaskLater(QQmlIncubator *incubationTask);
|
|
void deleteAllFinishedIncubationTasks();
|
|
QQmlDelegateModelItem *resolveModelItem(int index);
|
|
void destroyModelItem(QQmlDelegateModelItem *modelItem, DestructionMode mode);
|
|
|
|
void dataChangedCallback(const QModelIndex &begin, const QModelIndex &end, const QList<int> &roles);
|
|
void modelAboutToBeResetCallback();
|
|
void forceSetModel(const QVariant &model);
|
|
|
|
static bool isDoneIncubating(QQmlDelegateModelItem *modelItem);
|
|
static void deleteModelItemLater(QQmlDelegateModelItem *modelItem);
|
|
|
|
friend class QQmlTableInstanceModelIncubationTask;
|
|
};
|
|
|
|
QT_END_NAMESPACE
|
|
|
|
#endif // QQMLTABLEINSTANCEMODEL_P_H
|