qt: Fix multiple issues with hdd image creation: large sizes, image paths, max_hpc on ide

This commit is contained in:
cold-brewed
2022-11-13 11:09:38 -05:00
parent a6d6d678b4
commit 78998b8231
2 changed files with 4 additions and 2 deletions

View File

@@ -999,7 +999,7 @@ load_hard_disks(void)
case HDD_BUS_IDE:
max_spt = 63;
max_hpc = 16;
max_hpc = 255;
max_tracks = 266305;
break;

View File

@@ -293,7 +293,7 @@ void HarddiskDialog::onCreateNewFile() {
ui->progressBar->setEnabled(true);
setResult(QDialog::Rejected);
qint64 size = ui->lineEditSize->text().toUInt() << 20U;
quint64 size = ui->lineEditSize->text().toULongLong() << 20U;
if (size > 0x1FFFFFFE00ll) {
QMessageBox::critical(this, tr("Disk image too large"), tr("Disk images cannot be larger than 127 GB."));
return;
@@ -326,6 +326,8 @@ void HarddiskDialog::onCreateNewFile() {
ui->fileField->setFileName(fileName);
}
}
QFileInfo fi(fileName);
fileName = (fi.isRelative() && !fi.filePath().isEmpty()) ? usr_path + fi.filePath() : fi.filePath();
QFile file(fileName);
if (! file.open(QIODevice::WriteOnly)) {