Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 8f029876

Von Christian Ehringfeld vor etwa 7 Jahren hinzugefügt

  • ID 8f029876bdb242217eb09bafe29a79880cb01f9b
  • Vorgänger 6d71876d
  • Nachfolger 1a9e6412

Revert "Reproducing error 629"

This reverts commit 2a40e887cc9a2b77b162555b08d1394cb34a2d8e.

Unterschiede anzeigen:

samples/simple/incident.cpp
#include "incident.h"
#include <QDebug>
//#include "src/model/appdata/appdata.h"
//#include "src/trivia/errorhandling.h"
Incident::Incident() :
Entity()
......
// this->setAppData(appData);
this->setBookedFor(dateTime);
this->setBookedAt(dateTime);
m_cancelledAt = QDateTime();
this->setCancelledAt(QDateTime());
this->setLocked(false);
this->setPredecessor(QSharedPointer<Incident>());
}
......
if (m_cancelledAt.isValid() && !forceOverwrite) {
// sometimes an EntityManager metacall reaches this, too. Immediately after setting it manually. (<= 1ms?)
// reproduce: change attendanceIncident, ok, change again
// qint64 diff = qAbs(m_cancelledAt.secsTo(cancelledAt));
// if (diff > 10) { // giving some delay headroom for a possible double call
qDebug()<< "\n\n-------------------------------\n-------------------------------\n-------------------------------\nWHY DOES THIS HAPPEN? \nEach incident's cancelledAt has been invalidated in the ctor!\n------------------------\n-------------------------------\n-------------------------------\n-------------------------------";
// Q_ASSERT(!m_cancelledAt.isValid());
// THROW_MODERATE_ERROR_CIT("Das Canceln eines Ereignisses ist fehlgeschlagen, das Ereignis war bereits vorher gecancelt!");
// }
qint64 diff = qAbs(m_cancelledAt.secsTo(cancelledAt));
if (diff > 10) { // giving some delay headroom for a possible double call
Q_ASSERT(!m_cancelledAt.isValid());
// THROW_MODERATE_ERROR_CIT("Das Canceln eines Ereignisses ist fehlgeschlagen, das Ereignis war bereits vorher gecancelt!");
}
}
m_cancelledAt = cancelledAt;
}
......
m_pupil = pupil;
}
//QSharedPointer<AppData> Incident::appData() const
//{
// return m_appData;
//}
//void Incident::setAppData(const QSharedPointer<AppData> &appData)
//{
// m_appData = appData;
//}
QSharedPointer<Group> Incident::group() const
{
return m_group;
......
m_locked = locked;
}
//QSharedPointer<Room> Incident::room() const
//{
// return m_room;
//}
//void Incident::setRoom(const QSharedPointer<Room> &room)
//{
// m_room = room;
//}
QString Incident::additionalInfo() const
{
return m_additionalInfo;
......
hash.insert("pupil",CuteEntityManager::Relation(
"pupil",CuteEntityManager::RelationType::MANY_TO_ONE));
// hash.insert("appData",CuteEntityManager::Relation(
// "appData",CuteEntityManager::RelationType::MANY_TO_ONE));
hash.insert("group",CuteEntityManager::Relation(
"group",CuteEntityManager::RelationType::MANY_TO_ONE));
// hash.insert("room",CuteEntityManager::Relation(
// "room",CuteEntityManager::RelationType::MANY_TO_ONE));
// hash.insert("seatingPlan", CuteEntityManager::Relation(
// "seatingPlan",CuteEntityManager::RelationType::MANY_TO_ONE));
hash.insert("predecessor", CuteEntityManager::Relation("predecessor", true, CuteEntityManager::RelationType::ONE_TO_ONE));
return hash;
}
//QSharedPointer<SeatingPlan> Incident::seatingPlan() const
//{
// return m_seatingPlan;
//}
//void Incident::setSeatingPlan(const QSharedPointer<SeatingPlan> &seatingPlan)
//{
// m_seatingPlan = seatingPlan;
//}
QSharedPointer<Incident> Incident::predecessor() const
{
return m_predecessor;

Auch abrufbar als: Unified diff