Heart 1.3.842.34c2ab5
Heart is base back end library for your c++ Qt projects.
softdelete.cpp
Go to the documentation of this file.
1/*
2 * Copyright (C) 2018-2024 QuasarApp.
3 * Distributed under the lgplv3 software license, see the accompanying
4 * Everyone is permitted to copy and distribute verbatim copies
5 * of this license document, but changing it is not allowed.
6*/
7
8#include "softdelete.h"
9#include <quasarapp.h>
10
12
14
15 if (!fSoftDelete) {
16
17 QuasarAppUtils::Params::log(QString("You delete %0 without preparing. "
18 "All changes can not be saved. "
19 "For fix it trouble use the softDelete method.").arg(typeid (this).name()),
20 QuasarAppUtils::Error);
21#ifdef QT_DEBUG
22 std::abort();
23#endif
24
25 }
26}
27
29 fSoftDelete = true;
30 prepareForDelete();
31 delete this;
32}
33
void softDelete()
softDelete This method remove this object and save all changes into database.
virtual ~SoftDelete()
~SoftDelete This destructor has bin crashed if the softDelete method not will be invoked before delet...