[TD] Gui: remove some superfluous nullptr checks

This commit is contained in:
Uwe
2022-07-19 02:49:46 +02:00
parent 140e89e858
commit b514f47c21
38 changed files with 154 additions and 160 deletions

View File

@@ -210,13 +210,13 @@ void QGEPath::hoverEnterEvent(QGraphicsSceneHoverEvent *event)
void QGEPath::hoverLeaveEvent(QGraphicsSceneHoverEvent *event)
{
QGIView *view = dynamic_cast<QGIView *> (parentItem());
assert(view != nullptr);
assert(view);
Q_UNUSED(view);
Q_EMIT hover(false);
QGraphicsItem* parent = parentItem();
bool parentSel(false);
if (parent != nullptr) {
if (parent) {
parentSel = parent->isSelected();
}
if (!parentSel && !isSelected()) {
@@ -291,10 +291,10 @@ void QGEPath::clearMarkers()
return;
}
for (auto& m: m_markers) {
if (m != nullptr) {
if (m) {
m->hide();
QGraphicsScene* s = m->scene();
if (s != nullptr) {
if (s) {
s->removeItem(m); //should this be setParentItem(nullptr) instead??
}
delete m;
@@ -335,7 +335,7 @@ void QGEPath::onDoubleClick(QPointF pos, int markerIndex)
void QGEPath::onEndEdit(void)
{
// Base::Console().Message("QGEPath::onEndEdit()\n");
if (m_ghost != nullptr) {
if (m_ghost) {
scene()->removeItem(m_ghost); //stop ghost from messing up brect
}
inEdit(false);