Revision dc3ebe65
Von Sebastian Diel vor mehr als 7 Jahren hinzugefügt
- ID dc3ebe6537d1fbe36f28f27d3ac07f81c05c8ea5
- Vorgänger 0a260288
src/entityinspector.cpp | ||
---|---|---|
|
||
bool EntityInspector::checkRegisteredEntities() {
|
||
QStringList classes = EntityInstanceFactory::getRegisteredClasses();
|
||
classes.sort();
|
||
QString msg = QDateTime::currentDateTime().toString(Qt::ISODate) +
|
||
" - Start checking entities\n";
|
||
this->logger->logMsg(msg, MsgType::INFO);
|
||
... | ... | |
void EntityInspector::checkMetaProperties(QHash<QString, QMetaProperty>
|
||
&metaProperties, bool &ok, QHash<QString, Relation> &relations) {
|
||
QString msg = "";
|
||
#ifdef DIFFABLEOUTPUT
|
||
QMap<QString, QMetaProperty> metaPropertiesMap;
|
||
for (auto i = metaProperties.constBegin(); i != metaProperties.constEnd();
|
||
++i) {
|
||
metaPropertiesMap[i.key()] = i.value();
|
||
}
|
||
for (auto i = metaPropertiesMap.constBegin(); i != metaPropertiesMap.constEnd(); i++) {
|
||
#else
|
||
for (auto i = metaProperties.constBegin(); i != metaProperties.constEnd();
|
||
++i) {
|
||
#endif
|
||
QString typeName = QString(i.value().typeName());
|
||
if (!i.value().isWritable()) {
|
||
ok = false;
|
||
... | ... | |
auto relations = entity->getRelations();
|
||
QString msg = "";
|
||
this->checkMetaProperties(metaProperties, ok, relations);
|
||
#ifdef DIFFABLEOUTPUT
|
||
QMap<QString, Relation> relationsMap;
|
||
for (auto i = relations.constBegin(); i != relations.constEnd(); i++) {
|
||
relationsMap[i.key()] = i.value();
|
||
}
|
||
for (auto i = relationsMap.constBegin(); i != relationsMap.constEnd(); ++i) {
|
||
#else
|
||
for (auto i = relations.constBegin(); i != relations.constEnd(); ++i) {
|
||
#endif
|
||
this->checkRelationTypos(i.key(), i.value(), ok);
|
||
if (!metaProperties.contains(i.key())) {
|
||
msg += "For relation " + i.key() + " no property exists!";
|
src/entitymanager.cpp | ||
---|---|---|
|
||
bool EntityManager::startup(QString version, QStringList toInitialize,
|
||
bool createIndices) {
|
||
#ifdef DIFFABLEOUTPUT
|
||
qSetGlobalQHashSeed(1);
|
||
#endif
|
||
QSharedPointer<Entity> dbm = QSharedPointer<DatabaseMigration>
|
||
(new DatabaseMigration());
|
||
QHash<QString, QVariant> map = QHash<QString, QVariant>();
|
src/logger.cpp | ||
---|---|---|
if (logQuery || q.lastError().isValid()) {
|
||
const QString errorMsg = this->generateLogMsg(q.lastError());
|
||
if (logQuery || !errorMsg.isEmpty()) {
|
||
QString msg = "{" + QString("\"time\":\"") +
|
||
QDateTime::currentDateTime().toString(Qt::ISODate) + QString("\"") + errorMsg;
|
||
QString timeStamp;
|
||
#ifndef DIFFABLEOUTPUT
|
||
timeStamp = QString("\"time\":\"") +
|
||
QDateTime::currentDateTime().toString(Qt::ISODate) + QString("\"");
|
||
#endif
|
||
QString msg = "{" + timeStamp + errorMsg;
|
||
msg += this->generateLogMsg(q) + "}";
|
||
this->logMsg(msg, errorMsg.isEmpty() ? MsgType::DEBUG : MsgType::WARNING);
|
||
}
|
src/logger.h | ||
---|---|---|
class Logger {
|
||
#ifdef QT_DEBUG
|
||
#define DEFAULTMSGTYPE MsgType::DEBUG
|
||
#define DIFFABLEOUTPUT
|
||
#else
|
||
#define DEFAULTMSGTYPE MsgType::CRITICAL
|
||
#endif
|
Auch abrufbar als: Unified diff
stable, sorted output