MCPcopy Create free account
hub / github.com/ModOrganizer2/modorganizer / readFromIni

Method readFromIni

src/instancemanager.cpp:113–147  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

111}
112
113bool Instance::readFromIni()
114{
115 Settings s(iniPath());
116
117 if (s.iniStatus() != QSettings::NoError) {
118 log::error("can't read ini {}", iniPath());
119 return false;
120 }
121
122 // game name and directory are from ini unless overridden by setGame()
123 if (m_gameName.isEmpty()) {
124 if (auto v = s.game().name())
125 m_gameName = *v;
126 }
127
128 if (m_gameDir.isEmpty()) {
129 if (auto v = s.game().directory())
130 m_gameDir = *v;
131 }
132
133 if (m_gameVariant.isEmpty()) {
134 if (auto v = s.game().edition()) {
135 m_gameVariant = *v;
136 }
137 }
138
139 if (m_baseDir.isEmpty()) {
140 m_baseDir = s.paths().base();
141 }
142
143 // figuring out profile from ini if it's missing
144 getProfile(s);
145
146 return true;
147}
148
149Instance::SetupResults Instance::setup(PluginContainer& plugins)
150{

Callers 1

updateInstancesMethod · 0.80

Calls 7

iniStatusMethod · 0.80
gameMethod · 0.80
editionMethod · 0.80
baseMethod · 0.80
isEmptyMethod · 0.45
nameMethod · 0.45
directoryMethod · 0.45

Tested by

no test coverage detected