diff options
author | Sefa Eyeoglu <contact@scrumplex.net> | 2023-08-04 19:42:36 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-04 19:42:36 +0200 |
commit | ae793f6cf11658c9abc5111e82d5ba7b3e6af127 (patch) | |
tree | ed41f30e2c0f02e4be1d42324b3f05fbab75b2cd /launcher/BaseVersionList.h | |
parent | 50c7d39e082f0a7dbd977401e16d5adf534d9770 (diff) | |
parent | 1d638e018ac40fbfb35dd117f9a948c0cf35eadd (diff) | |
download | PrismLauncher-ae793f6cf11658c9abc5111e82d5ba7b3e6af127.tar.gz PrismLauncher-ae793f6cf11658c9abc5111e82d5ba7b3e6af127.tar.bz2 PrismLauncher-ae793f6cf11658c9abc5111e82d5ba7b3e6af127.zip |
Merge pull request #1459 from Scrumplex/format
Diffstat (limited to 'launcher/BaseVersionList.h')
-rw-r--r-- | launcher/BaseVersionList.h | 27 |
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 |