if (sqlTableModel->rowCount() >= 1)
{
QSqlRecord record = sqlTableModel->record(0);
- if (record.isEmpty())
- {
- throw new EmuFrontException(tr("No filtered data available"));
+ if (record.isEmpty()) {
+ throw EmuFrontException(tr("No filtered data available"));
}
else plf = recordToDataObject(&record);
}
= dynamic_cast<MediaImageContainer *>(efo);
if (!mic->getFilePath())
- throw new EmuFrontException("Cannot install media image "
+ throw EmuFrontException("Cannot install media image "
"container to database without a file path object!");
// multiple media image containers with matching checksum will be stored
// in the calling code block and clean
// all the media image and ...containers from
// the memory!
- throw new EmuFrontException(
+ throw EmuFrontException(
QString(tr("Inserting media image container %1 to file database failed"))
.arg(mic->getName()));
}
if (!linkMediaImageContainerToPath(mic)){
DbFile::deleteDataObject(fileId);
- throw new EmuFrontException("Failed inserting media image to database!");
+ throw EmuFrontException("Failed inserting media image to database!");
}
//qDebug() << "Inserted media image container " << fileId << " to mediaimagecontainer table.";
linkMediaImagesWithContainer(fileId, images.values());
/*qDebug() << "Linking media image container " << micId
<< " to media image " << mi->getId() << ", " << mi->getName() << ".";*/
if (!linkMediaImageToMediaImageContainer(mi, micId)) {
- throw new EmuFrontException(QString("Failed linking media "
+ throw EmuFrontException(QString("Failed linking media "
"image container %1 to a media image %2").arg(micId).arg(mi->getId()));
}
}
try {
Setup *su = getSelectedSetup();
if (!su) {
- throw new EmuFrontException(tr("Setup not selected"));
+ throw EmuFrontException(tr("Setup not selected"));
}
QString name = nameEdit->text().trimmed();
if (name.isEmpty()){
- throw new EmuFrontException(tr("Name is not set"));
+ throw EmuFrontException(tr("Name is not set"));
}
QString exec = execEdit->text().trimmed();
if (exec.isEmpty()){
- throw new EmuFrontException(tr("Executable is not set"));
+ throw EmuFrontException(tr("Executable is not set"));
}
QString opts = optEdit->text().trimmed();
if (opts.isEmpty()) {
- throw new EmuFrontException(tr("Options not set"));
+ throw EmuFrontException(tr("Options not set"));
}
bool change = false;
Setup *supTmp = ex->getSetup();
if (mame && listMIndex.count() > 1) {
- throw new EmuFrontException(tr("No supported file types configured for this emulator configuration. "
+ throw EmuFrontException(tr("No supported file types configured for this emulator configuration. "
"Assuming emulator support container files as is. "
"Only one container can be selected without configuring supported file types."
));
.arg(fp->getSetup()->getName()));
}
else if (!fp->getSetup()->getMediaType()){
- throw new EmuFrontException(tr("No media type available with %1.")
+ throw EmuFrontException(tr("No media type available with %1.")
.arg(fp->getSetup()->getName()));
}
QFile file(filePath);
//qDebug() << "readCrc32: " << filePath;
if (!file.open(QIODevice::ReadOnly)) {
- throw new EmuFrontException(QString(tr("Failed opening file %1 for reading the checksum!")).arg(filePath));
+ throw EmuFrontException(QString(tr("Failed opening file %1 for reading the checksum!")).arg(filePath));
}
quint32 crc = crc32(0L, Z_NULL, 0);
int read = 0;
}
file.close();
if (crc <= 0)
- throw new EmuFrontException(QString(tr("Failed reading crc checksum for file %1!")).arg(filePath));
+ throw EmuFrontException(QString(tr("Failed reading crc checksum for file %1!")).arg(filePath));
//qDebug() << QString("readCrc32, crc: %1").arg(crc, 0, 16);
return crc;
}
QFile fl(filePath);
if (!fl.open(QIODevice::ReadOnly)) {
- throw new EmuFrontException(tr("Couldn't read file %1.").arg(filePath));
+ throw EmuFrontException(tr("Couldn't read file %1.").arg(filePath));
}
//Setup *sup = fp->getSetup();
: QComboBox(parent), dbManager(dbMan)
{
if (!dbManager)
- throw new EmuFrontException("Database manager is not available!");
+ throw EmuFrontException("Database manager is not available!");
setSizeAdjustPolicy(QComboBox::AdjustToContents);
updateDataModel();
}