Skip to content

Commit

Permalink
tidy: Explicitly convert from boolean to AutoExpireType in playbackbo…
Browse files Browse the repository at this point in the history
…x.cpp.

The clang-tidy "implicit boolean conversion" check pointed out one
place where a boolean was being converted to an integer, which on
investigation was then being cast to AutoExpireType.  Fix this to
explicitly convert from a boolean straight to AutoExpireType.

https://clang.llvm.org/extra/clang-tidy/checks/readability-implicit-bool-conversion.html
  • Loading branch information
linuxdude42 committed Apr 3, 2019
1 parent 3246b15 commit a18f476
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions mythtv/programs/mythfrontend/playbackbox.cpp
Expand Up @@ -4926,7 +4926,8 @@ void PlaybackBox::setRecGroup(QString newRecGroup)

RecordingRule record;
record.LoadTemplate("Default");
uint defaultAutoExpire = record.m_autoExpire;
AutoExpireType defaultAutoExpire =
record.m_autoExpire ? kNormalAutoExpire : kDisableAutoExpire;

if (m_op_on_playlist)
{
Expand All @@ -4940,7 +4941,7 @@ void PlaybackBox::setRecGroup(QString newRecGroup)
if ((p->GetRecordingGroup() == "LiveTV") &&
(newRecGroup != "LiveTV"))
{
p->SaveAutoExpire((AutoExpireType)defaultAutoExpire);
p->SaveAutoExpire(defaultAutoExpire);
}
else if ((p->GetRecordingGroup() != "LiveTV") &&
(newRecGroup == "LiveTV"))
Expand All @@ -4962,7 +4963,7 @@ void PlaybackBox::setRecGroup(QString newRecGroup)
return;

if ((p->GetRecordingGroup() == "LiveTV") && (newRecGroup != "LiveTV"))
p->SaveAutoExpire((AutoExpireType)defaultAutoExpire);
p->SaveAutoExpire(defaultAutoExpire);
else if ((p->GetRecordingGroup() != "LiveTV") && (newRecGroup == "LiveTV"))
p->SaveAutoExpire(kLiveTVAutoExpire);

Expand Down

0 comments on commit a18f476

Please sign in to comment.