MCPcopy Create free account
hub / github.com/MultiMC/Launcher / copyFinished

Method copyFinished

launcher/InstanceCopyTask.cpp:35–54  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

33}
34
35void InstanceCopyTask::copyFinished()
36{
37 auto successful = m_copyFuture.result();
38 if(!successful)
39 {
40 emitFailed(tr("Instance folder copy failed."));
41 return;
42 }
43 // FIXME: shouldn't this be able to report errors?
44 auto instanceSettings = std::make_shared<INISettingsObject>(FS::PathCombine(m_stagingPath, "instance.cfg"));
45 instanceSettings->registerSetting("InstanceType", "Legacy");
46
47 InstancePtr inst(new NullInstance(m_globalSettings, instanceSettings, m_stagingPath));
48 inst->setName(m_instName);
49 inst->setIconKey(m_instIcon);
50 if(!m_keepPlaytime) {
51 inst->resetTimePlayed();
52 }
53 emitSucceeded();
54}
55
56void InstanceCopyTask::copyAborted()
57{

Callers

nothing calls this directly

Calls 6

PathCombineFunction · 0.85
setIconKeyMethod · 0.80
resetTimePlayedMethod · 0.80
resultMethod · 0.45
registerSettingMethod · 0.45
setNameMethod · 0.45

Tested by

no test coverage detected