diff options
author | Trial97 <alexandru.tripon97@gmail.com> | 2023-06-25 12:26:54 +0300 |
---|---|---|
committer | Trial97 <alexandru.tripon97@gmail.com> | 2023-06-25 12:26:54 +0300 |
commit | ef0752972ae64002a02e66e430165f3e93c09c53 (patch) | |
tree | bb4337a52c9fe3b0c063cb3b3af5e411826a8d90 /launcher/ui/pages/modplatform/atlauncher/AtlListModel.h | |
parent | 3c9c39cb890252f94d0c50caa00de5439881d7f6 (diff) | |
parent | bcf45c74a1b0b3389c05927637bf8aa95b8e43cf (diff) | |
download | PrismLauncher-ef0752972ae64002a02e66e430165f3e93c09c53.tar.gz PrismLauncher-ef0752972ae64002a02e66e430165f3e93c09c53.tar.bz2 PrismLauncher-ef0752972ae64002a02e66e430165f3e93c09c53.zip |
Merge branch 'develop' of https://github.com/PrismLauncher/PrismLauncher into export
Diffstat (limited to 'launcher/ui/pages/modplatform/atlauncher/AtlListModel.h')
-rw-r--r-- | launcher/ui/pages/modplatform/atlauncher/AtlListModel.h | 29 |
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 |