Skip to content

Commit

Permalink
Fix customEvent handlers to chain up to their parent.
Browse files Browse the repository at this point in the history
The clang-tidy "bugprone parent virtual call" checker pointed out a
couple of places where customEvent handlers either don't call up to
their parent, or skip the parent and call up to the grandparent.  Fix
these so that they all call from child to parent.

https://clang.llvm.org/extra/clang-tidy/checks/bugprone-parent-virtual-call.html
  • Loading branch information
linuxdude42 committed Nov 23, 2019
1 parent 8964b5a commit c22b812
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
1 change: 1 addition & 0 deletions mythplugins/mythzoneminder/mythzoneminder/zmliveplayer.cpp
Expand Up @@ -297,6 +297,7 @@ void ZMLivePlayer::customEvent(QEvent *event)
}
}
}
MythUIType::customEvent(event);
}

void ZMLivePlayer::changeView(void)
Expand Down
4 changes: 1 addition & 3 deletions mythplugins/mythzoneminder/mythzoneminder/zmminiplayer.cpp
Expand Up @@ -105,9 +105,7 @@ void ZMMiniPlayer::customEvent (QEvent* event)
}
}

// Parent MythUIType handler always returns false. (Shouldn't it
// call up?) Continue to call QObject as before.
QObject::customEvent(event);
ZMLivePlayer::customEvent(event);
}

bool ZMMiniPlayer::keyPressEvent(QKeyEvent *event)
Expand Down
3 changes: 2 additions & 1 deletion mythtv/libs/libmythui/mythuitype.cpp
Expand Up @@ -974,8 +974,9 @@ bool MythUIType::keyPressEvent(QKeyEvent * /*event*/)
}


void MythUIType::customEvent(QEvent * /*event*/)
void MythUIType::customEvent(QEvent *event)
{
QObject::customEvent(event);
}

/** \brief Mouse click/movement handler, receives mouse gesture events from the
Expand Down

0 comments on commit c22b812

Please sign in to comment.