Skip to content

Commit

Permalink
Automatically set the patch type to C_dependency if Unable to find Ho…
Browse files Browse the repository at this point in the history
…okString from the patch file (#451)
  • Loading branch information
shinespeciall authored Aug 26, 2023
1 parent 2bb551d commit d3ab9b5
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion Dialog/PatchEditDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,6 @@ void PatchEditDialog::ParsePatchFile(QString patchfilepath)
{
fileType = PatchType::Binary;
}
ui->comboBox_PatchType->setCurrentIndex(fileType);

// Infer fields from file comments
if(fileType != PatchType::Binary)
Expand All @@ -197,13 +196,30 @@ void PatchEditDialog::ParsePatchFile(QString patchfilepath)
{
ui->lineEdit_HookText->setText(hookString);
}
else
{
if (fileType == PatchType::C)
{
QMessageBox::information(
this,
QT_TR_NOOP("WL4Editor Patch Import Info"),
QT_TR_NOOP("Unable to find HookString from the patch file.\nAutomatically set the patch type to C_dependency."),
QMessageBox::Ok,
QMessageBox::Ok
);
fileType = PatchType::C_dependency;
}
}

QString descString = FileIOUtils::GetParamFromSourceFile(patchfilepath, DESCRIPTION_IDENTIFIER, descriptionRegex);
if(descString != "")
{
ui->textEdit_Description->setText(descString);
}
}

// Set patch type
ui->comboBox_PatchType->setCurrentIndex(fileType);
}
}

Expand Down

0 comments on commit d3ab9b5

Please sign in to comment.