summaryrefslogtreecommitdiffstats
path: root/api/logic/InstanceList.h
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2018-07-15 14:51:05 +0200
committerPetr Mrázek <peterix@gmail.com>2018-07-15 14:51:05 +0200
commitbbb3b3e6f6e3c0f95873f22e6d0a4aaf350f49d9 (patch)
treee6497e304b7b9368367565fbc7c06efab1124b1c /api/logic/InstanceList.h
parent03280cc62e75f8073f8d3d9e9e3952acf21fa77d (diff)
downloadMultiMC-bbb3b3e6f6e3c0f95873f22e6d0a4aaf350f49d9.tar
MultiMC-bbb3b3e6f6e3c0f95873f22e6d0a4aaf350f49d9.tar.gz
MultiMC-bbb3b3e6f6e3c0f95873f22e6d0a4aaf350f49d9.tar.lz
MultiMC-bbb3b3e6f6e3c0f95873f22e6d0a4aaf350f49d9.tar.xz
MultiMC-bbb3b3e6f6e3c0f95873f22e6d0a4aaf350f49d9.zip
NOISSUE tabs -> spaces
Diffstat (limited to 'api/logic/InstanceList.h')
-rw-r--r--api/logic/InstanceList.h118
1 files changed, 59 insertions, 59 deletions
diff --git a/api/logic/InstanceList.h b/api/logic/InstanceList.h
index bb879c83..7fe5ea34 100644
--- a/api/logic/InstanceList.h
+++ b/api/logic/InstanceList.h
@@ -31,75 +31,75 @@ class BaseInstance;
class MULTIMC_LOGIC_EXPORT InstanceList : public QAbstractListModel
{
- Q_OBJECT
+ Q_OBJECT
public:
- explicit InstanceList(QObject *parent = 0);
- virtual ~InstanceList();
+ explicit InstanceList(QObject *parent = 0);
+ virtual ~InstanceList();
public:
- QModelIndex index(int row, int column = 0, const QModelIndex &parent = QModelIndex()) const;
- int rowCount(const QModelIndex &parent = QModelIndex()) const;
- QVariant data(const QModelIndex &index, int role) const;
- Qt::ItemFlags flags(const QModelIndex &index) const;
-
- enum AdditionalRoles
- {
- GroupRole = Qt::UserRole,
- InstancePointerRole = 0x34B1CB48, ///< Return pointer to real instance
- InstanceIDRole = 0x34B1CB49 ///< Return id if the instance
- };
- /*!
- * \brief Error codes returned by functions in the InstanceList class.
- * NoError Indicates that no error occurred.
- * UnknownError indicates that an unspecified error occurred.
- */
- enum InstListError
- {
- NoError = 0,
- UnknownError
- };
-
- InstancePtr at(int i) const
- {
- return m_instances.at(i);
- }
-
- int count() const
- {
- return m_instances.count();
- }
-
- InstListError loadList(bool complete = false);
- void saveNow();
-
- /// Add an instance provider. Takes ownership of it. Should only be done before the first load.
- void addInstanceProvider(BaseInstanceProvider * provider);
-
- InstancePtr getInstanceById(QString id) const;
- QModelIndex getInstanceIndexById(const QString &id) const;
- QStringList getGroups();
-
- void deleteGroup(const QString & name);
+ QModelIndex index(int row, int column = 0, const QModelIndex &parent = QModelIndex()) const;
+ int rowCount(const QModelIndex &parent = QModelIndex()) const;
+ QVariant data(const QModelIndex &index, int role) const;
+ Qt::ItemFlags flags(const QModelIndex &index) const;
+
+ enum AdditionalRoles
+ {
+ GroupRole = Qt::UserRole,
+ InstancePointerRole = 0x34B1CB48, ///< Return pointer to real instance
+ InstanceIDRole = 0x34B1CB49 ///< Return id if the instance
+ };
+ /*!
+ * \brief Error codes returned by functions in the InstanceList class.
+ * NoError Indicates that no error occurred.
+ * UnknownError indicates that an unspecified error occurred.
+ */
+ enum InstListError
+ {
+ NoError = 0,
+ UnknownError
+ };
+
+ InstancePtr at(int i) const
+ {
+ return m_instances.at(i);
+ }
+
+ int count() const
+ {
+ return m_instances.count();
+ }
+
+ InstListError loadList(bool complete = false);
+ void saveNow();
+
+ /// Add an instance provider. Takes ownership of it. Should only be done before the first load.
+ void addInstanceProvider(BaseInstanceProvider * provider);
+
+ InstancePtr getInstanceById(QString id) const;
+ QModelIndex getInstanceIndexById(const QString &id) const;
+ QStringList getGroups();
+
+ void deleteGroup(const QString & name);
signals:
- void dataIsInvalid();
+ void dataIsInvalid();
private slots:
- void propertiesChanged(BaseInstance *inst);
- void groupsPublished(QSet<QString>);
- void providerUpdated();
+ void propertiesChanged(BaseInstance *inst);
+ void groupsPublished(QSet<QString>);
+ void providerUpdated();
private:
- int getInstIndex(BaseInstance *inst) const;
- void suspendWatch();
- void resumeWatch();
- void add(const QList<InstancePtr> &list);
+ int getInstIndex(BaseInstance *inst) const;
+ void suspendWatch();
+ void resumeWatch();
+ void add(const QList<InstancePtr> &list);
protected:
- int m_watchLevel = 0;
- QSet<BaseInstanceProvider *> m_updatedProviders;
- QList<InstancePtr> m_instances;
- QSet<QString> m_groups;
- QVector<shared_qobject_ptr<BaseInstanceProvider>> m_providers;
+ int m_watchLevel = 0;
+ QSet<BaseInstanceProvider *> m_updatedProviders;
+ QList<InstancePtr> m_instances;
+ QSet<QString> m_groups;
+ QVector<shared_qobject_ptr<BaseInstanceProvider>> m_providers;
};