aboutsummaryrefslogtreecommitdiff
path: root/launcher/BaseVersionList.h
diff options
context:
space:
mode:
authorTheKodeToad <TheKodeToad@proton.me>2023-08-16 20:46:16 +0100
committerTheKodeToad <TheKodeToad@proton.me>2023-08-16 22:23:38 +0100
commit3e2733d840d24ce4f46b49bca0b8656d4d6e3d87 (patch)
tree386113207514b8071b0122b318c10439259ca83c /launcher/BaseVersionList.h
parent57430fd189aed592a170d597de61b3acabaaa43d (diff)
parentc88088c91a92a371a9bc2b7384c2897157772b7e (diff)
downloadPrismLauncher-3e2733d840d24ce4f46b49bca0b8656d4d6e3d87.tar.gz
PrismLauncher-3e2733d840d24ce4f46b49bca0b8656d4d6e3d87.tar.bz2
PrismLauncher-3e2733d840d24ce4f46b49bca0b8656d4d6e3d87.zip
Merge branch 'develop' into better-launch
Signed-off-by: TheKodeToad <TheKodeToad@proton.me>
Diffstat (limited to 'launcher/BaseVersionList.h')
-rw-r--r--launcher/BaseVersionList.h27
1 files changed, 12 insertions, 15 deletions
diff --git a/launcher/BaseVersionList.h b/launcher/BaseVersionList.h
index 31f29022..fe1550c2 100644
--- a/launcher/BaseVersionList.h
+++ b/launcher/BaseVersionList.h
@@ -15,13 +15,13 @@
#pragma once
+#include <QAbstractListModel>
#include <QObject>
#include <QVariant>
-#include <QAbstractListModel>
#include "BaseVersion.h"
-#include "tasks/Task.h"
#include "QObjectPtr.h"
+#include "tasks/Task.h"
/*!
* \brief Class that each instance type's version list derives from.
@@ -35,12 +35,10 @@
* all have a default implementation, but they can be overridden by plugins to
* change the behavior of the list.
*/
-class BaseVersionList : public QAbstractListModel
-{
+class BaseVersionList : public QAbstractListModel {
Q_OBJECT
-public:
- enum ModelRoles
- {
+ public:
+ enum ModelRoles {
VersionPointerRole = Qt::UserRole,
VersionRole,
VersionIdRole,
@@ -55,7 +53,7 @@ public:
};
typedef QList<int> RoleList;
- explicit BaseVersionList(QObject *parent = 0);
+ explicit BaseVersionList(QObject* parent = 0);
/*!
* \brief Gets a task that will reload the version list.
@@ -66,7 +64,7 @@ public:
virtual Task::Ptr getLoadTask() = 0;
//! Checks whether or not the list is loaded. If this returns false, the list should be
- //loaded.
+ // loaded.
virtual bool isLoaded() = 0;
//! Gets the version at the given index.
@@ -76,9 +74,9 @@ public:
virtual int count() const = 0;
//////// List Model Functions ////////
- 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;
+ int rowCount(const QModelIndex& parent) const override;
+ int columnCount(const QModelIndex& parent) const override;
QHash<int, QByteArray> roleNames() const override;
//! which roles are provided by this version list?
@@ -90,7 +88,7 @@ public:
* \return A const pointer to the version with the given descriptor. NULL if
* one doesn't exist.
*/
- virtual BaseVersion::Ptr findVersion(const QString &descriptor);
+ virtual BaseVersion::Ptr findVersion(const QString& descriptor);
/*!
* \brief Gets the recommended version from this list
@@ -103,8 +101,7 @@ public:
*/
virtual void sortVersions() = 0;
-protected
-slots:
+ protected slots:
/*!
* Updates this list with the given list of versions.
* This is done by copying each version in the given list and inserting it