- fix: Problem's memory limit unit can't be correctly saved.

This commit is contained in:
Roy Qu 2023-03-03 18:17:26 +08:00
parent 989f1a892d
commit d80abbcf94
2 changed files with 4 additions and 3 deletions

View File

@ -20,6 +20,7 @@ Red Panda C++ Version 2.16
- fix: Shouldn't try evaluate value of the selection in the cpu info dialog. - fix: Shouldn't try evaluate value of the selection in the cpu info dialog.
- enhancement: Show oct/bin/bin value in the memory view's tooltip. - enhancement: Show oct/bin/bin value in the memory view's tooltip.
- fix: Hex float point literal is not correctly colored. - fix: Hex float point literal is not correctly colored.
- fix: Problem's memory limit unit can't be correctly saved.
Red Panda C++ Version 2.15 Red Panda C++ Version 2.15

View File

@ -79,13 +79,13 @@ void OJProblemPropertyWidget::saveToProblem(POJProblem problem)
problem->description = ui->txtDescription->toHtml(); problem->description = ui->txtDescription->toHtml();
problem->memoryLimit = ui->spinMemoryLimit->value(); problem->memoryLimit = ui->spinMemoryLimit->value();
problem->timeLimit = ui->spinTimeLimit->value(); problem->timeLimit = ui->spinTimeLimit->value();
if (ui->cbTimeLimitUnit->currentText()=="sec") if (ui->cbTimeLimitUnit->currentText()==tr("sec"))
problem->timeLimitUnit = ProblemTimeLimitUnit::Seconds; problem->timeLimitUnit = ProblemTimeLimitUnit::Seconds;
else else
problem->timeLimitUnit = ProblemTimeLimitUnit::Milliseconds; problem->timeLimitUnit = ProblemTimeLimitUnit::Milliseconds;
if (ui->cbTimeLimitUnit->currentText()=="KB") if (ui->cbMemoryLimitUnit->currentText()==tr("KB"))
problem->memoryLimitUnit = ProblemMemoryLimitUnit::KB; problem->memoryLimitUnit = ProblemMemoryLimitUnit::KB;
else if (ui->cbTimeLimitUnit->currentText()=="MB") else if (ui->cbMemoryLimitUnit->currentText()==tr("MB"))
problem->memoryLimitUnit = ProblemMemoryLimitUnit::MB; problem->memoryLimitUnit = ProblemMemoryLimitUnit::MB;
else else
problem->memoryLimitUnit = ProblemMemoryLimitUnit::GB; problem->memoryLimitUnit = ProblemMemoryLimitUnit::GB;