Revision abb9e8c5
Von Christian Ehringfeld vor fast 9 Jahren hinzugefügt
src/cache.cpp | ||
---|---|---|
}
|
||
|
||
void Cache::insert(QSharedPointer<Entity> &entity) {
|
||
if (entity.data() && entity.data()->getId() > -1) {
|
||
QString key = this->generateKey(entity.data()->getId(),
|
||
QString(entity.data()->getClassname()));
|
||
if (entity.data() && entity->getId() > -1) {
|
||
QString key = this->generateKey(entity->getId(),
|
||
QString(entity->getClassname()));
|
||
if (this->cache.contains(key)) {
|
||
QSharedPointer<Entity> ptr = this->cache.value(key).toStrongRef();
|
||
if (!ptr.isNull()) {
|
||
... | ... | |
}
|
||
|
||
void Cache::remove(const QSharedPointer<Entity> &entity) {
|
||
if (entity.data() && entity.data()->getId() > -1) {
|
||
this->remove(entity.data()->getId(), QString(entity.data()->getClassname()));
|
||
if (entity.data() && entity->getId() > -1) {
|
||
this->remove(entity->getId(), QString(entity->getClassname()));
|
||
}
|
||
}
|
||
|
Auch abrufbar als: Unified diff
example not working - wip, maybe tomorrow