From 0c73ddee73e7383d5b81185381fa1c762fcb1147 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Tue, 31 Jul 2018 01:54:08 +0200 Subject: NOISSUE set groups for instances by not setting groups for instances So simple. Better in every way. --- api/logic/InstanceList.h | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'api/logic/InstanceList.h') diff --git a/api/logic/InstanceList.h b/api/logic/InstanceList.h index a487a7ca..5b966b33 100644 --- a/api/logic/InstanceList.h +++ b/api/logic/InstanceList.h @@ -41,6 +41,13 @@ enum class InstCreateError CantCreateDir }; +enum class GroupsState +{ + NotLoaded, + Steady, + Dirty +}; + class MULTIMC_LOGIC_EXPORT InstanceList : public QAbstractListModel { @@ -90,6 +97,8 @@ public: InstancePtr getInstanceById(QString id) const; QModelIndex getInstanceIndexById(const QString &id) const; QStringList getGroups(); + GroupId getInstanceGroup(const InstanceId & id) const; + void setInstanceGroup(const InstanceId & id, const GroupId& name); void deleteGroup(const GroupId & name); void deleteInstance(const InstanceId & id); @@ -125,10 +134,8 @@ public slots: private slots: void propertiesChanged(BaseInstance *inst); - void groupsPublished(QSet); void providerUpdated(); void instanceDirContentsChanged(const QString &path); - void groupChanged(); private: int getInstIndex(BaseInstance *inst) const; @@ -149,7 +156,7 @@ private: SettingsObjectPtr m_globalSettings; QString m_instDir; QFileSystemWatcher * m_watcher; - QMap groupMap; + QMap m_groupMap; QSet instanceSet; bool m_groupsLoaded = false; bool m_instancesProbed = false; -- cgit v1.2.3