diff options
author | Petr Mrázek <peterix@gmail.com> | 2014-07-08 08:42:48 +0200 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2014-07-08 08:42:48 +0200 |
commit | 9b3ae29a361b4d89897c34750ea170d4433b93be (patch) | |
tree | 8918f9ec0bd051e234ccbc822ebd001e1bc2f084 /logic/InstanceList.h | |
parent | 19278c853b8ee940240e14e9d9c7cbe52cb760af (diff) | |
download | MultiMC-9b3ae29a361b4d89897c34750ea170d4433b93be.tar MultiMC-9b3ae29a361b4d89897c34750ea170d4433b93be.tar.gz MultiMC-9b3ae29a361b4d89897c34750ea170d4433b93be.tar.lz MultiMC-9b3ae29a361b4d89897c34750ea170d4433b93be.tar.xz MultiMC-9b3ae29a361b4d89897c34750ea170d4433b93be.zip |
Make the FTB packs a set instead of a list.
Diffstat (limited to 'logic/InstanceList.h')
-rw-r--r-- | logic/InstanceList.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/logic/InstanceList.h b/logic/InstanceList.h index f0bbb7ec..b88a080e 100644 --- a/logic/InstanceList.h +++ b/logic/InstanceList.h @@ -36,14 +36,23 @@ struct FTBRecord QString description; QString instanceDir; QString templateDir; + bool operator ==(const FTBRecord other) const + { + return instanceDir == other.instanceDir; + } }; +inline uint qHash(FTBRecord record) +{ + return qHash(record.instanceDir); +} + class InstanceList : public QAbstractListModel { Q_OBJECT private: void loadGroupList(QMap<QString, QString> &groupList); - QList<FTBRecord> discoverFTBInstances(); + QSet<FTBRecord> discoverFTBInstances(); void loadFTBInstances(QMap<QString, QString> &groupMap, QList<InstancePtr> & tempList); private |