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

Method enable

launcher/minecraft/mod/Mod.cpp:79–107  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

77}
78
79bool Mod::enable(bool value)
80{
81 if (m_type == Mod::MOD_UNKNOWN || m_type == Mod::MOD_FOLDER)
82 return false;
83
84 if (m_enabled == value)
85 return false;
86
87 QString path = m_file.absoluteFilePath();
88 if (value)
89 {
90 QFile foo(path);
91 if (!path.endsWith(".disabled"))
92 return false;
93 path.chop(9);
94 if (!foo.rename(path))
95 return false;
96 }
97 else
98 {
99 QFile foo(path);
100 path += ".disabled";
101 if (!foo.rename(path))
102 return false;
103 }
104 repath(QFileInfo(path));
105 m_enabled = value;
106 return true;
107}
108
109bool Mod::destroy()
110{

Callers 4

ApplicationMethod · 0.45
openedImplMethod · 0.45
setModStatusMethod · 0.45

Calls 1

renameMethod · 0.80

Tested by

no test coverage detected