File indexing completed on 2025-01-19 04:22:44

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 #include "abstractgititemsmodel.h"
0009 #include "libkommit_export.h"
0010 
0011 namespace Git
0012 {
0013 
0014 class Submodule;
0015 class LIBKOMMIT_EXPORT SubmodulesModel : public AbstractGitItemsModel
0016 {
0017     Q_OBJECT
0018 
0019 public:
0020     explicit SubmodulesModel(Git::Manager *git, QObject *parent = nullptr);
0021 
0022     int rowCount(const QModelIndex &parent) const override;
0023     int columnCount(const QModelIndex &parent) const override;
0024     QVariant data(const QModelIndex &index, int role) const override;
0025     QVariant headerData(int section, Qt::Orientation orientation, int role) const override;
0026 
0027     bool append(Submodule *module);
0028     Submodule *fromIndex(const QModelIndex &index);
0029 
0030 protected:
0031     void fill() override;
0032 
0033 private:
0034     QList<Submodule *> mData;
0035 };
0036 
0037 } // namespace Git