- Check all the exceptions, are they catched? Is the allocated data cleaned?
- check all the needed closeEvents for dialogs!
+- bug: select media image path for editing, click done -> media image path is
+ deleted.
return (*this);
}
+
+bool EmuFrontObject::operator ==(const EmuFrontObject &sup)
+{
+ return (id >= 0 && id == sup.id && name == sup.name);
+}
+
+bool EmuFrontObject::operator !=(const EmuFrontObject &sup)
+{
+ return !(*this == sup);
+}
+
EmuFrontObject(const EmuFrontObject &);
~EmuFrontObject();
EmuFrontObject &operator=(const EmuFrontObject &);
+ bool operator==(const EmuFrontObject &);
+ bool operator!=(const EmuFrontObject &);
virtual const QString getName() const
{ return name; }
return (*this);
}
+// TODO:
+/*bool Setup::operator ==(const Setup &sup)
+{
+
+ // TODO: more precise ... this is exact copy from EmuFrontObject
+ return (id >= 0 && id == sup.id);
+
+}
+
+bool Setup::operator !=(const Setup &sup)
+{
+ // TODO: more precise ... this is exact copy from EmuFrontObject
+ return !(*this == sup);
+}*/
+
Platform* Setup::getPlatform() const
{ return platform; }
void Setup::setPlatform(Platform *plf)
Setup(int id, Platform *, MediaType *, QStringList fileTypeExtensions);
Setup(const Setup &);
Setup& operator=(const Setup &);
+ // TODO:
+ //bool operator==(const Setup &);
+ //bool operator!=(const Setup &);
Platform* getPlatform() const;
MediaType* getMediaType() const;
QStringList getSupportedFileTypeExtensions() const;
if (opts.isEmpty()) {
throw new EmuFrontException(tr("Options not set"));
}
+ bool change = false;
Setup *supTmp = ex->getSetup();
- if (supTmp != su) {
+ if (*supTmp != *su) {
delete supTmp;
ex->setSetup(su);
+ change = true;
}
- ex->setName(name);
- ex->setExecutable(exec);
- ex->setOptions(opts);
- emit dataObjectUpdated();
+
+ if (name != ex->getName()) {
+ ex->setName(name);
+ change = true;
+ }
+
+ if (exec != ex->getExecutable()) {
+ ex->setExecutable(exec);
+ change = true;
+ }
+ if (opts != ex->getOptions()) {
+ ex->setOptions(opts);
+ change = true;
+ }
+ if (change) emit dataObjectUpdated();
efObject = 0;
close();
} catch(EmuFrontException x) {
QMessageBox::information(this, tr("Set up"), tr("Set up not selected"), QMessageBox::Ok);
return;
}
+ bool change = false;
qDebug() << "Setup selected " << sup->getName();
QString filePath = filePathLabel->text();
if (filePath.isEmpty())
QMessageBox::information(this, tr("File path"), tr("File path was not selected"), QMessageBox::Ok);
return;
}
+ if (filePath != fpo->getName()) {
+ fpo->setName(filePath);
+ change = true;
+ }
+
Setup *tmp = fpo->getSetup();
- if (sup != tmp)
+
+ int idSup = sup->getId();
+ int idTmp = tmp->getId();
+
+ if (*sup != *tmp)
{
delete tmp;
fpo->setSetup(sup);
+ change = true;
}
- fpo->setName(filePath);
- emit dataObjectUpdated();
+ if (change) emit dataObjectUpdated();
efObject = 0;
close();
}
QString name = nameEdit->text().simplified();
qDebug() << "We have a name " << name << ".";
- setDataObject(name);
- emit dataObjectUpdated();
+ if (name != efObject->getName()) {
+ setDataObject(name);
+ emit dataObjectUpdated();
+ }
qDebug() << "Signal emitted.";
efObject = 0; // TODO we should also set efObject to null when user clicks abort
close();
qDebug() << "Media type selected " << mt->getName();
+ bool change = false;
Platform *ptmp = sup->getPlatform();
- if (plf != ptmp)
+ if (*plf != *ptmp)
{
delete ptmp;
sup->setPlatform(plf);
+ change = true;
}
MediaType *mtmp = sup->getMediaType();
- if (mt != mtmp)
+ if (*mt != *mtmp)
{
delete mtmp;
sup->setMediaType(mt);
+ change = true;
}
- sup->setSupportedFileTypeExtensions(supportedFileTypesList->getItems());
- emit dataObjectUpdated();
+
+ // "Two lists are considered equal if they contain the same values in the same order."
+ if (supportedFileTypesList->getItems() != sup->getSupportedFileTypeExtensions()) {
+ sup->setSupportedFileTypeExtensions(supportedFileTypesList->getItems());
+ change = true;
+ }
+ if (change) emit dataObjectUpdated();
efObject = 0;
close();
}