MCPcopy Create free account
hub / github.com/FreesmTeam/FreesmLauncher / InstanceList

Method InstanceList

launcher/InstanceList.cpp:71–87  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 3

existsMethod · 0.80
addPathMethod · 0.80
QDirClass · 0.70

Tested by

no test coverage detected