Purpose

difflistmodel.h
1/*
2 SPDX-FileCopyrightText: 2017 René J.V. Bertin <rjvbertin@gmail.com>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7#ifndef DIFFLISTMODEL_H
8#define DIFFLISTMODEL_H
9
10#include <QAbstractListModel>
11#include <QHash>
12#include <QList>
13
14class KJob;
15class QTemporaryDir;
16
17class DiffListModel : public QAbstractListModel
18{
20 Q_PROPERTY(QString status READ status WRITE setStatus)
21public:
22 DiffListModel(QObject *parent = nullptr);
23
24 void refresh();
25
26 QHash<int, QByteArray> roleNames() const override;
27 QVariant data(const QModelIndex &idx, int role) const override;
28 int rowCount(const QModelIndex &parent) const override;
29
30 QString status() const
31 {
32 return m_status;
33 }
34
35 void setStatus(const QString &status);
36
37 void receivedDiffRevs(KJob *job);
38 Q_SCRIPTABLE QVariant get(int row, const QByteArray &role);
39
40private:
41 struct Value {
42 QVariant summary;
43 QVariant id;
44 QVariant status;
45#ifndef QT_NO_DEBUG_STREAM
46 operator QString() const
47 {
48 QString ret = QStringLiteral("DiffListModel::Value{summary=\"%1\" id=\"%2\" status=\"%3\"}");
49 return ret.arg(this->summary.toString()).arg(this->id.toString()).arg(this->status.toInt());
50 }
51#endif
52 };
53 QList<Value> m_values;
54
55 QString m_status;
56 QString m_initialDir;
57 QTemporaryDir *m_tempDir;
58};
59
60#endif
char * toString(const EngineQuery &query)
Q_OBJECTQ_OBJECT
Q_PROPERTY(...)
QObject * parent() const const
QString arg(Args &&... args) const const
int toInt(bool *ok) const const
QString toString() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:03:06 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.