#include "executable.h"
#include "setup.h"
-Executable::Executable() : EmuFrontObject() { }
+Executable::Executable() : EmuFrontObject(), executable(""), options(""), setup(0), type(-1) { }
Executable::Executable(int id, QString name)
: EmuFrontObject(id, name), executable(""), options(""), setup(0), type(-1)
"(id, name, executable, options, setupid, type) "
"VALUES (NULL, :name, :executable, :options, :setupid, :type)");
- q.bindValue(":setupid", ex->getSetup()
- ? QString(ex->getSetup()->getId()) : "NULL"); // TODO: null shouln't be allowed here
+ if (!ex->getSetup() || ex->getSetup()->getId() < 0) {
+ qDebug() << "Setup not available!";
+ return -1;
+ }
+ q.bindValue(":setupid", ex->getSetup()->getId());
q.bindValue(":name", ex->getName());
q.bindValue(":executable", ex->getExecutable());
q.bindValue(":options", ex->getOptions());