MCPcopy Create free account
hub / github.com/PolyMC/PolyMC / InstanceList

Method InstanceList

launcher/InstanceList.cpp:69–85  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

67const static int GROUP_FILE_FORMAT_VERSION = 1;
68
69InstanceList::InstanceList(SettingsObjectPtr settings, const QString& instDir, QObject* parent)
70 : QAbstractListModel(parent), m_globalSettings(settings)
71{
72 resumeWatch();
73 // Create aand normalize path
74 if (!QDir::current().exists(instDir)) {
75 QDir::current().mkpath(instDir);
76 }
77
78 connect(this, &InstanceList::instancesChanged, this, &InstanceList::providerUpdated);
79
80 // NOTE: canonicalPath requires the path to exist. Do not move this above the creation block!
81 m_instDir = QDir(instDir).canonicalPath();
82 m_watcher = new QFileSystemWatcher(this);
83 connect(m_watcher, &QFileSystemWatcher::directoryChanged, this, &InstanceList::instanceDirContentsChanged);
84 m_watcher->addPath(m_instDir);
85}
86
87InstanceList::~InstanceList() {}
88

Callers

nothing calls this directly

Calls 2

existsMethod · 0.80
QDirClass · 0.70

Tested by

no test coverage detected