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();
|
const ResolvedFile& value = iterator.value();
|
||||||
|
|
||||||
// detect disabled mod
|
// detect disabled mod
|
||||||
QString disabledSuffix = ".disabled";
|
const QFileInfo pathInfo(path);
|
||||||
if (path.endsWith(disabledSuffix)) {
|
if (pathInfo.suffix() == "disabled") {
|
||||||
// rename it
|
// rename it
|
||||||
path = path.left(path.length() - disabledSuffix.length());
|
path = pathInfo.dir().filePath(pathInfo.completeBaseName());
|
||||||
// ...and make it optional
|
// ...and make it optional
|
||||||
QJsonObject env;
|
QJsonObject env;
|
||||||
env["client"] = "optional";
|
env["client"] = "optional";
|
||||||
|
Loading…
Reference in New Issue
Block a user