Skip to content

Commit

Permalink
clazy: Use 4-arg connect in globalsettings.
Browse files Browse the repository at this point in the history
Clazy recommends using the 4-arg variant of Object::connect over the
3-arg version. The main reason for this is that the signal will not be
called if the target object has been deleted.

In this instance, the lambda doesn't really require an object since is
only calling static functions, and functions on a global object. Use
the sender object as the receiver, which should guarantee that the
receiver object is always valid.

https://github.com/KDE/clazy/blob/master/docs/checks/README-connect-3arg-lambda.md
  • Loading branch information
linuxdude42 committed Nov 6, 2021
1 parent 89bf2a9 commit 8277bf1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mythtv/programs/mythfrontend/globalsettings.cpp
Expand Up @@ -117,7 +117,7 @@ static HostTextEditSetting *VAAPIDevice()
ge->setHelpText(help);

// update VideoDisplayProfile statics if this changes
QObject::connect(ge, &HostTextEditSetting::ChangeSaved,
QObject::connect(ge, &HostTextEditSetting::ChangeSaved, ge,
[]()
{
QString device = gCoreContext->GetSetting("VAAPIDevice");
Expand Down

0 comments on commit 8277bf1

Please sign in to comment.