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

Method copyFinished

launcher/InstanceCopyTask.cpp:35–53  ·  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
46 InstancePtr inst(new NullInstance(m_globalSettings, instanceSettings, m_stagingPath));
47 inst->setName(name());
48 inst->setIconKey(m_instIcon);
49 if(!m_keepPlaytime) {
50 inst->resetTimePlayed();
51 }
52 emitSucceeded();
53}
54
55void InstanceCopyTask::copyAborted()
56{

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected