Herunterladen als
root/src/validators/existvalidator.cpp @ 49762cb7
ec6a9500 | Christian Ehringfeld | #include "existvalidator.h"
|
|
28d2f01a | Christian Ehringfeld | #include "../entity.h"
|
|
#include "../entityinstancefactory.h"
|
|||
ec6a9500 | Christian Ehringfeld | using namespace CuteEntityManager;
|
|
ExistValidator::ExistValidator() : Validator() {
|
|||
}
|
|||
ErrorMsg ExistValidator::validateParam(QVariant value, Param param) const {
|
|||
28d2f01a | Christian Ehringfeld | Q_UNUSED(param)
|
|
QSharedPointer<Entity> entity = EntityInstanceFactory::castQVariant(value);
|
|||
if (!entity || entity->getId() <= -1) {
|
|||
return ErrorMsg("", "<property> is invalid.");
|
|||
}
|
|||
return ErrorMsg();
|
|||
ec6a9500 | Christian Ehringfeld | }
|