Revision 5f3c7a9c
Von Christian Ehringfeld vor etwa 10 Jahren hinzugefügt
| src/entityinspector.cpp | ||
|---|---|---|
|
}
|
||
|
}
|
||
|
|
||
|
|
||
|
bool EntityInspector::verifyRelations(Entity *&entity, QString &msg) {
|
||
|
bool ok = true;
|
||
|
auto metaProperties = EntityHelper::getMetaProperties(entity);
|
||
| ... | ... | |
|
QString iMsg = "";
|
||
|
this->checkMetaProperties(metaProperties, iMsg, ok, relations);
|
||
|
for (auto i = relations.constBegin(); i != relations.constEnd(); ++i) {
|
||
|
this->checkRelationTypos(i.key(), i.value(), iMsg, ok);
|
||
|
if (!metaProperties.contains(i.key())) {
|
||
|
iMsg += "For relation " + i.key() + " is no property.";
|
||
|
iMsg += "For relation " + i.key() + " no property exists.";
|
||
|
ok = false;
|
||
|
} else {
|
||
|
auto metaProperty = metaProperties.value(i.key());
|
||
|
if (!QString(metaProperty.typeName()).contains("QSharedPointer")) {
|
||
| ... | ... | |
|
qWarning() << iMsg;
|
||
|
msg += iMsg;
|
||
|
}
|
||
|
|
||
|
}
|
||
|
|
||
|
bool EntityInspector::checkRelation(const QVariant &entity,
|
||
| ... | ... | |
|
return true;
|
||
|
}
|
||
|
|
||
|
void EntityInspector::checkRelationTypos(const QString &name, const Relation &r,
|
||
|
QString &msg, bool &ok) {
|
||
|
if (name != r.getPropertyName()) {
|
||
|
ok = false;
|
||
|
msg += "Relation " + name + " has a typo.\n";
|
||
|
msg += "Name " + name + "and relation name " + r.getPropertyName() +
|
||
|
" are not equal.\n";
|
||
|
}
|
||
|
}
|
||
|
|
||
|
bool EntityInspector::checkPrimaryKey(Entity *&entity, QString &msg) {
|
||
|
QString pk = entity->getPrimaryKey();
|
||
|
auto metaprops = EntityHelper::getMetaProperties(entity);
|
||
| src/entityinspector.h | ||
|---|---|---|
|
void verifyTransientAttributes(Entity *&entity, QString &msg);
|
||
|
bool checkRelation(const QVariant &entity, const Relation &r, QString &msg,
|
||
|
const QMetaProperty &property) const;
|
||
|
void checkRelationTypos(const QString &name, const Relation &r, QString &msg, bool &ok);
|
||
|
bool checkPrimaryKey(Entity *&entity, QString &msg);
|
||
|
void verifyBlobAttributes(Entity *&entity, QString &msg);
|
||
|
void checkMetaProperties(QHash<QString, QMetaProperty> &metaProperties,
|
||
| src/logger.cpp | ||
|---|---|---|
|
* You should have received a copy of the GNU Lesser General Public License
|
||
|
* along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||
|
*/
|
||
|
|
||
|
#include "logger.h"
|
||
|
#include <QDir>
|
||
|
#include <QDebug>
|
||
Auch abrufbar als: Unified diff
typo checker