1
Fork 0
mirror of https://github.com/redstrate/Astra.git synced 2025-04-21 20:27:45 +00:00
astra/launcher/include/existinginstallmodel.h
Joshua Goins 4948db82be Add a method to use existing game installations from other launchers
This should work for XIVLauncher.Core, XIVQuickLauncher and the official
launcher. More testing is needed of course, but the framework is there
now.
2024-05-26 08:03:52 -04:00

35 lines
762 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;
};