File indexing completed on 2025-01-05 05:14:39
0001 /* 0002 SPDX-FileCopyrightText: 2021 Hamed Masafi <hamed.masfi@gmail.com> 0003 0004 SPDX-License-Identifier: GPL-3.0-or-later 0005 */ 0006 0007 #pragma once 0008 0009 #include "filestatus.h" 0010 #include <QAbstractListModel> 0011 0012 #include <QList> 0013 #include <QPair> 0014 #include <QString> 0015 0016 class FilesModel : public QAbstractListModel 0017 { 0018 Q_OBJECT 0019 0020 public: 0021 explicit FilesModel(QObject *parent = nullptr); 0022 0023 int rowCount(const QModelIndex &parent) const override; 0024 int columnCount(const QModelIndex &parent) const override; 0025 QVariant data(const QModelIndex &index, int role) const override; 0026 void append(const QString &data); 0027 0028 void addFile(const Git::FileStatus &file); 0029 0030 private: 0031 QList<QPair<QString, QString>> mFiles; 0032 };