1
Fork 0
mirror of https://github.com/redstrate/Astra.git synced 2025-04-20 11:47:46 +00:00
astra/launcher/include/existinginstallmodel.h
Joshua Goins 27e8169a0f Misc code cleanup
Make more things const, auto and whatnot
2024-07-04 20:53:06 -04:00

36 lines
763 B
C++

// SPDX-FileCopyrightText: 2024 Joshua Goins <josh@redstrate.com>
// SPDX-License-Identifier: GPL-3.0-or-later
#pragma once
#include <QtQml>
#include <physis.hpp>
class ExistingInstallModel : public QAbstractListModel
{
Q_OBJECT
QML_ELEMENT
public:
enum CustomRoles {
TypeRole = Qt::UserRole,
PathRole,
};
explicit ExistingInstallModel(QObject *parent = nullptr);
QVariant data(const QModelIndex &index, int role) const override;
int rowCount(const QModelIndex &parent) const override;
QHash<int, QByteArray> roleNames() const override;
private:
void fill();
struct ExistingInstall {
ExistingInstallType type;
QString path;
};
QList<ExistingInstall> m_existingInstalls;
};