aboutsummaryrefslogtreecommitdiff
path: root/launcher/ui/pages/modplatform/atlauncher/AtlListModel.h
diff options
context:
space:
mode:
authorRachel Powers <508861+Ryex@users.noreply.github.com>2023-07-02 19:32:25 -0700
committerGitHub <noreply@github.com>2023-07-02 19:32:25 -0700
commitca061080c13042642fb3bd49a29a863756f45866 (patch)
treea468b90c31ecb0cb5f2ca7885c2ecc7d4ab09570 /launcher/ui/pages/modplatform/atlauncher/AtlListModel.h
parent2680dba0aa74abefea58903dadad6578381101cb (diff)
parent3ad559ab22b6b20264eebb826efc4227374a64cc (diff)
downloadPrismLauncher-ca061080c13042642fb3bd49a29a863756f45866.tar.gz
PrismLauncher-ca061080c13042642fb3bd49a29a863756f45866.tar.bz2
PrismLauncher-ca061080c13042642fb3bd49a29a863756f45866.zip
Merge pull request #2 from Trial97/feat/acknowledge_release_type
Feat/acknowledge release type
Diffstat (limited to 'launcher/ui/pages/modplatform/atlauncher/AtlListModel.h')
-rw-r--r--launcher/ui/pages/modplatform/atlauncher/AtlListModel.h29
1 files changed, 14 insertions, 15 deletions
diff --git a/launcher/ui/pages/modplatform/atlauncher/AtlListModel.h b/launcher/ui/pages/modplatform/atlauncher/AtlListModel.h
index 2574c48d..ed1fdc9f 100644
--- a/launcher/ui/pages/modplatform/atlauncher/AtlListModel.h
+++ b/launcher/ui/pages/modplatform/atlauncher/AtlListModel.h
@@ -18,42 +18,41 @@
#include <QAbstractListModel>
-#include "net/NetJob.h"
-#include <QIcon>
#include <modplatform/atlauncher/ATLPackIndex.h>
+#include <QIcon>
+#include "net/NetJob.h"
namespace Atl {
typedef QMap<QString, QIcon> LogoMap;
typedef std::function<void(QString)> LogoCallback;
-class ListModel : public QAbstractListModel
-{
+class ListModel : public QAbstractListModel {
Q_OBJECT
-public:
- ListModel(QObject *parent);
+ public:
+ ListModel(QObject* parent);
virtual ~ListModel();
- int rowCount(const QModelIndex &parent) const override;
- int columnCount(const QModelIndex &parent) const override;
- QVariant data(const QModelIndex &index, int role) const override;
+ int rowCount(const QModelIndex& parent) const override;
+ int columnCount(const QModelIndex& parent) const override;
+ QVariant data(const QModelIndex& index, int role) const override;
void request();
- void getLogo(const QString &logo, const QString &logoUrl, LogoCallback callback);
+ void getLogo(const QString& logo, const QString& logoUrl, LogoCallback callback);
-private slots:
+ private slots:
void requestFinished();
void requestFailed(QString reason);
void logoFailed(QString logo);
void logoLoaded(QString logo, QIcon out);
-private:
+ private:
void requestLogo(QString file, QString url);
-private:
+ private:
QList<ATLauncher::IndexedPack> modpacks;
QStringList m_failedLogos;
@@ -62,7 +61,7 @@ private:
QMap<QString, LogoCallback> waitingCallbacks;
NetJob::Ptr jobPtr;
- QByteArray response;
+ std::shared_ptr<QByteArray> response = std::make_shared<QByteArray>();
};
-}
+} // namespace Atl