Replace string manipulation in favour of QFileInfo
Signed-off-by: TheKodeToad <TheKodeToad@proton.me>
This commit is contained in:
parent
8ae67b84db
commit
6e2fcc9e11
@ -301,10 +301,10 @@ QByteArray ModrinthPackExportTask::generateIndex()
|
||||
const ResolvedFile& value = iterator.value();
|
||||
|
||||
// detect disabled mod
|
||||
QString disabledSuffix = ".disabled";
|
||||
if (path.endsWith(disabledSuffix)) {
|
||||
const QFileInfo pathInfo(path);
|
||||
if (pathInfo.suffix() == "disabled") {
|
||||
// rename it
|
||||
path = path.left(path.length() - disabledSuffix.length());
|
||||
path = pathInfo.dir().filePath(pathInfo.completeBaseName());
|
||||
// ...and make it optional
|
||||
QJsonObject env;
|
||||
env["client"] = "optional";
|
||||
|
Loading…
Reference in New Issue
Block a user