Hi,
Saving a project on linux (tested in Ubuntu 19.10 with Qt 5.13) crashes. That's because the file dialog does not automatically adds the extension. I had the same problem for my own tool. I made a possible workarround here:
void MainWindow::on_actionSaveAs_triggered() {
QSettings settings;
QString dir;
if (!_currentProjectFileName.isEmpty()) {
dir = _currentProjectFileName;
} else {
dir = settings.value("spritePackerFileName", QDir::currentPath()).toString();
}
QString fileName = QFileDialog::getSaveFileName(this, tr("Save sprite packer project file."),
dir,
tr("Sprite sheet packer (*.ssp)"));
if (!fileName.isEmpty()) {
if (!fileName.endsWith(".ssp")) {
fileName.append(".ssp");
}
settings.setValue("spritePackerFileName", fileName);
saveSpritePackerProject(fileName);
}
}
Just added a verification that if the correct suffix is not added to the filename when saving, add it by default.
I'll make a PR if that way suits your guidelines!
Hi, Saving a project on linux (tested in Ubuntu 19.10 with Qt 5.13) crashes. That's because the file dialog does not automatically adds the extension. I had the same problem for my own tool. I made a possible workarround here:
Just added a verification that if the correct suffix is not added to the filename when saving, add it by default. I'll make a PR if that way suits your guidelines!