1
Fork 0
mirror of https://github.com/redstrate/Astra.git synced 2025-05-12 21:07:44 +00:00
astra/launcher/include/existinginstallmodel.h
Joshua Goins fb28dd3480 Show the game version when importing existing installations
This is more useful than a path - which is still shown when importing
from other launchers.
2025-05-05 17:44:05 -04:00

38 lines
809 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,
VersionRole,
};
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;
QString version;
};
QList<ExistingInstall> m_existingInstalls;
};