mirror of
https://github.com/redstrate/Astra.git
synced 2025-04-21 20:27:45 +00:00
The data directory has been rearranged, and all the Dalamud data is stored separately, so it's no longer clogging up everything. Dalamud logs (and our own logs, when that's implemented) now exist in XDG_STATE_HOME, instead of the data directory. The game directory now exists under the data directory, instead of ~/.wine. The user path is set before launching the game, and it now exists under the data directory too. These are also prefixed to the user and profile UUID that it belongs to. The "keep patches" option is now implemented (which is off by default) and it lives in the temporary directory now.
49 lines
No EOL
1.1 KiB
C++
49 lines
No EOL
1.1 KiB
C++
// SPDX-FileCopyrightText: 2023 Joshua Goins <josh@redstrate.com>
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
#pragma once
|
|
|
|
#include <QAbstractListModel>
|
|
|
|
#include "profile.h"
|
|
|
|
class ProfileManager : public QAbstractListModel
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit ProfileManager(LauncherCore &launcher, QObject *parent = nullptr);
|
|
|
|
void load();
|
|
|
|
enum CustomRoles {
|
|
ProfileRole = Qt::UserRole,
|
|
};
|
|
|
|
int rowCount(const QModelIndex &index = QModelIndex()) const override;
|
|
|
|
QVariant data(const QModelIndex &index, int role) const override;
|
|
|
|
QHash<int, QByteArray> roleNames() const override;
|
|
|
|
Q_INVOKABLE Profile *getProfile(int index);
|
|
|
|
int getProfileIndex(const QString &name);
|
|
Q_INVOKABLE Profile *addProfile();
|
|
Q_INVOKABLE void deleteProfile(Profile *profile);
|
|
|
|
QVector<Profile *> profiles() const;
|
|
|
|
Q_INVOKABLE bool canDelete(Profile *account) const;
|
|
|
|
static QString getDefaultGamePath(const QString &uuid);
|
|
|
|
private:
|
|
void insertProfile(Profile *profile);
|
|
|
|
QString getDefaultWinePrefixPath();
|
|
|
|
QVector<Profile *> m_profiles;
|
|
|
|
LauncherCore &m_launcher;
|
|
}; |