mirror of
https://github.com/PrismLauncher/PrismLauncher.git
synced 2026-06-30 18:36:58 +03:00
Fix a bug
This commit is contained in:
parent
4a9e213238
commit
8637cce433
4 changed files with 15 additions and 6 deletions
|
|
@ -111,12 +111,21 @@ void OneSixModEditDialog::disableVersionControls()
|
|||
|
||||
void OneSixModEditDialog::on_userEditorBtn_clicked()
|
||||
{
|
||||
if (QDir(m_inst->instanceRoot()).exists("user.json"))
|
||||
QDir root(m_inst->instanceRoot());
|
||||
if (!root.exists("user.json"))
|
||||
{
|
||||
if (!MMC->openJsonEditor(m_inst->instanceRoot() + "/user.json"))
|
||||
QFile file(root.absoluteFilePath("user.json"));
|
||||
if (!file.open(QFile::WriteOnly))
|
||||
{
|
||||
QMessageBox::warning(this, tr("Error"), tr("Unable to open user.json, check the settings"));
|
||||
QMessageBox::critical(this, tr("Error"), tr("Couldn't write a skeletion user.json file: %1").arg(file.errorString()));
|
||||
return;
|
||||
}
|
||||
file.write("{\n}");
|
||||
file.close();
|
||||
}
|
||||
if (!MMC->openJsonEditor(root.absoluteFilePath("user.json")))
|
||||
{
|
||||
QMessageBox::warning(this, tr("Error"), tr("Unable to open user.json, check the settings"));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue