mirror of
https://github.com/PrismLauncher/PrismLauncher.git
synced 2026-06-29 01:54:20 +03:00
fix: CF import and Modrinth export
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
parent
b119cc04df
commit
8acc52b1ab
2 changed files with 11 additions and 3 deletions
|
|
@ -113,18 +113,26 @@ QString InstanceImportTask::getRootFromZip(QStringList files)
|
|||
if (!isRunning()) {
|
||||
return {};
|
||||
}
|
||||
auto cleanPath = [](QString path) {
|
||||
if (path == ".")
|
||||
return QString();
|
||||
QString result = path;
|
||||
if (result.startsWith("./"))
|
||||
result = result.mid(2);
|
||||
return result;
|
||||
};
|
||||
for (auto&& fileName : files) {
|
||||
setDetails(fileName);
|
||||
QFileInfo fileInfo(fileName);
|
||||
if (fileInfo.fileName() == "instance.cfg") {
|
||||
qDebug() << "MultiMC:" << true;
|
||||
m_modpackType = ModpackType::MultiMC;
|
||||
return fileInfo.path();
|
||||
return cleanPath(fileInfo.path());
|
||||
}
|
||||
if (fileInfo.fileName() == "manifest.json") {
|
||||
qDebug() << "Flame:" << true;
|
||||
m_modpackType = ModpackType::Flame;
|
||||
return fileInfo.path();
|
||||
return cleanPath(fileInfo.path());
|
||||
}
|
||||
QCoreApplication::processEvents();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue