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

Method deleteModIndex

launcher/modplatform/packwiz/Packwiz.cpp:192–209  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

190}
191
192void V1::deleteModIndex(QDir& index_dir, QString& mod_slug)
193{
194 auto normalized_fname = indexFileName(mod_slug);
195 auto real_fname = getRealIndexName(index_dir, normalized_fname);
196 if (real_fname.isEmpty())
197 return;
198
199 QFile index_file(index_dir.absoluteFilePath(real_fname));
200
201 if (!index_file.exists()) {
202 qWarning() << QString("Tried to delete non-existent mod metadata for %1!").arg(mod_slug);
203 return;
204 }
205
206 if (!index_file.remove()) {
207 qWarning() << QString("Failed to remove metadata for mod %1!").arg(mod_slug);
208 }
209}
210
211void V1::deleteModIndex(QDir& index_dir, QVariant& mod_id)
212{

Callers

nothing calls this directly

Calls 7

indexFileNameFunction · 0.85
getRealIndexNameFunction · 0.85
QStringClass · 0.85
isEmptyMethod · 0.80
existsMethod · 0.80
mod_idMethod · 0.80
removeMethod · 0.45

Tested by

no test coverage detected